Skip to main content
The HTTP API exposes typed market commands and queries as JSON plus a trusted operator provisioning command and principal-controlled delegation commands. It does not provide discovery, self-service account management, credential issuance, payment, or a user interface. Use the HTTP endpoints section in the sidebar for field types, required fields, constraints, request examples, response schemas, and status codes for each operation. The complete machine-readable contract is also available as OpenAPI YAML. Market and commitment requests require a short-lived bearer token or bootstrap HMAC authentication as described in Authentication. The challenge and token exchange routes are unsigned. Request bodies are strict JSON: unknown fields and multiple JSON values are rejected, and the maximum body size is 1 MiB. Ambient supplies authoritative command times; clients must not send occurredAt or actorId.

Routes

Command envelopes

Create-market bodies contain:
Publish bodies contain:
Direct-claim bodies contain:
Sealed-bid bodies contain:
Commitment confirmation and decline bodies contain:
Path identifiers are authoritative for market and commitment actions. When the authenticated actor differs from principalId, authorityRef is required. The trusted identity-provisioning body contains:
publicKey is an unpadded base64url Ed25519 public key. The route is mounted only when AMBIENT_OPERATOR_ACTORS configures at least one operator, and the authenticated caller must be on that allowlist. Creating distinct actor and principal IDs does not grant authority between them. Issue-delegation bodies contain:
Revoke-delegation bodies contain commandId and principalId; the delegation ID comes from the path. Only an authenticated actor whose ID equals principalId can manage delegations. Delegation management cannot itself be delegated in the current version.

Reads and disclosure

Any authenticated actor can read a current market snapshot. The complete record includes command inputs and decisions, commitments, events, and integrity metadata. It is restricted to the creator principal or the actor that created the market. While a sealed auction is open, bid command bodies in that creator-visible record are replaced with {"sealed":true}. Public bid receipts and events also omit the amount.

Idempotency and concurrency

Command IDs are scoped to the authenticated actor. An exact replay returns the stored decision, including a stored deterministic rejection. Reusing an ID with different content returns HTTP 409 with idempotency_conflict. Publish uses expectedVersion. Direct claims may omit it to use authoritative server arrival order. The application re-evaluates commands after bounded optimistic-concurrency conflicts so a losing allocation normally receives the authoritative deterministic rejection.

Errors

Errors use a stable envelope:
Application rejection codes are:
Transport and persistence failures may also return invalid_request, unauthenticated, forbidden, not_found, method_not_allowed, idempotency_conflict, concurrent_update, or internal_error. Delegation commands may additionally return identity_not_found, delegation_not_found, delegation_conflict, or delegation_inactive.