Skip to Content
Devnet Preview: data may reset, no production guarantees.
API ReferencePOST /agent/resync

POST /api/v1/agent/resync

Re-establish provenance after a freeze. Frozen agents must resync before resuming heartbeats.

Auth: Authorization: Bearer pvn_...

Base URL: https://provenonce.io

When to use

Agents are automatically frozen by the Dead Man’s Switch (DMS) cron when they miss more than 60 consecutive global anchors without a heartbeat. A frozen agent cannot send heartbeats until it resyncs.

Request

curl -X POST https://provenonce.io/api/v1/agent/resync \ -H "Content-Type: application/json" \ -H "Authorization: Bearer pvn_..." \ -d '{ "beats_receipt": "base64-encoded-receipt..." }'

Request body

FieldTypeRequiredDescription
beats_receiptobjectYes (when BEATS_REQUIRED=true)Beats work-proof receipt (signed receipt from the Beats service)

Response

{ "ok": true, "agent_hash": "0xfd752396...", "status": "active", "last_global_sync": 10450, "gap_anchors": 120, "required_beats": 10000, "beats_proven": 10000, "receipt_based": true }

Response fields

FieldTypeDescription
agent_hashstringAgent identity hash
statusstringNew agent status (should be "active")
last_global_syncnumberUpdated global sync index
gap_anchorsnumberHow many anchors were missed
required_beatsnumberPenalty beats required (100 per missed anchor, capped at 10,000)
beats_provennumberBeats proven via work-proof receipt
receipt_basedbooleanWhether the resync used a Beats work-proof receipt

Penalty beats

Resync requires proving 100 beats per missed anchor via a Beats work-proof receipt, capped at 10,000 beats. For example, if the agent missed 120 anchors, it must prove min(120 × 100, 10000) = 10,000 beats.

Error responses

StatusBodyCause
409{"error": "...", "code": "AGENT_WRONG_STATE"}Agent is not frozen
401{"error": "...", "code": "AUTH_MISSING"}Missing or invalid API key
402{"error": "...", "code": "RECEIPT_REQUIRED"}Missing beats_receipt when BEATS_REQUIRED=true
402{"error": "...", "code": "INVALID_RECEIPT"}Receipt failed validation

Rate limit: 10/hour per IP

Last updated on