Requirements: Python 3.9 or later. Uses
httpx for HTTP requests.Installation
Quick Start
quickstart.py
Client Configuration
Idempotency keys
The SDK generates anIdempotency-Key header automatically on every write operation (mint, revoke, supersede), making retries safe by default. If a request fails and is retried, the server returns the original response instead of performing the action twice.
When multiple applications share the same tenant, set idempotency_prefix to namespace the auto-generated keys and prevent collisions:
billing-svc_<uuid>, while onboarding produces onboarding-svc_<uuid> — so concurrent requests from different services never conflict.
Idempotency keys expire after 24 hours. If you omit
idempotency_prefix, keys are generated without a prefix and are still unique per request.Retry behavior
Whenmax_retries is set (default: 3), the SDK automatically retries failed requests using exponential backoff with jitter.
What gets retried
The SDK retries when all of the following are true:- The HTTP status code is retryable:
408,429,500,502,503, or504 - The retry count has not exceeded
max_retries
400, 401, 403, 404, or 409 are not retried.
Backoff schedule
The delay doubles on each attempt, capped at 2 seconds. If the API returns a
429 with a Retry-After header, the SDK waits the server-specified duration instead.
Disabling retries
The SDK generates idempotency keys automatically for write operations, so retries for mint and revoke calls are safe. See idempotency keys to configure a prefix for multi-service environments.
Error handling
Revoke an attestation
Permanently invalidate an attestation. Once revoked, any verification check returnsREVOKED. This action cannot be undone — if you need to issue an updated credential instead, use supersede.
revoke.py
Supersede an attestation
Replace an existing attestation with an updated version. The original is marked asSUPERSEDED and linked to the new one, creating an auditable version chain.
supersede.py
Both the original and new attestation remain in the transparency log. Verifiers can trace the full chain using the
superseded_by_attestation_id field on the original.Context Manager
Use the client as a context manager to ensure proper cleanup of HTTP connections.API Reference
Issuers
client.issuers.create(name, ...)- Create a new issuerclient.issuers.list(limit, offset)- List issuersclient.issuers.get(issuer_id)- Get issuer by IDclient.issuers.trust(issuer_id)- Trust an issuer
Attestations
client.attestations.mint(...)- Mint a new attestationclient.attestations.get(id)- Get attestation detailsclient.attestations.list(limit, offset)- List attestationsclient.attestations.revoke(id, reason)- Revoke an attestationclient.attestations.supersede(attestation_id, payload_b64url)- Supersede an attestationclient.attestations.proof_bundle(id)- Get proof bundle
Receipts
client.receipts.mint(req)- Mint a signed receiptclient.receipts.get(receipt_id)- Get receipt by IDclient.receipts.list(filter?)- List receipts with optional filtersclient.receipts.revoke(receipt_id, reason?)- Revoke a receiptclient.receipts.list_types()- List available receipt typesclient.receipts.get_type(name)- Get a receipt type by nameclient.receipts.get_proof_bundle(receipt_id)- Get proof bundleclient.receipts.verify(receipt_id)- Verify a receiptclient.receipts.search(**kwargs)- Search receiptsclient.receipts.export(format, filters?)- Queue bulk exportclient.receipts.get_export(export_id)- Get export job statusclient.receipts.redact(receipt_id)- Redact receipt payload
Verify
client.verify.verify_online(attestation_id, payload_b64url)- Verify attestation online
Audit
client.audit.query(params)- Query audit events with filtersclient.audit.export(data)- Start an async audit log export
Governance
client.governance.list_requests()- List governance requestsclient.governance.create_request(data)- Create a governance requestclient.governance.approve_request(id)- Approve a pending requestclient.governance.execute_request(id)- Execute an approved request
Querying audit logs
Retrieve audit events to track API activity, monitor security events, and generate compliance reports. Filter by action, actor, resource, or time range.audit.py
Governance workflows
Manage formal issuer actions — suspend, revoke, reinstate, and change trust tier — through a multi-party approval workflow. Create a request, collect approvals from authorized reviewers, then execute.governance.py
Audit queries and exports
Query audit events with filters and export logs for compliance reporting. Useclient.audit.query() to search events and client.audit.export() to start an asynchronous export job.
audit.py
Receipt operations
Mint, verify, search, export, and redact cryptographically signed receipts. See the receipts guide for an overview of receipt types and the full lifecycle.receipts.py

