API reference
Finalize a witness pair
Closes a pair and fixes its reconciliation status permanently; calling it again returns the same finalized pair and creates no Verification Pass.
POST/v1/witness/{pairId}/finalize
Overview #
Closes a pair and fixes its reconciliation status permanently; calling it again returns the same finalized pair and creates no Verification Pass.
Authenticate with an environment API key in the Authorization: Bearer header. See Authentication.
The example uses the pair recorded in the Record a witness observation example after both its assembly and delivery observations are accepted.
curl -X POST https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30/finalize \
-H "Authorization: Bearer $ATTEST_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch("https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30/finalize", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATTEST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
console.log(response.status, await response.json());import json, os, urllib.request
request = urllib.request.Request(
"https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30/finalize",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["ATTEST_API_KEY"],
"Content-Type": "application/json",
},
data=json.dumps({}).encode(),
)
with urllib.request.urlopen(request) as response:
print(response.status, json.loads(response.read()))Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
pairId | string (path) | Required | The pair identifier sent with the observations. Must match ^[A-Za-z0-9_-]{16,128}$. |
(body) | object | Optional | Send an empty object. The body is ignored. |
Response #
200 The finalized pair.
Response fields #
| Field | Type | Description |
|---|---|---|
pairId | string | The pair identifier. |
lifecycle | OPEN | FINALIZED | OPEN until finalize is called. |
reconciliationStatus | matched | divergent | incomplete | orphaned | null while OPEN with one stage. Fixed once FINALIZED. |
assemblyObserved | boolean | attest holds an assembly observation. |
deliveryObserved | boolean | attest holds a delivery observation. false does not mean the operation failed or did not run. |
finalized | boolean | true once finalize has been called. |
executionState | unknown | Always unknown. Observations cannot prove whether your operation executed. |
divergences | array | Each compared field that differs between stages. |
assembly | object | null | |
delivery | object | null | |
finalizedAt | string | null | When the pair was finalized. |
reconciliationFormat | attest-witness-reconciliation-v1 | Format of the finalized reconciliation record. |
reconciliationDigest | string | null | SHA-256 of the canonical finalized reconciliation record. |
{
"pairId": "pr_9c1d4e7a2b5f8e30",
"lifecycle": "FINALIZED",
"reconciliationStatus": "matched",
"assemblyObserved": true,
"deliveryObserved": true,
"finalized": true,
"executionState": "unknown",
"divergences": [],
"assembly": {
"accepted": true,
"evidenceHash": "ee76c475080687b51e6b4cc3cfb3846e985db8d88b4c26afd33fdb8963be5248",
"receiptId": "moni_wit_25920e7d-f381-4205-ad6a-85656cb4d60a",
"outcome": "ok"
},
"delivery": {
"accepted": true,
"evidenceHash": "ee76c475080687b51e6b4cc3cfb3846e985db8d88b4c26afd33fdb8963be5248",
"receiptId": "moni_wit_14c76ce2-ce0f-4f63-9e3a-10998b6e821a",
"outcome": "ok"
},
"finalizedAt": "2026-10-19T14:03:08.311Z",
"reconciliationFormat": "attest-witness-reconciliation-v1",
"reconciliationDigest": "1b6aedbc1fde62f88d103df093cf26e60fc173d878825aea2ffd18a05dd7b9d1"
}Errors #
| Status | error | code | Meaning |
|---|---|---|---|
400 | pairId is malformed | — | The pairId in the path is malformed. |
401 | Invalid API key | — | The API key is missing, unknown, revoked, or belongs to an environment that is not active. |
404 | Witness pair not found | — | No pair with this pairId exists in the key's environment. |
500 | Witness finalization failed | — | The pair could not be finalized. |
All error bodies and their causes are listed in Errors.
{
"error": "pairId is malformed"
}{
"error": "Invalid API key"
}