attest Docs

API reference

Retrieve a witness pair

Returns the current state of a pair in the key's environment; reading never changes the pair and creates no Verification Pass.

GET/v1/witness/{pairId}

Overview #

Returns the current state of a pair in the key's environment; reading never changes the 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 https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30 \
  -H "Authorization: Bearer $ATTEST_API_KEY"
Request · JavaScript
const response = await fetch("https://attestinfra.com/v1/witness/pr_9c1d4e7a2b5f8e30", {
  headers: {
    Authorization: `Bearer ${process.env.ATTEST_API_KEY}`,
  },
});
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",
    headers={
        "Authorization": "Bearer " + os.environ["ATTEST_API_KEY"],
    },
)
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}$.

Response #

200 The pair. Before finalization, reconciliationStatus is computed from the observations present and can still change.

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": "OPEN",
  "reconciliationStatus": "matched",
  "assemblyObserved": true,
  "deliveryObserved": true,
  "finalized": false,
  "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": null,
  "reconciliationFormat": null,
  "reconciliationDigest": null
}

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.

All error bodies and their causes are listed in Errors.

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