Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sync & Convergence

Endpoints for journal synchronization between mesh nodes.

GET /api/v1/sync/convergence

Check convergence status for an agent’s journal.

Query parameters

ParamRequiredDescription
agentyesAgent name

Response 200 OK

{
  "agent": "researcher",
  "local_seq": 142,
  "peers": [
    {"peer_id": "node-beta", "acked_seq": 140, "lag": 2},
    {"peer_id": "node-gamma", "acked_seq": 142, "lag": 0}
  ],
  "converged": false
}

converged is true when all peers have acknowledged the local sequence.

GET /api/v1/sync/envelopes

Retrieve sync envelopes (journal entries packaged for replication).

Query parameters

ParamTypeDefaultDescription
agentstringrequiredAgent name
sinceinteger0Return envelopes after this sequence
limitinteger100Maximum envelopes to return

Response 200 OK

{
  "envelopes": [
    {
      "seq": 141,
      "agent": "researcher",
      "payload_hash": "sha256:abc123...",
      "timestamp": "2026-03-17T10:00:00Z",
      "signature": "ed25519:..."
    }
  ]
}

POST /api/v1/sync/envelopes

Push envelopes from a remote peer. Used by the mesh sync protocol.

Request body

{
  "peer_id": "node-beta",
  "envelopes": [
    {
      "seq": 143,
      "agent": "researcher",
      "payload": "base64-encoded-data",
      "signature": "ed25519:..."
    }
  ]
}

Response 200 OK

{"accepted": 1, "rejected": 0}

Envelopes with invalid signatures or duplicate sequences are rejected.