Customer portal API
GET /api/v1/admin/customer-portal
Section titled “GET /api/v1/admin/customer-portal”GET /api/v1/admin/customer-portal · operation getCustomerPortal
customers:read (global administrators and viewers see every team, a team administrator its administered teams, a customer credential its own team). The keys trusted to assert customer identity (YAML entries, read-only, and stored entries), the request header names, the default alert thresholds and the accepted budget periods. Requires customer_portal and PostgreSQL; no-store.
Authentication: adminSession, or customerCredential
Responses
| Status | Description | Body |
|---|---|---|
200 |
Customer portal settings | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Local concurrency limit reached | application/json: Error |
Response 200 fields:
application/json: objectmax_budget_windows(integer, required) — How many budget windows one level may carry (4); more than one needs customer_budget_windowstrusted_keys(array of CustomerTrustedKey, required)headers(object, required)- any other key: string
default_alert_thresholds(array of integer, required)budget_periods(array of string, required)customer_portal(CustomerPortalSettings, required)
PUT /api/v1/admin/customer-portal/trusted-keys/{key_id}
Section titled “PUT /api/v1/admin/customer-portal/trusted-keys/{key_id}”PUT /api/v1/admin/customer-portal/trusted-keys/{key_id} · operation putCustomerTrustedKey
Trust a key (YAML or managed) to assert the identity of customers of its own team, or change require_identity (refuse that key’s inference requests without X-Gateway-Customer-Org). The team is the key’s, never the caller’s choice; an entry never moves to another team. customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited as customer.trusted_key.put. A key trusted in the YAML is changed there (409 yaml_owned). A team administrator trusts only keys of its administered teams (403 team_forbidden); customer credentials never change trust.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
key_id |
path | string, required, max length 128 |
Request body (required)
application/json: objectrequire_identity(boolean, defaultfalse)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Trust entry | application/json: CustomerTrustedKey |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled, or customer_not_found (no such managed key) | — |
409 |
yaml_owned, or version_conflict (the key now belongs to another team) | — |
503 |
Local concurrency limit reached | application/json: Error |
DELETE /api/v1/admin/customer-portal/trusted-keys/{key_id}
Section titled “DELETE /api/v1/admin/customer-portal/trusted-keys/{key_id}”DELETE /api/v1/admin/customer-portal/trusted-keys/{key_id} · operation deleteCustomerTrustedKey
Revoke a stored trust entry; the next request of that key that names a customer is refused. A team administrator revokes only its administered teams’ entries; customer credentials never change trust. customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
key_id |
path | string, required, max length 128 |
Responses
| Status | Description | Body |
|---|---|---|
204 |
Revoked | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
503 |
Local concurrency limit reached | application/json: Error |
GET /api/v1/admin/customer-portal/organizations
Section titled “GET /api/v1/admin/customer-portal/organizations”GET /api/v1/admin/customer-portal/organizations · operation listCustomerOrganizations
customers:read, filtered to the session’s teams (global administrators and viewers every team, a team administrator its administered teams, a customer credential its own team); another team answers 403 team_forbidden. Customer organizations (of one operator team when team is set, up to 1,000), each with its effective ceiling and committed spend (settled plus open holds) in the current window of its budget period.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
query | string, pattern ^[a-z][a-z0-9_-]{1,63}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Organizations | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Local concurrency limit reached | application/json: Error |
Response 200 fields:
application/json: objectitems(array of CustomerRecord, required)truncated(boolean, required)
GET /api/v1/admin/customer-portal/organizations/{team}/{org}
Section titled “GET /api/v1/admin/customer-portal/organizations/{team}/{org}”GET /api/v1/admin/customer-portal/organizations/{team}/{org} · operation getCustomerOrganization
customers:read, filtered to the session’s teams (global administrators and viewers every team, a team administrator its administered teams, a customer credential its own team); another team answers 403 team_forbidden. One organization with its customer teams, members and budget profiles (up to 10,000 records), each level with its effective ceiling (override, own, profile or none) and committed spend in the current window, and every effective budget window in effective.windows. member_q, member_sort and member_order search and sort the members only (teams and profiles are unchanged); an invalid value answers 400 invalid_member_query.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
member_q |
query | string, max length 120 | Keep the members whose ID or name contains this text, ignoring case. |
member_sort |
query | string, one of "id", "name", "budget", "committed", "utilization", default "id" |
Sort the members by ID, name, budget (the first effective window’s ceiling), committed spend of that window, or utilization (the fullest window’s committed share). Members without the sorted value come last; ties keep the ID order. |
member_order |
query | string, one of "asc", "desc", default "asc" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Organization detail | application/json: CustomerOrganizationDetail |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
503 |
Local concurrency limit reached | application/json: Error |
PUT /api/v1/admin/customer-portal/organizations/{team}/{org}
Section titled “PUT /api/v1/admin/customer-portal/organizations/{team}/{org}”PUT /api/v1/admin/customer-portal/organizations/{team}/{org} · operation putCustomerOrganization
Create (no version; 409 customer_exists when it exists) or replace (version = current) an organization under an operator team. profile_id names the budget profile new members get when they name neither a profile nor a budget. customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited as customer.org.put.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
Request body (required)
application/json: CustomerRecordInput
Responses
| Status | Description | Body |
|---|---|---|
200 |
Stored record | application/json: CustomerRecord |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled, or customer_not_found (replace of a missing record, or a missing profile) | — |
409 |
customer_exists or version_conflict | — |
422 |
invalid_customer, or feature_disabled for a calendar or lifetime period without its flag | — |
503 |
Local concurrency limit reached | application/json: Error |
DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}
Section titled “DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}”DELETE /api/v1/admin/customer-portal/organizations/{team}/{org} · operation deleteCustomerOrganization
Delete an organization with all its teams, members and profiles. Counters and usage events keep their history. customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
version |
query | integer (int64), required, min 1 |
Responses
| Status | Description | Body |
|---|---|---|
204 |
Deleted | — |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
409 |
version_conflict | — |
503 |
Local concurrency limit reached | application/json: Error |
PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id}
Section titled “PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id}”PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id} · operation putCustomerChild
Create or replace a customer team (kind teams), member (members) or budget profile (profiles) of an organization, with the same create/replace contract as the organization. A member’s customer_team and profile_id must exist; a new member without profile_id and budget gets its team’s, then its organization’s, default profile. A profile requires budget_usd. tpm, tpd and model_allowances (T158.003) apply to every kind; aliases must be configured and calendar or lifetime periods need their flags (422). customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
kind |
path | string, required, one of "teams", "members", "profiles" |
|
id |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
Request body (required)
application/json: CustomerRecordInput
Responses
| Status | Description | Body |
|---|---|---|
200 |
Stored record | application/json: CustomerRecord |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled, unknown kind, or customer_not_found (organization, team or profile) | — |
409 |
customer_exists or version_conflict | — |
422 |
invalid_customer (also more than 10,000 records in one organization) | — |
503 |
Local concurrency limit reached | application/json: Error |
DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id}
Section titled “DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id}”DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/{kind}/{id} · operation deleteCustomerChild
Delete a customer team, member or profile. A team with members, or a profile that a member, team or the organization still names, is refused with 409 customer_in_use. customers:manage for the record’s operator team (a live global administrator, a live team administrator of that team, or a managing customer credential of that team, rechecked in the write transaction), CSRF for cookie sessions; audited.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
kind |
path | string, required, one of "teams", "members", "profiles" |
|
id |
path | string, required | |
version |
query | integer (int64), required, min 1 |
Responses
| Status | Description | Body |
|---|---|---|
204 |
Deleted | — |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
409 |
version_conflict or customer_in_use | — |
503 |
Local concurrency limit reached | application/json: Error |
PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override
Section titled “PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override”PUT /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override · operation putCustomerOverride
Set a member’s temporary ceiling. budget_usd replaces the member’s own or profile budget (higher or lower; of the window budget_period names, else of the member’s first window, the other windows staying enforced) until expires_at, which must be in the future and at most 366 days away by the database clock. Each reservation decides it after locking its counters; spend is never reset. With customer_portal.require_override_approval only a global administrator writes it directly (403 approval_required); others file an override request. Compare-and-set on the member’s version; live global administrator, customers:manage, CSRF; audited as customer.member.override.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
id |
path | string, required |
Request body (required)
application/json: objectversion(integer (int64), required, min 1)budget_usd(string, required)expires_at(string (date-time), required)reason(string, max length 200)budget_period(string, one of"day","week","month","quarter","year","lifetime") — The budget window the override replaces; omitted, the member’s first window. A period none of the member’s windows has answers 422 invalid_customer (a member without a budget takes any period).
Responses
| Status | Description | Body |
|---|---|---|
200 |
Member | application/json: CustomerRecord |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
409 |
version_conflict | — |
422 |
invalid_customer (amount, reason or expiry) | — |
503 |
Local concurrency limit reached | application/json: Error |
DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override
Section titled “DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override”DELETE /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override · operation deleteCustomerOverride
Clear a member’s override at the member’s version. Same rights and audit (customer.member.override_clear).
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
id |
path | string, required | |
version |
query | integer (int64), required, min 1 |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Member | application/json: CustomerRecord |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled or customer_not_found | — |
409 |
version_conflict | — |
503 |
Local concurrency limit reached | application/json: Error |
GET /api/v1/admin/customer-portal/organizations/{team}/{org}/export
Section titled “GET /api/v1/admin/customer-portal/organizations/{team}/{org}/export”GET /api/v1/admin/customer-portal/organizations/{team}/{org}/export · operation exportCustomerOrganization
customers:read for the team. One organization as a portable customer-portal/v1 document (organization, profiles, customer teams, members with budgets, limits and allowances), without versions, timestamps, spend or overrides. No-store.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Export document | application/json: CustomerExport |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found | — |
503 |
Local concurrency limit reached | application/json: Error |
POST /api/v1/admin/customer-portal/organizations/{team}/import
Section titled “POST /api/v1/admin/customer-portal/organizations/{team}/import”POST /api/v1/admin/customer-portal/organizations/{team}/import · operation importCustomerOrganization
customers:manage for the team; CSRF for cookie sessions. Writes one customer-portal/v1 document into this operator team (never the document’s team) in one transaction, organization first, then profiles, customer teams and members. mode create refuses any existing record (409 customer_exists); merge (default) creates missing records and replaces existing ones at their current version. The whole document is validated first and is all-or-nothing; up to 10,000 records and 8 MiB; overrides are never imported. Audited as customer.import.<mode> with the record count.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
mode |
query | string, one of "merge", "create", default "merge" |
Request body (required)
application/json: CustomerExport
Responses
| Status | Description | Body |
|---|---|---|
200 |
Import result | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found (a referenced team or profile) | — |
409 |
customer_exists (mode create) | — |
422 |
invalid_customer, or feature_disabled for a period or limit without its flag | — |
503 |
Local concurrency limit reached | application/json: Error |
Response 200 fields:
application/json: objectteam(string, required)org(string, required)mode(string, required)created(integer, required)replaced(integer, required)
POST /api/v1/admin/customer-portal/organizations/{team}/{org}/view-tokens
Section titled “POST /api/v1/admin/customer-portal/organizations/{team}/{org}/view-tokens”POST /api/v1/admin/customer-portal/organizations/{team}/{org}/view-tokens · operation mintCustomerViewToken
customers:manage for the team; CSRF for cookie sessions; needs customer_self_service. Mints a read-only view token for the organization (member omitted) or one member, valid ttl_minutes (default 60, at most customer_portal.view_token_max_minutes, default 1440). The token (gwcv_ followed by 48 hex characters) and its link path /customer-view#token=… are returned once with no-store; only the SHA-256 is stored. Up to 1,000 live tokens per organization; audited as customer.view_token.create.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
Request body (required)
application/json: objectmember(string)ttl_minutes(integer, default60, min 1, max 10080)
Responses
| Status | Description | Body |
|---|---|---|
201 |
Minted; the token is shown only here | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found | — |
409 |
view_token_limit | — |
422 |
invalid_customer (ttl_minutes) | — |
503 |
Local concurrency limit reached | application/json: Error |
Response 201 fields:
application/json: objectview_token(CustomerViewToken, required)token(string, required)path(string, required)
POST /api/v1/admin/customer-portal/view-tokens/{team}/{id}/revoke
Section titled “POST /api/v1/admin/customer-portal/view-tokens/{team}/{id}/revoke”POST /api/v1/admin/customer-portal/view-tokens/{team}/{id}/revoke · operation revokeCustomerViewToken
Revoke a view token of the team at once; customers:manage for the team; audited as customer.view_token.revoke.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
id |
path | string, required, pattern ^cvt_[a-f0-9]{16}$ |
Responses
| Status | Description | Body |
|---|---|---|
204 |
Revoked | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found | — |
503 |
Local concurrency limit reached | application/json: Error |
GET /api/v1/admin/customer-portal/override-requests
Section titled “GET /api/v1/admin/customer-portal/override-requests”GET /api/v1/admin/customer-portal/override-requests · operation listCustomerOverrideRequests
customers:read, filtered to the session’s teams. Member override approval requests newest first, up to 500. state is pending, approved, denied, or expired (pending past decide_by by the database clock, no longer decidable). No-store.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
query | string, pattern ^[a-z][a-z0-9_-]{1,63}$ |
|
org |
query | string | |
state |
query | string, one of "pending", "approved", "denied", "expired" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Requests | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
Feature disabled | application/json: Error |
503 |
Local concurrency limit reached | application/json: Error |
Response 200 fields:
application/json: objectitems(array of CustomerOverrideRequest, required)
POST /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override-requests
Section titled “POST /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override-requests”POST /api/v1/admin/customer-portal/organizations/{team}/{org}/members/{id}/override-requests · operation createCustomerOverrideRequest
Ask for a member override (budget_usd until expires_at, at most 366 days away by the database clock). customers:manage for the team (a global administrator, a team administrator of the team or a managing customer credential); CSRF for cookie sessions. One pending request per member; up to 1,000 pending per team. The request can be decided until decide_by (customer_portal.override_request_ttl_hours, default 168). Audited as customer.override_request.create and notified as the customer_override_requested alert event.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
team |
path | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
The operator’s gateway team that owns the customer |
org |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._@:-]{0,63}$ |
The operator-chosen customer organization ID |
id |
path | string, required |
Request body (required)
application/json: objectbudget_usd(string, required)expires_at(string (date-time), required)reason(string, max length 200)budget_period(string, one of"day","week","month","quarter","year","lifetime") — The budget window the override would replace; omitted, the member’s first window. A period none of the member’s windows has answers 422 invalid_customer.
Responses
| Status | Description | Body |
|---|---|---|
201 |
Pending request | application/json: CustomerOverrideRequest |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found | — |
409 |
request_pending | — |
422 |
invalid_customer | — |
503 |
Local concurrency limit reached | application/json: Error |
POST /api/v1/admin/customer-portal/override-requests/{id}/approve
Section titled “POST /api/v1/admin/customer-portal/override-requests/{id}/approve”POST /api/v1/admin/customer-portal/override-requests/{id}/approve · operation approveCustomerOverrideRequest
customer_overrides:approve (a live global administrator or a team administrator of the request’s team, never a customer credential, never the requester and never the person who issued the credential that filed it). Applies the override to the member at its current version in the same transaction and records applied_version; audited as customer.override_request.approve and customer.member.override; notified as customer_override_decided. CSRF.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
id |
path | string, required, pattern ^cor_[a-f0-9]{16}$ |
Request body
application/json: objectnote(string, max length 200)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Decided request | application/json: CustomerOverrideRequest |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden, team_forbidden or self_approval | — |
404 |
feature_disabled or customer_not_found | — |
409 |
request_closed (decided, lapsed, or its override expiry passed) | — |
503 |
Local concurrency limit reached | application/json: Error |
POST /api/v1/admin/customer-portal/override-requests/{id}/deny
Section titled “POST /api/v1/admin/customer-portal/override-requests/{id}/deny”POST /api/v1/admin/customer-portal/override-requests/{id}/deny · operation denyCustomerOverrideRequest
Deny a pending request with the same rights as approving; nothing changes on the member. Audited as customer.override_request.deny; notified as customer_override_decided. CSRF.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
id |
path | string, required, pattern ^cor_[a-f0-9]{16}$ |
Request body
application/json: objectnote(string, max length 200)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Decided request | application/json: CustomerOverrideRequest |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden, team_forbidden or self_approval | — |
404 |
feature_disabled or customer_not_found | — |
409 |
request_closed | — |
503 |
Local concurrency limit reached | application/json: Error |
GET /api/v1/admin/customer-portal/credentials
Section titled “GET /api/v1/admin/customer-portal/credentials”GET /api/v1/admin/customer-portal/credentials · operation listCustomerCredentials
customer_credentials:manage (global administrators every team, a team administrator its administered teams). Scoped customer credentials newest first, up to 1,000, revoked and expired ones included as tombstones; never the secret. Requires customer_portal_credentials; no-store.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
query | string, pattern ^[a-z][a-z0-9_-]{1,63}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Credentials | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden, or team_forbidden for a team outside the session | — |
404 |
Feature disabled | application/json: Error |
503 |
Local concurrency limit reached | application/json: Error |
Response 200 fields:
application/json: objectitems(array of CustomerCredential, required)
POST /api/v1/admin/customer-portal/credentials
Section titled “POST /api/v1/admin/customer-portal/credentials”POST /api/v1/admin/customer-portal/credentials · operation createCustomerCredential
Issue a server-side credential for an operator backend, bound to one operator team and to customer management. access read reaches the customer read routes of that team, manage also its record, override and approval writes; neither reaches trust, credential or any other control-plane route, and neither opens the console. The secret (gwcp_ followed by 48 hex characters) is returned once with no-store and sent as Authorization Bearer; only its SHA-256 is stored. expires_at is optional (default never) and at most 1095 days away. Up to 100 active credentials per team. Issued only by a live global administrator or a team administrator of the team, never by a credential; CSRF; audited as customer.credential.create. The credential works only while its issuer still administers the team and the team exists; otherwise its next call answers 401 and it is revoked (revoked_by system:issuer-lost, audited as customer.credential.revoke_issuer_lost); a sweep revokes unused ones every minute.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectteam(string, required, pattern^[a-z][a-z0-9_-]{1,63}$)name(string, required, min length 1, max length 120)access(string, one of"read","manage", default"manage")expires_at(string (date-time))
Responses
| Status | Description | Body |
|---|---|---|
201 |
Issued; the secret is shown only here | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden, or team_forbidden for a team outside the session | — |
404 |
feature_disabled, or customer_not_found (no such operator team) | — |
409 |
credential_limit | — |
422 |
invalid_customer | — |
503 |
Local concurrency limit reached | application/json: Error |
Response 201 fields:
application/json: objectcredential(CustomerCredential, required)secret(string, required, pattern^gwcp_[a-f0-9]{48}$)
POST /api/v1/admin/customer-portal/credentials/{id}/revoke
Section titled “POST /api/v1/admin/customer-portal/credentials/{id}/revoke”POST /api/v1/admin/customer-portal/credentials/{id}/revoke · operation revokeCustomerCredential
Revoke a credential at once; the row stays as a tombstone with revoked_at and revoked_by. A write already holding the credential’s row finishes first and every later call is refused. Same rights as issuing; repeating it is a no-op; audited as customer.credential.revoke.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
id |
path | string, required, pattern ^cpc_[a-f0-9]{16}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Revoked credential | application/json: CustomerCredential |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden or team_forbidden | — |
404 |
feature_disabled or customer_not_found | — |
503 |
Local concurrency limit reached | application/json: Error |
GET /api/v1/admin/customer-portal/usage
Section titled “GET /api/v1/admin/customer-portal/usage”GET /api/v1/admin/customer-portal/usage · operation getCustomerUsage
customers:read, filtered to the session’s teams (global administrators and viewers every team, a team administrator its administered teams, a customer credential its own team); another team answers 403 team_forbidden. Usage events of one operator team’s customers over at most 366 days (default the last 30), optionally of one organization, grouped by org (default), team, member, UTC day, model (the served model alias) or day,model (each per organization; day,model lists the newest day first; the model groupings match the structured usage query grouped by customer_org and model, and their CSV has a model column after day). estimated_usd sums only known valuations, priced from the price book with discounts and margins frozen in each event; partial, unknown and not valued events are counted, never treated as zero; tokens_unknown counts events without reported tokens. With budget_charge_reports each row adds budget_charge (what the customer budgets took at the approved rates) and the CSV adds budget_charged_usd, budget_charged and budget_held. Up to 1,000 rows (truncated). format=csv returns the same rows.
Authentication: adminSession, or customerCredential
Parameters
| Name | In | Type | Description |
|---|---|---|---|
team |
query | string, required, pattern ^[a-z][a-z0-9_-]{1,63}$ |
|
org |
query | string | |
from |
query | string (date-time) | Start of the window, RFC 3339; the window is at most 366 days and defaults to the last 30. |
to |
query | string (date-time) | End of the window, RFC 3339. |
by |
query | string, one of "org", "team", "member", "day", "model", "day,model", default "org" |
How usage is grouped: org (default), team, member, UTC day, model, or day,model (one row per UTC day and model). |
format |
query | string, one of "json", "csv" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Usage | application/json: CustomerUsageReporttext/csv: string |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Local concurrency limit reached | application/json: Error |
GET /v1/customer-view
Section titled “GET /v1/customer-view”GET /v1/customer-view · operation getCustomerView
The self-service customer view (T158.006; customer_portal and customer_self_service). Authorization Bearer with a view token. Returns only the token’s scope (organization or member) ceiling and committed spend in its current window, and its usage by UTC day over the last 30 days; never the operator team, keys or other members. Unknown, revoked or expired tokens, and tokens of a deleted organization or member, answer 401; invalid attempts share the admin Bearer limit (429). No-store.
Authentication: customerViewToken
Responses
| Status | Description | Body |
|---|---|---|
200 |
Customer view | application/json: object |
401 |
unauthorized | — |
404 |
feature_disabled | — |
429 |
rate_limited | — |
503 |
storage_unavailable | — |
Response 200 fields:
application/json: objectview(object, required)scope(string, required, one of"organization","member")organization(string, required)name(string)member(string)effective(object)expires_at(string (date-time), required)
from(string (date-time), required)to(string (date-time), required)usage(array of object, required)day(string (date-time))requests(integer)input_tokens(integer)output_tokens(integer)estimated_usd(string)not_valued(integer)tokens_unknown(integer)budget_charge(BudgetChargeSummary)
truncated(boolean, required)