attest Docs

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.

Request · cURL
curl -X POST https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30/finalize \
  -H "Authorization: Bearer $ATTEST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Request · JavaScript
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());
Request · Python
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 #

NameTypeRequiredDescription
pairIdstring (path)RequiredThe pair identifier sent with the observations. Must match ^[A-Za-z0-9_-]{16,128}$.
(body)objectOptionalSend an empty object. The body is ignored.

Response #

200 The finalized pair.

Response fields #

FieldTypeDescription
pairIdstringThe pair identifier.
lifecycleOPEN | FINALIZEDOPEN until finalize is called.
reconciliationStatusmatched | divergent | incomplete | orphanednull while OPEN with one stage. Fixed once FINALIZED.
assemblyObservedbooleanattest holds an assembly observation.
deliveryObservedbooleanattest holds a delivery observation. false does not mean the operation failed or did not run.
finalizedbooleantrue once finalize has been called.
executionStateunknownAlways unknown. Observations cannot prove whether your operation executed.
divergencesarrayEach compared field that differs between stages.
assemblyobject | null
deliveryobject | null
finalizedAtstring | nullWhen the pair was finalized.
reconciliationFormatattest-witness-reconciliation-v1Format of the finalized reconciliation record.
reconciliationDigeststring | nullSHA-256 of the canonical finalized reconciliation record.
Response · 200
{
  "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 #

StatuserrorcodeMeaning
400pairId is malformed—The pairId in the path is malformed.
401Invalid API key—The API key is missing, unknown, revoked, or belongs to an environment that is not active.
404Witness pair not found—No pair with this pairId exists in the key's environment.
500Witness finalization failed—The pair could not be finalized.

All error bodies and their causes are listed in Errors.

Response · 400
{
  "error": "pairId is malformed"
}
Response · 401
{
  "error": "Invalid API key"
}