Docs Chains
API Reference

Chains

Create, retrieve, and verify proof chains. The chain is the core object in SwiftProof.

POST /v1/chains

Create a new chain. Returns confirmation URLs for each actor and a tracking URL for the end customer.

Request body

ParameterTypeDescription
titlestring requiredHuman-readable name for this chain. Shown to actors and on the tracking page.
actorsarray requiredOrdered list of handoff objects. Minimum 1, maximum 10.
actors[].eventstring requiredName of this step. e.g. "packed", "collected", "delivered".
actors[].actorstring requiredDisplay name of the person responsible for confirming this step.
metadataobject optionalArbitrary key-value pairs attached to the chain. Returned in verification responses.
expires_in_hoursinteger optionalHours before confirmation links expire. Default 48. Min 1, max 168.
POST /v1/chains
{
  "title": "Order #4821 — Lekki Phase 1",
  "metadata": { "orderId": "4821" },
  "expires_in_hours": 48,
  "actors": [
    { "event": "packed",    "actor": "Kitchen — Surulere" },
    { "event": "collected", "actor": "Rider — Emeka"      },
    { "event": "delivered", "actor": "Rider — Emeka"      }
  ]
}

Response

FieldTypeDescription
chain_idstringUnique chain identifier. Store this to verify later.
statusstringopen | completed | failed
tracking_urlstringShare with the end customer. No login required.
handoffsarrayOne object per actor, each with a confirmation_url and expires_at.
created_atstringISO 8601 timestamp.

GET /v1/chains/:chain_id

Retrieve the current state of a chain, including which steps have been confirmed and which are pending.

JavaScript
const chain = await sp.chains.get('sp_ch_a96fec076ffd44f4');

GET /v1/chains/:chain_id/verify

Verify the integrity of a completed chain. Returns the full audit trail with tamper detection. See Verification for full details.

GET /v1/chains

List chains for your project. Returns the 20 most recent by default.

Query paramTypeDescription
limitintegerNumber of results. Default 20, max 100.
statusstringFilter by status: open, completed, failed.
beforestringCursor for pagination. Pass chain_id of last result.