API reference
Platform
32 operations in this area of the contract. Every one declares the permission it requires.
Contract version 0.3.0All areas
Operations
/v1/admin/commercial/offersList immutable commercial offer versions
Platform catalogue with exact deployment, base-term and offer-key predicates before LIMIT and genuine created_at/id order in either direction. Cursors bind caller institution, all filters and order. Normal supplied terms and components remain unchanged; this is not an invoice.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort | query | created_at_desc | created_at_asc | — |
deployment_mode | query | saas | onprem | — |
base_term_type | query | saas_subscription | onprem_licence | — |
offer_key | query | string | — |
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
Responses
200Offer versionsCommercialOfferPage
/v1/admin/commercial/offersCreate an immutable offer version
Records supplied terms without inventing a price. Money is optional integer minor units plus a supported ISO currency. SaaS supports monthly/annual subscriptions and optional allowances/rates. On-prem supports one-time/annual licence terms and cannot commit without a separately typed annual support/maintenance component. Add-ons and professional services remain separate components.
Show parameters and responsesHide parameters and responses
Responses
201Immutable offer versionCommercialOffer400—409The offer key/version already exists
/v1/admin/commercial/offers/exportExport the complete authorized commercial metadata register as CSV or Excel
One authenticated platform-pool repeatable-read snapshot, using the same supplied read connection on all pages. After that snapshot commits, a separate caller-tenant transaction non-consumingly rechecks the active original caller identity, original/current required permission intersection and any existing support-grant binding and current expiry/revocation, then commits the exact artifact digest, row count, selected scope and ordering receipt. Bytes are withheld on either phase failure. No cross-pool atomicity claim or platform app-table grants. Own-history remains own tenant; management remains explicit platform authority. Free notes/source, operator identity/labels, free revision reason and component private descriptions are excluded before JSON capture. Monetary terms and revision metadata use exact decimal strings; missing supplied money remains absent, never zero. No charges, invoices, licence assertions or commercial write transitions are added. Maximum 10,000 rows and 32 MiB; no partial artifact; cursor input is refused. Columns: id, offer_key, version, display_name, deployment_mode, base_term_type, billing_cadence, allowance_interval, transaction_allowance, user_allowance, currency, base_amount_minor, transaction_overage_minor, user_overage_minor, available_from, available_until, created_at.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
formatrequired | query | csv | xlsx | — |
sort | query | created_at_desc | created_at_asc | — |
deployment_mode | query | saas | onprem | — |
base_term_type | query | saas_subscription | onprem_licence | — |
offer_key | query | string | — |
Responses
200Complete metadata with retained caller audit receipt400—403—503—
/v1/admin/feature-flagsRead effective tenant feature switches
Uses the tenant database and works offline. Only declared product capabilities are accepted; switches cannot bypass authorization or compliance controls.
Show parameters and responsesHide parameters and responses
Responses
200Effective switch values and optimistic revisionsobject
/v1/admin/feature-flags/{flagKey}Audit a tenant feature switch change
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
flagKeyrequired | path | operations.job_console | ai.assistance | — |
Responses
200Committed audited changeobject404—409—
/v1/admin/jobsList retained background jobs for the authenticated tenant
Operational metadata only: arguments, errors, metadata targets and global sweep jobs are excluded before JSON leaves the tenant reader. Exact state/kind/queue filters run before LIMIT. Numeric bigint ID ordering supports id_desc and id_asc without JavaScript number conversion. Canonical cursors bind tenant, all filters and order. The legacy unfiltered id_desc before/next_before walk remains supported; before cannot be combined with a canonical cursor, a filter or ascending order.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | — |
before | query | string | — |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
sort | query | id_desc | id_asc | — |
state | query | available | cancelled | completed | discarded | pending | retryable | running | scheduled | — |
kind | query | string | — |
queue | query | string | — |
Responses
200Retained tenant jobsAdminJobPage400—
/v1/admin/jobs/{jobID}/discardAudit and discard a queued tenant job
Atomically records the reason and discards available, retryable, scheduled or pending work. Running or finalized work is refused.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobIDrequired | path | string | — |
Responses
200Audited state transitionAdminJobTransition404—409—
/v1/admin/jobs/{jobID}/retryAudit and retry a failed or cancelled tenant job
Atomically records the operator reason and makes a retryable, discarded or cancelled job available. Running and completed jobs are refused.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
jobIDrequired | path | string | — |
Responses
200Audited state transitionAdminJobTransition404—409—
/v1/admin/jobs/exportExport all matching retained tenant job metadata as CSV or Excel
Uses one tenant repeatable-read snapshot and the same tenant-owned filtered reader on every page. Only id, kind, queue, state, attempt, max_attempts, created_at, scheduled_at and finalized_at enter the capture. Job args, errors, metadata targets, other tenants and global sweep work never enter the artifact. The job-console feature switch and current platform.jobs.manage permission remain required. Audit digest and complete row count commit in the same snapshot transaction before bytes are delivered. Up to 10,000 rows and 32 MiB; no partial artifact. Each reader page remains bounded to 100 rows. Cursor and legacy before input are refused. Retry/discard/cancellation semantics are unchanged.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
formatrequired | query | csv | xlsx | — |
sort | query | id_desc | id_asc | — |
state | query | available | cancelled | completed | discarded | pending | retryable | running | scheduled | — |
kind | query | string | — |
queue | query | string | — |
Responses
200Complete tenant metadata with committed digest receipt400—403—503—
/v1/admin/key-rotationsPropose a tenant subject-DEK root-key rewrap ceremony
The source must be the active configured root and the target must already be configured but inactive. A distinct system administrator approves the resulting maker-checker request. Approval installs an irreversible write barrier for the source while it is still active; it does not switch keys or rewrap data. New subject and audit-anchor writes may therefore refuse during the deliberately short operator cutover. There is no cancel/unblock operation and this endpoint never authorizes physical root removal.
Show parameters and responsesHide parameters and responses
Responses
201Pending four-eyes approval; no barrier or wrapper has changed yetApprovalRequest409A proposal is already pending or the source/target state is not valid503The provider cannot enumerate every configured root, so rotation refuses fail closed
/v1/admin/key-rotations/{rotationID}Read rotation progress, readiness and retirement dependencies
Distinguishes the expected approved-awaiting-key-switch phase from a runnable or blocked configuration. Dependency counts are tenant-scoped. Immutable historical identifier blind indexes and audit anchors normally keep `tenant_dependencies_clear` false, and every tenant would have to be assessed before a process-wide software root could even be considered for a separate retirement ceremony. This API always reports `physical_retirement_supported: false`.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
rotationIDrequired | path | string | — |
Responses
200Durable rotation cursor and fail-closed readinessSubjectDEKRotationReadiness404—
/v1/admin/key-rotations/{rotationID}/runStart or resume bounded subject-DEK wrapper batches
Refuses until the approved target is active, the source remains configured, provider enumeration is complete and both key fingerprints still match approval. The worker authenticates and rewraps at most 100 subject-DEK envelopes per transaction, records immutable per-subject evidence, and transactionally enqueues the next page. It never decrypts or rewrites subject fields. Repeating this call while work is active is idempotent. It does not remove the source root.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
rotationIDrequired | path | string | — |
Responses
202Bounded resumable work acceptedSubjectDEKRotationReadiness404—409Awaiting target activation, blocked, or already complete
/v1/admin/tenants/{tenantID}/commercialOne tenant's commercial summary
Vendor control-plane read. It does not grant access to customer/AML records.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
Responses
200Recorded terms and usage coverageCommercialSummary
/v1/admin/tenants/{tenantID}/commercial/agreementsRecord a tenant commercial agreement
Links an immutable offer version to a tenant, with an explicit half-open term and IANA billing timezone. Selected components must belong to that exact offer; on-prem terms require selected annual support. This operation records commercial state only—it does not take payment, issue an invoice, enable a vendor feed or change tenant lifecycle.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
Responses
201Agreement and first immutable history revisionCommercialAgreement400—404—409A live agreement or agreement reference already exists
/v1/admin/tenants/{tenantID}/commercial/agreements/{agreementID}/historyImmutable history for a managed tenant agreement
Filters apply before LIMIT. Cursors bind caller institution, selected tenant, agreement, read authority mode, filters and the actual stored revision direction.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort | query | revision_desc | revision_asc | — |
status | query | provisioning | current | renewal_due | grace | past_due | disputed | ended | not_applicable | — |
event_type | query | created | status_changed | — |
tenantIDrequired | path | string | — |
agreementIDrequired | path | string | — |
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
Responses
200Typed selected-agreement revisions in the requested stored revision orderCommercialHistoryPage
/v1/admin/tenants/{tenantID}/commercial/agreements/{agreementID}/history/exportExport the complete authorized commercial metadata register as CSV or Excel
One authenticated platform-pool repeatable-read snapshot, using the same supplied read connection on all pages. After that snapshot commits, a separate caller-tenant transaction non-consumingly rechecks the active original caller identity, original/current required permission intersection and any existing support-grant binding and current expiry/revocation, then commits the exact artifact digest, row count, selected scope and ordering receipt. Bytes are withheld on either phase failure. No cross-pool atomicity claim or platform app-table grants. Own-history remains own tenant; management remains explicit platform authority. Free notes/source, operator identity/labels, free revision reason and component private descriptions are excluded before JSON capture. Monetary terms and revision metadata use exact decimal strings; missing supplied money remains absent, never zero. No charges, invoices, licence assertions or commercial write transitions are added. Maximum 10,000 rows and 32 MiB; no partial artifact; cursor input is refused. Columns: id (agreement/revision identity), agreement_id, revision, event_type, offer_version_id, status, renewal_mode, term_start, term_end, grace_until, billing_timezone, occurred_at.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
agreementIDrequired | path | string | — |
formatrequired | query | csv | xlsx | — |
sort | query | revision_desc | revision_asc | — |
status | query | provisioning | current | renewal_due | grace | past_due | disputed | ended | not_applicable | — |
event_type | query | created | status_changed | — |
Responses
200Complete metadata with retained caller audit receipt400—403—503—
/v1/admin/tenants/{tenantID}/commercial/agreements/{agreementID}/statusTransition commercial agreement status
Follows the closed lifecycle graph and appends an immutable revision. Past due and disputed are visible commercial states, never automatic AML suspension or quota gates.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
agreementIDrequired | path | string | — |
Responses
200Agreement in its new commercial stateCommercialAgreement400—404—409Concurrent revision conflict
/v1/admin/upload-quarantineRejected-upload metadata and verified reupload status
Filters apply before the bounded tuple page. Cursors bind tenant, scope and order. Old unbound cursors must restart. Every read rechecks current tenant permissions.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
kind | query | document | case_attachment | validation_evidence | — |
status | query | pending | retry_requested | dismissed | recovered | — |
sort | query | created_at_desc | created_at_asc | Indexed tuple order; filter/order/tenant changes require a new cursor walk. |
Responses
200Quarantine metadata; no file bytes, filenames or subject referencesUploadQuarantinePage400—403—503—
/v1/admin/upload-quarantine/{quarantineID}/dispositionRequest a fresh scan or dismiss a rejected upload
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
quarantineIDrequired | path | string | — |
Responses
200Audited disposition recorded; rejected bytes can never be releasedUploadQuarantineDisposition409—
/v1/commercial/agreements/{agreementID}/historyImmutable history for this tenant's agreement
Filters apply before LIMIT. Cursors bind caller institution, selected tenant, agreement, read authority mode, filters and the actual stored revision direction.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort | query | revision_desc | revision_asc | — |
status | query | provisioning | current | renewal_due | grace | past_due | disputed | ended | not_applicable | — |
event_type | query | created | status_changed | — |
agreementIDrequired | path | string | — |
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
Responses
200Typed selected-agreement revisions in the requested stored revision orderCommercialHistoryPage
/v1/commercial/agreements/{agreementID}/history/exportExport the complete authorized commercial metadata register as CSV or Excel
One tenant RLS repeatable-read snapshot, using the same supplied read connection on all pages. After that snapshot commits, a separate caller-tenant transaction non-consumingly rechecks the active original caller identity, original/current required permission intersection and any existing support-grant binding and current expiry/revocation, then commits the exact artifact digest, row count, selected scope and ordering receipt. Bytes are withheld on either phase failure. No cross-pool atomicity claim or platform app-table grants. Own-history remains own tenant; management remains explicit platform authority. Free notes/source, operator identity/labels, free revision reason and component private descriptions are excluded before JSON capture. Monetary terms and revision metadata use exact decimal strings; missing supplied money remains absent, never zero. No charges, invoices, licence assertions or commercial write transitions are added. Maximum 10,000 rows and 32 MiB; no partial artifact; cursor input is refused. Columns: id (agreement/revision identity), agreement_id, revision, event_type, offer_version_id, status, renewal_mode, term_start, term_end, grace_until, billing_timezone, occurred_at.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
agreementIDrequired | path | string | — |
formatrequired | query | csv | xlsx | — |
sort | query | revision_desc | revision_asc | — |
status | query | provisioning | current | renewal_due | grace | past_due | disputed | ended | not_applicable | — |
event_type | query | created | status_changed | — |
Responses
200Complete metadata with retained caller audit receipt400—403—503—
/v1/commercial/summaryThis tenant's commercial summary
Own-tenant, read-only view of the recorded agreement, immutable offer version, entitlement-only components, commercial status and usage evidence. Missing agreement or measurement is labelled unavailable rather than rendered as zero. A sanctions or adverse-media add-on is never proof that a provider feed is licensed or connected.
This is not an invoice or payment statement, and a past-due/disputed status does not suspend AML, screening or ingestion. Suspension remains the separate explicit tenant lifecycle operation.
Show parameters and responsesHide parameters and responses
Responses
200Recorded commercial terms and coverageCommercialSummary
/v1/iam/impersonation-grants/exportExport the complete authorized metadata register as CSV or Excel
A single tenant repeatable-read snapshot with tenant RLS and one declared status cutoff. Excludes platform_actor, free reason and reference before JSON capture. This is not an estate-wide support reader. All pages use the same read connection. After the read snapshot commits, a separate caller-tenant transaction rechecks current active identity, original permission ceiling and any existing grant binding without consuming another support use, then commits the digest/row-count audit receipt. Bytes are withheld on either phase failure. There is no cross-pool atomicity claim. No added platform app-table privileges. Maximum 10,000 rows/32 MiB; no partial artifact; cursor input is refused. CSV formulas are escaped and Excel cells are text. Metadata columns: id, reason_code, status, granted_at, expires_at, revoked_at, first_used_at, last_used_at, use_count.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
formatrequired | query | csv | xlsx | — |
status | query | active | expired | revoked | — |
reason_code | query | support_ticket | incident | migration | audit | — |
sort | query | granted_at_desc | granted_at_asc | — |
Responses
200Complete authorized metadata with audited artifact digest400—401—403—503—
/v1/tenantsTenants visible to the caller
**Your own tenant, unless you are a platform operator.** `tenancy.tenant.read` is a read of your own institution's record and returns exactly one row. Seeing the estate requires `tenancy.tenant.write`.
That distinction is a fix, not a nicety. This operation previously ran an unfiltered list inside a platform transaction and returned it to anybody holding `tenancy.tenant.read` — which the ng-core pack grants to `system_admin`, `executive` and `auditor`. Three of the seven BRD §4.1 personas could enumerate every other institution on the installation: slug, legal name, segment, data residency and status.
The estate view is resumable with a caller/authority/status/order-bound `cursor`, keyed on (`created_at`, `id`) in either selected direction. Changed authority requires a new walk. The single-tenant view returns at most its own matching row and carries no cursor, because a cursor on your own record would claim there is more of it.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort | query | created_at_desc | created_at_asc | — |
status | query | provisioning | active | suspended | closed | — |
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
Responses
200TenantsTenantPage
/v1/tenantsProvision an institution
The platform control plane. Creates the tenant in **`provisioning`**, never `active`: the authenticator refuses every request from a tenant that is not active, so a tenant left provisioning cannot serve traffic until a content pack has been installed and an administrator provisioned. Creating it active would open a door into an installation with no roles in it (Q11).
`slug` is the subdomain and cannot be changed afterwards — every IdP redirect URI and webhook callback binds to it, so renaming is a migration with a cutover rather than an edit.
Show parameters and responsesHide parameters and responses
Responses
201Provisioned, awaiting activationTenant400The slug is malformed or reserved409That slug is already in use
/v1/tenants/{tenantID}One tenant
Without `tenancy.tenant.write` a caller may read only their own tenant, and asking for another id returns the same `404` a non-existent id returns. A `403` would confirm the tenant exists, which is the fact being withheld.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
Responses
200The tenantTenant404—
/v1/tenants/{tenantID}Correct a tenant's metadata
Replaces display name, segment and residency together rather than patching single fields. A partial update over three columns needs three "was this key present" checks and the one that gets forgotten silently blanks a column — `data_residency` defaulting itself back to empty would put a tenant outside the BRD §9 residency check while looking like a rename.
Status is **not** settable here. See `POST /v1/tenants/{tenantID}/status`.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
Responses
200The updated tenantTenant422—
/v1/tenants/{tenantID}/statusSuspend, resume or close a tenant
Its own operation rather than a field on the PATCH, because the blast radius is different in kind: a suspended tenant has **every** request refused by the authenticator with `tenant-inactive` from the moment this returns. An act with that reach should not be reachable by a form that also fixes a typo in the display name.
A `reason` is required for anything but a resume. The audit row is the only place the "why" survives, and "who suspended this bank, and why" is asked after the fact.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
tenantIDrequired | path | string | — |
Responses
200The tenant in its new stateTenant422—
/v1/tenants/exportExport the complete authorized metadata register as CSV or Excel
A single platform repeatable-read snapshot of authorized registry metadata. Callers without tenancy.tenant.write receive only their own institution. No identity-provider, provisioning, quota or invitation configuration is captured. All pages use the same read connection. After the read snapshot commits, a separate caller-tenant transaction rechecks current active identity, original permission ceiling and any existing grant binding without consuming another support use, then commits the digest/row-count audit receipt. Bytes are withheld on either phase failure. There is no cross-pool atomicity claim. No added platform app-table privileges. Maximum 10,000 rows/32 MiB; no partial artifact; cursor input is refused. CSV formulas are escaped and Excel cells are text. Metadata columns: id, slug, display_name, status, deployment_mode, isolation_strategy, data_residency, segment, created_at, updated_at.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
formatrequired | query | csv | xlsx | — |
sort | query | created_at_desc | created_at_asc | — |
status | query | provisioning | active | suspended | closed | — |
Responses
200Complete authorized metadata with audited artifact digest400—401—403—503—
/v1/usageRecorded usage for this tenant
Returns measurements that have already been **recorded**, in the requested global period/ID order. A period nobody measured comes back absent, not zero: those are different facts, and conflating them reports a quiet month for a tenant whose measurement simply never ran.
These rows are usage evidence, not invoices or payments. Open rows may be corrected; closed rows name the IANA billing timezone and cannot be changed.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
period_start | query | string | Inclusive lower bound, RFC 3339. A timestamp rather than a date, because `2026-08-01` means two different instants in Lagos and in UTC. |
period_end | query | string | Exclusive upper bound, RFC 3339. The window is half-open. |
limit | query | integer | Page size, capped at 200. |
cursor | query | string | Opaque keyset cursor from a previous response. Offset pagination is deliberately not offered: `OFFSET 500000` is a table scan, and if it were offered it would be used (ADR-0012). Only the collections that document this parameter can be resumed. The rest report `truncated: true` and refuse a cursor rather than silently returning the first page again — see the `truncated` field on the page schemas. |
metric | query | transaction.count | user.active | — |
state | query | open | closed | — |
sort | query | period_start_desc | period_start_asc | — |
Responses
200Recorded measurementsUsagePage
/v1/usage/exportExport recorded usage measurements as CSV or Excel
Uses the same authorized filtered measurement reader in one repeatable-read tenant snapshot. Starts at the first matching row; cursor input is refused. Up to 10,000 rows/32 MiB, with no partial artifact. Audits SHA-256 and row count before returning bytes. CSV formulas are escaped and Excel cells are text. Recorded metric values, half-open periods, method, measurement state, billing timezone and closure time are included. Missing measurements remain absent. No invoices or charges are calculated.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
formatrequired | query | csv | xlsx | — |
period_start | query | string | Inclusive lower bound, RFC 3339. A timestamp rather than a date, because `2026-08-01` means two different instants in Lagos and in UTC. |
period_end | query | string | Exclusive upper bound, RFC 3339. The window is half-open. |
metric | query | transaction.count | user.active | — |
state | query | open | closed | — |
sort | query | period_start_desc | period_start_asc | — |
Responses
200Complete recorded measurements and audited digest400—403—503—
/v1/usage/measurementsMeasure and record a period
`POST`, not `GET`, because it **writes**. The snapshot is the fact; the query that produced it is not repeatable once retention has purged the source rows, so a live count would let a closed period's usage change retroactively or vanish.
The window is **half-open**: `[period_start, period_end)`. A closed range double-counts a transaction booked exactly at a boundary midnight into two months. Timestamps rather than dates, because `2026-08-01` is two different instants in Lagos and in UTC — an hour of a bank's transactions either side of an invoice line.
Re-measuring an open period corrects the recorded row in place rather than appending a second one and is refused after closure. Maximum window: one year. A daily run-on-start worker closes the previous local calendar month from the agreement's explicit IANA timezone; its half-open period key makes retries idempotent.
Show parameters and responsesHide parameters and responses
Parameters
| Name | In | Type | Description |
|---|---|---|---|
period_startrequired | query | string | Inclusive lower bound, RFC 3339. |
period_endrequired | query | string | Exclusive upper bound, RFC 3339. A transaction booked exactly here belongs to the next period. |
Responses
201The measurements recorded for the periodUsagePage400The window is empty, inverted or longer than a year422—