{"openapi":"3.1.0","info":{"title":"Areev Cloud API","version":"231f83f273a286a57630e02837bf7dcc4f9a15a7","description":"The Areev Cloud control-plane API. Conventions (envelope, cursors, idempotency, errors) are in docs/api/api-conventions.md; the design is docs/areev-cloud-technical-spec.md §21."},"components":{"schemas":{}},"paths":{"/healthz":{"get":{"summary":"Liveness","tags":["meta"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"],"additionalProperties":false}}}}}}},"/readyz":{"get":{"summary":"Readiness: the process and its database","tags":["meta"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready"]},"checks":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["status","checks"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["code","message","detail"],"additionalProperties":false}}}}}}},"/v1/oauth/register":{"post":{"summary":"Register a public OAuth client (RFC 7591): PKCE, no secret","tags":["oauth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_name":{"type":"string","minLength":1,"maxLength":200},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"token_endpoint_auth_method":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"client_uri":{"type":"string","maxLength":2000},"software_id":{"type":"string","maxLength":200},"scope":{"type":"string","maxLength":500}},"required":["redirect_uris"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/oauth/authorize":{"get":{"summary":"Start an authorization (PKCE S256, a resource indicator); redirects to the Desk's approve screen","tags":["oauth"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"response_type","required":false},{"schema":{"type":"string","maxLength":2000},"in":"query","name":"client_id","required":false},{"schema":{"type":"string","maxLength":2000},"in":"query","name":"redirect_uri","required":false},{"schema":{"type":"string","maxLength":500},"in":"query","name":"scope","required":false},{"schema":{"type":"string","maxLength":500},"in":"query","name":"state","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"code_challenge","required":false},{"schema":{"type":"string","maxLength":20},"in":"query","name":"code_challenge_method","required":false},{"schema":{"type":"string","maxLength":2000},"in":"query","name":"resource","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/v1/oauth/authorize/{req}":{"get":{"summary":"An authorization request as the Desk's approve screen reads it (a session only)","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"req","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"uri":{"type":["string","null"]},"kind":{"type":"string"},"host":{"type":["string","null"]}},"required":["id","name","uri","kind","host"],"additionalProperties":false},"redirect_host":{"type":"string"},"resource":{"type":"string"},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"words":{"type":"string"}},"required":["id","words"],"additionalProperties":false}},"expires_at":{"type":"string"},"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"}},"required":["id","label","kind"],"additionalProperties":false}}},"required":["id","name","role","entities"],"additionalProperties":false}}},"required":["id","client","redirect_host","resource","scopes","expires_at","orgs"],"additionalProperties":false}}}}}}},"/v1/oauth/authorize/{req}/decide":{"post":{"summary":"Approve or deny an app's request for one organisation and business (a session only)","tags":["oauth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approve":{"type":"boolean"},"org_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","minLength":1,"maxLength":100}},"required":["approve"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"req","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_to":{"type":"string"}},"required":["redirect_to"],"additionalProperties":false}}}}}}},"/v1/oauth/token":{"post":{"summary":"Exchange a code (with its PKCE verifier) or a refresh token for an access token","tags":["oauth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/oauth/revoke":{"post":{"summary":"Revoke an access or refresh token and the grant it belongs to (RFC 7009)","tags":["oauth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{org}/oauth/grants":{"get":{"summary":"The apps connected to this organisation: which, for which business, by whom","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"entity_id":{"type":["string","null"]},"granted_by":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"resource":{"type":"string"},"status":{"type":"string","enum":["active","revoked"]},"connections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granted_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]}},"required":["id","client","entity_id","granted_by","scopes","resource","status","connections","granted_at","last_used_at","revoked_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/oauth/grants/{grant}":{"delete":{"summary":"Disconnect an app: revoke the grant and every token under it","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"grant","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{org}/oauth/clients":{"post":{"summary":"Register a confidential OAuth client for this organisation; the secret is shown once","tags":["oauth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["jobs:read","support:read","ledger:read","orders:read","jobs:submit","approvals:read","offers:read","desk:read"]}}},"required":["name","redirect_uris"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods":{"type":"array","items":{"type":"string"}},"created_by":{"type":["string","null"]},"created_at":{"type":"string"},"deleted_at":{"type":["string","null"]},"client_secret":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"}},"required":["client_id","name","redirect_uris","scopes","token_endpoint_auth_methods","created_by","created_at","deleted_at","client_secret","authorization_endpoint","token_endpoint"],"additionalProperties":false}}}}}},"get":{"summary":"This organisation's confidential OAuth clients. Never their secrets","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods":{"type":"array","items":{"type":"string"}},"created_by":{"type":["string","null"]},"created_at":{"type":"string"},"deleted_at":{"type":["string","null"]}},"required":["client_id","name","redirect_uris","scopes","token_endpoint_auth_methods","created_by","created_at","deleted_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/oauth/clients/{id}":{"get":{"summary":"One of this organisation's confidential OAuth clients. Never its secret","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods":{"type":"array","items":{"type":"string"}},"created_by":{"type":["string","null"]},"created_at":{"type":"string"},"deleted_at":{"type":["string","null"]}},"required":["client_id","name","redirect_uris","scopes","token_endpoint_auth_methods","created_by","created_at","deleted_at"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a confidential OAuth client: no new authorization or token, every grant under it revoked","tags":["oauth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/a2ui/catalog/v1.json":{"get":{"summary":"Areev's A2UI catalogue, version 1: the components an answer's surface may use","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/v1/version":{"get":{"summary":"Deployed version and the pinned Areev Core","tags":["meta"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"string","enum":["areev-cloud-api"]},"version":{"type":"string"},"environment":{"type":"string","enum":["local","staging","prod","private"]},"core_version":{"type":"string"},"api_version":{"type":"string","enum":["v1"]}},"required":["service","version","environment","core_version","api_version"],"additionalProperties":false}}}}}}},"/v1/auth/magic-link":{"post":{"summary":"Email a single-use sign-in link","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"redirect_to":{"type":"string","maxLength":2048}},"required":["email"]}}}},"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["sent"]}},"required":["status"],"additionalProperties":false}}}}}}},"/v1/auth/magic-link/consume":{"post":{"summary":"Exchange a sign-in link for a session","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200}},"required":["token"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["id","email","display_name"],"additionalProperties":false},"redirect_to":{"type":["string","null"]}},"required":["account","redirect_to"],"additionalProperties":false}}}}}}},"/v1/auth/desktop/handoff":{"post":{"summary":"Mint a one-time code that signs Areev Desktop in as you","tags":["auth"],"description":"A signed-in person only. The code is single-use, lives 60 seconds and is bound to this account; at most 5 a minute (CLD-E430 with Retry-After).","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{"client":"areev-desktop"},"type":"object","properties":{"client":{"default":"areev-desktop","type":"string","enum":["areev-desktop"]},"version":{"type":"string","maxLength":40}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"expires_at":{"type":"string"}},"required":["code","expires_at"],"additionalProperties":false}}}},"429":{"description":"CLD-E430: more than 5 codes a minute; `Retry-After` says when","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E430: more than 5 codes a minute; `Retry-After` says when"}}}}}}},"/v1/auth/desktop/handoff/consume":{"post":{"summary":"Exchange a desktop hand-off code for a session","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":20,"maxLength":200}},"required":["code"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["id","email","display_name"],"additionalProperties":false}},"required":["account"],"additionalProperties":false}}}},"401":{"description":"CLD-E401: this code is spent, expired or unknown","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E401: this code is spent, expired or unknown"}}}}}}},"/v1/auth/credential":{"get":{"summary":"The calling key's or service principal's own kind, organisation and scopes","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["api_key","service","job"]},"principal":{"type":"string"},"org_id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"memory_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"key_kind":{"type":"string","enum":["key","oauth"]},"entity_id":{"type":["string","null"]},"expires_at":{"type":["string","null"]}},"required":["kind","principal","org_id","scopes"],"additionalProperties":false}}}}}}},"/v1/auth/me":{"get":{"summary":"The signed-in person, their sign-in method, and their organisations","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"appearance":{"type":"string","enum":["light","dark","system"]}},"required":["id","email","display_name","appearance"],"additionalProperties":false},"principal":{"type":"string"},"auth_method":{"type":"string","enum":["magic_link","passkey","oidc"]},"can_approve_regulated":{"type":"boolean"},"orgs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"brand":{"type":"object","properties":{"state":{"type":"string","enum":["none","proposed","confirmed"]},"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash"],"additionalProperties":false},{"type":"null"}]},"logo_url":{"type":["string","null"]},"proposal_pending":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["state","palette","logo_url","proposal_pending","version"],"additionalProperties":false}},"required":["id","slug","name","role","permissions","brand"],"additionalProperties":false}},"platform_roles":{"type":"array","items":{"type":"string"}},"permissions":{"type":"object","properties":{"platform":{"type":"array","items":{"type":"string"}}},"required":["platform"],"additionalProperties":false}},"required":["account","principal","auth_method","can_approve_regulated","orgs","platform_roles","permissions"],"additionalProperties":false}}}}}}},"/v1/auth/me/appearance":{"put":{"summary":"Set how you like the Desk drawn: light, dark or your device's choice","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appearance":{"type":"string","enum":["light","dark","system"]}},"required":["appearance"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"appearance":{"type":"string","enum":["light","dark","system"]}},"required":["appearance"],"additionalProperties":false}}}}}}},"/v1/auth/cell-token":{"post":{"summary":"A short-lived token for one of this organisation's cell Gateways","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string","minLength":1,"maxLength":100},"cell_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["org_id"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"},"org_id":{"type":"string"},"gateway_url":{"type":["string","null"]},"cell_id":{"type":"string"},"entity_id":{"type":"string"}},"required":["token","expires_at","org_id","gateway_url"],"additionalProperties":false}}}}}}},"/v1/auth/logout":{"post":{"summary":"End this session, or every session for this account","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"all_sessions":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ended":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["ended"],"additionalProperties":false}}}}}}},"/v1/admin/platform-members":{"get":{"summary":"Who holds a platform role (the founder only)","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["founder","catalog_admin","billing_reviewer","support","cell_operator","auditor","release_approver"]},"granted_by":{"type":"string"},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["account_id","email","role","granted_by","expires_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Grant a platform role to a person, by email (the founder only)","tags":["auth"],"description":"The account is created if it does not exist, so a role can be granted before the person's first sign-in. Granting a role already held refreshes its expiry. Audited with both names.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["founder","catalog_admin","billing_reviewer","support","cell_operator","auditor","release_approver"]},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["email","role"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["founder","catalog_admin","billing_reviewer","support","cell_operator","auditor","release_approver"]},"expires_at":{"type":["string","null"]}},"required":["account_id","email","role","expires_at"],"additionalProperties":false}}}}}}},"/v1/admin/platform-members/{email}/{role}":{"delete":{"summary":"Revoke a platform role (the founder only)","tags":["auth"],"parameters":[{"schema":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"in":"path","name":"email","required":true},{"schema":{"type":"string","enum":["founder","catalog_admin","billing_reviewer","support","cell_operator","auditor","release_approver"]},"in":"path","name":"role","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/v1/auth/passkey/register/start":{"post":{"summary":"Begin registering a passkey for the signed-in account","tags":["auth"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"options":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["options"],"additionalProperties":false}}}}}}},"/v1/auth/passkey/register/finish":{"post":{"summary":"Complete passkey registration","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"label":{"type":"string","maxLength":100}},"required":["response"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]}},"required":["id","label"],"additionalProperties":false}}}}}}},"/v1/auth/passkey/authenticate/start":{"post":{"summary":"Begin signing in with a passkey","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"options":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["options"],"additionalProperties":false}}}}}}},"/v1/auth/passkey/authenticate/finish":{"post":{"summary":"Complete passkey sign-in","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["response"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"],"additionalProperties":false}},"required":["account"],"additionalProperties":false}}}}}}},"/v1/auth/oidc/{org}/start":{"get":{"summary":"Begin sign-in through an organisation's identity provider","tags":["auth"],"parameters":[{"schema":{"type":"string","maxLength":2048},"in":"query","name":"redirect_to","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorization_url":{"type":"string"}},"required":["authorization_url"],"additionalProperties":false}}}}}}},"/v1/auth/oidc/callback":{"get":{"summary":"Complete sign-in through an identity provider","tags":["auth"],"description":"A browser is sent on with a 302 to the start's redirect_to (the console when none), the session cookie set; a caller whose Accept names application/json and not text/html reads the JSON body instead.","parameters":[{"schema":{"type":"string","minLength":1},"in":"query","name":"code","required":true},{"schema":{"type":"string","minLength":1},"in":"query","name":"state","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"],"additionalProperties":false},"org_id":{"type":"string"},"redirect_to":{"type":["string","null"]}},"required":["account","org_id","redirect_to"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/oidc":{"put":{"summary":"Configure an organisation's identity provider","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string","format":"uri"},"client_id":{"type":"string","minLength":1},"client_secret_ref":{"type":"string","minLength":1},"allowed_domains":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"groups_claim":{"type":"string"},"group_role_map":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["viewer","operator"]}}},"required":["issuer","client_id","client_secret_ref","allowed_domains"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"issuer":{"type":"string"}},"required":["org_id","issuer"],"additionalProperties":false}}}}}}},"/v1/auth/social/{provider}/start":{"get":{"summary":"Begin sign-in with Google or Microsoft","tags":["auth"],"parameters":[{"schema":{"type":"string","maxLength":2048},"in":"query","name":"redirect_to","required":false},{"schema":{"type":"string","enum":["google","microsoft"]},"in":"path","name":"provider","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorization_url":{"type":"string"}},"required":["authorization_url"],"additionalProperties":false}}}}}}},"/v1/auth/social/callback":{"get":{"summary":"Complete sign-in with Google or Microsoft","tags":["auth"],"description":"A browser is sent on with a 302 to the start's redirect_to (the console when none), the session cookie set; a caller whose Accept names application/json and not text/html reads the JSON body instead.","parameters":[{"schema":{"type":"string","minLength":1},"in":"query","name":"code","required":true},{"schema":{"type":"string","minLength":1},"in":"query","name":"state","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"],"additionalProperties":false},"provider":{"type":"string"},"redirect_to":{"type":["string","null"]}},"required":["account","provider","redirect_to"],"additionalProperties":false}}}}}}},"/v1/zones":{"get":{"summary":"The cells a new organisation may be pinned to","tags":["tenancy"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"residency":{"type":"string"},"region":{"type":"string"}},"required":["id","residency","region"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs":{"post":{"summary":"Create an organisation; the caller becomes its owner","tags":["tenancy"],"description":"Pinned to `cell_id` when named; otherwise to the oldest active shared cell in `data_residency` (`GET /v1/zones` lists them), refused with CLD-E451 when there is none.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":63,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"name":{"type":"string","minLength":1,"maxLength":200},"cell_id":{"type":"string","minLength":1},"data_residency":{"type":"string","minLength":1,"maxLength":20},"billing_mode":{"default":"wallet","type":"string","enum":["wallet","invoice"]},"billing":{"type":"object","properties":{"legal_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"gstin":{"anyOf":[{"type":"string","pattern":"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"},{"type":"null"}]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":200}},{"type":"null"}]},"place_of_supply_state":{"anyOf":[{"type":"string","pattern":"^[0-9]{2}$"},{"type":"null"}]},"billing_contact_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"billing_phone":{"anyOf":[{"type":"string","pattern":"^\\+[1-9][0-9]{6,14}$"},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]}},"additionalProperties":false}},"required":["slug","name","data_residency"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"cell_id":{"type":"string"},"plan":{"type":"string"},"billing_mode":{"type":"string","enum":["wallet","invoice"]},"data_residency":{"type":"string"},"residency_zones":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","frozen","erased"]},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"share_anonymised_cases":{"type":"boolean"},"billing_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_terms_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billing":{"type":"object","properties":{"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"country":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"complete":{"type":"boolean"}},"required":["legal_name","gstin","billing_address","place_of_supply_state","country","contact_name","email","phone","complete"],"additionalProperties":false}},"required":["id","slug","name","cell_id","plan","billing_mode","data_residency","status"],"additionalProperties":false}}}}}},"get":{"summary":"Organisations the caller belongs to","tags":["tenancy"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"cell_id":{"type":"string"},"plan":{"type":"string"},"billing_mode":{"type":"string","enum":["wallet","invoice"]},"data_residency":{"type":"string"},"residency_zones":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","frozen","erased"]},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"share_anonymised_cases":{"type":"boolean"},"billing_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_terms_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billing":{"type":"object","properties":{"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"country":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"complete":{"type":"boolean"}},"required":["legal_name","gstin","billing_address","place_of_supply_state","country","contact_name","email","phone","complete"],"additionalProperties":false},"role":{"type":"string","enum":["owner","admin","approver","operator","viewer"]}},"required":["id","slug","name","cell_id","plan","billing_mode","data_residency","status","role"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}":{"get":{"summary":"One organisation","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"cell_id":{"type":"string"},"plan":{"type":"string"},"billing_mode":{"type":"string","enum":["wallet","invoice"]},"data_residency":{"type":"string"},"residency_zones":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","frozen","erased"]},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"share_anonymised_cases":{"type":"boolean"},"billing_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_terms_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billing":{"type":"object","properties":{"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"country":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"complete":{"type":"boolean"}},"required":["legal_name","gstin","billing_address","place_of_supply_state","country","contact_name","email","phone","complete"],"additionalProperties":false}},"required":["id","slug","name","cell_id","plan","billing_mode","data_residency","status"],"additionalProperties":false}}}}}},"patch":{"summary":"Set the organisation's legal name, GSTIN, billing address and place of supply, the upgrade policy its new deployments start with, its billing terms, or whether it shares anonymised cases","tags":["tenancy"],"description":"What a tax invoice prints for the buyer (I12). A GSTIN is format-checked and must begin with the place of supply's state code; `null` clears a field. `upgrade_policy_default` (spec §8.4, H3) is the policy a new deployment starts with — `pinned` for an organisation whose agents never move without a person — and needs a written `reason`; it changes no deployment that exists. `billing_mode` (I13) is set only by the founder or a billing reviewer, signed in (`billing.mode`); back to `wallet` is refused `CLD-E409` while entries wait for a statement. `share_anonymised_cases` (default false) lets a cluster of this organisation's corrections become an anonymised golden candidate a pack owner reviews into the pack's golden set (spec §9.1); it needs a `reason`, is audited as `org.sharing_set`, and turning it off withdraws every candidate not yet reviewed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legal_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"gstin":{"anyOf":[{"type":"string","pattern":"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"},{"type":"null"}]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":200}},{"type":"null"}]},"place_of_supply_state":{"anyOf":[{"type":"string","pattern":"^[0-9]{2}$"},{"type":"null"}]},"billing_contact_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"billing_email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"billing_phone":{"anyOf":[{"type":"string","pattern":"^\\+[1-9][0-9]{6,14}$"},{"type":"null"}]},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"share_anonymised_cases":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":500},"billing_mode":{"type":"string","enum":["wallet","invoice"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"billing_contact_name":{"type":["string","null"]},"billing_email":{"type":["string","null"]},"billing_phone":{"type":["string","null"]},"country":{"type":["string","null"]},"billing":{"type":"object","properties":{"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"country":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"complete":{"type":"boolean"}},"required":["legal_name","gstin","billing_address","place_of_supply_state","country","contact_name","email","phone","complete"],"additionalProperties":false},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"billing_mode":{"type":"string","enum":["wallet","invoice"]},"share_anonymised_cases":{"type":"boolean"}},"required":["id","legal_name","gstin","billing_address","place_of_supply_state","billing_contact_name","billing_email","billing_phone","country","billing","upgrade_policy_default","billing_mode","share_anonymised_cases"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/residency-zones/available":{"get":{"summary":"The residency zones this organisation could add, and the cells in each","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"held":{"type":"array","items":{"type":"string"}},"default_zone":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"zone":{"type":"string"},"held":{"type":"boolean"},"is_default":{"type":"boolean"},"placeable":{"type":"boolean"},"cells":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"status":{"type":"string"},"owned":{"type":"boolean"}},"required":["id","mode","provider","region","status","owned"],"additionalProperties":false}}},"required":["zone","held","is_default","placeable","cells"],"additionalProperties":false}}},"required":["held","default_zone","data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/residency-zones":{"put":{"summary":"Set the residency zones this organisation may hold memories in","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"zones":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":20}}},"required":["zones"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"cell_id":{"type":"string"},"plan":{"type":"string"},"billing_mode":{"type":"string","enum":["wallet","invoice"]},"data_residency":{"type":"string"},"residency_zones":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","frozen","erased"]},"upgrade_policy_default":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"share_anonymised_cases":{"type":"boolean"},"billing_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_terms_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billing":{"type":"object","properties":{"legal_name":{"type":["string","null"]},"gstin":{"type":["string","null"]},"billing_address":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"place_of_supply_state":{"type":["string","null"]},"country":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"complete":{"type":"boolean"}},"required":["legal_name","gstin","billing_address","place_of_supply_state","country","contact_name","email","phone","complete"],"additionalProperties":false}},"required":["id","slug","name","cell_id","plan","billing_mode","data_residency","status"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/members":{"get":{"summary":"An organisation's members and their roles, in the order they joined","tags":["tenancy"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","approver","operator","viewer"]},"source":{"type":"string","enum":["direct","group"]},"status":{"type":"string"},"joined_at":{"type":"string"},"last_login_at":{"type":["string","null"]}},"required":["account_id","email","display_name","role","source","status","joined_at","last_login_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Add or change an organisation member","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["owner","admin","approver","operator","viewer"]}},"required":["email","role"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"account_id":{"type":"string"},"role":{"type":"string","enum":["owner","admin","approver","operator","viewer"]}},"required":["org_id","account_id","role"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/members/{account}":{"delete":{"summary":"Remove an organisation member","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"account","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"}},"required":["removed"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/approval-eligibility":{"get":{"summary":"May this caller answer an ask in this memory?","tags":["tenancy"],"description":"The console asks before it renders an approve button, so a person learns they cannot approve here before they try, rather than after. The rule is spec §12: only a named session approves, and outside the `standard` profile that session must be OIDC-backed. The profile is the memory's (ADR 0013).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"memory_id":{"type":"string"},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"principal":{"type":"string"},"can_approve":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["memory_id","profile","principal","can_approve","reason"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/brand":{"get":{"summary":"The organisation's brand: what is applied, the website read's proposal, the logo (owners)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"state":{"type":"string","enum":["none","proposed","confirmed"]},"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source_domain":{"type":["string","null"]},"proposal":{"anyOf":[{"type":"object","properties":{"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"signal":{"type":["string","null"]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash","signal"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"object","properties":{"domain":{"type":"string"},"url":{"type":["string","null"]},"signals":{"type":"object","properties":{"theme_color":{"type":["string","null"]},"manifest":{"type":"boolean"},"stylesheets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"icons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["theme_color","manifest","stylesheets","icons"],"additionalProperties":false}},"required":["domain","url","signals"],"additionalProperties":false},"read_at":{"type":"string"}},"required":["palette","logo","source","read_at"],"additionalProperties":false},{"type":"null"}]},"read":{"type":"object","properties":{"requested_at":{"type":["string","null"]},"at":{"type":["string","null"]},"outcome":{"anyOf":[{"type":"string","enum":["ok","free_mail","unreachable","nothing_usable","private_edition","refused"]},{"type":"null"}]}},"required":["requested_at","at","outcome"],"additionalProperties":false},"confirmed_by":{"type":["string","null"]},"confirmed_at":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["org_id","state","palette","logo","source_domain","proposal","read","confirmed_by","confirmed_at","version"],"additionalProperties":false}}}}}},"put":{"summary":"Confirm the proposal or colours of your own, replace or remove the logo, or use Areev's colours (owners; optimistic version)","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["confirmed","none"]},"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"highlight_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"data_base64":{"type":"string","minLength":1,"maxLength":360000}},"required":["content_type","data_base64"],"additionalProperties":false},{"type":"null"}]},"expected_version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["state","expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"state":{"type":"string","enum":["none","proposed","confirmed"]},"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source_domain":{"type":["string","null"]},"proposal":{"anyOf":[{"type":"object","properties":{"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"signal":{"type":["string","null"]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash","signal"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"object","properties":{"domain":{"type":"string"},"url":{"type":["string","null"]},"signals":{"type":"object","properties":{"theme_color":{"type":["string","null"]},"manifest":{"type":"boolean"},"stylesheets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"icons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["theme_color","manifest","stylesheets","icons"],"additionalProperties":false}},"required":["domain","url","signals"],"additionalProperties":false},"read_at":{"type":"string"}},"required":["palette","logo","source","read_at"],"additionalProperties":false},{"type":"null"}]},"read":{"type":"object","properties":{"requested_at":{"type":["string","null"]},"at":{"type":["string","null"]},"outcome":{"anyOf":[{"type":"string","enum":["ok","free_mail","unreachable","nothing_usable","private_edition","refused"]},{"type":"null"}]}},"required":["requested_at","at","outcome"],"additionalProperties":false},"confirmed_by":{"type":["string","null"]},"confirmed_at":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["org_id","state","palette","logo","source_domain","proposal","read","confirmed_by","confirmed_at","version"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the brand changed since `expected_version` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the brand changed since `expected_version` was read"}}}}}}},"/v1/orgs/{org}/brand/read":{"post":{"summary":"Read the organisation's website again for a new brand proposal (owners)","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"state":{"type":"string","enum":["none","proposed","confirmed"]},"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source_domain":{"type":["string","null"]},"proposal":{"anyOf":[{"type":"object","properties":{"palette":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]},"status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"secondary_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_deep_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"secondary_wash_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-f]{6}$"},{"type":"null"}]},"on_secondary":{"anyOf":[{"type":"string","enum":["white","ink"]},{"type":"null"}]},"secondary_status_clash":{"anyOf":[{"type":"string","enum":["green","blue","amber","rose"]},{"type":"null"}]},"signal":{"type":["string","null"]}},"required":["brand_color","highlight_color","deep_color","on_brand","status_clash","signal"],"additionalProperties":false},{"type":"null"}]},"logo":{"anyOf":[{"type":"object","properties":{"sha256":{"type":"string"},"content_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"type":"string","enum":["site","upload"]},"url":{"type":"string"}},"required":["sha256","content_type","width","height","source","url"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"object","properties":{"domain":{"type":"string"},"url":{"type":["string","null"]},"signals":{"type":"object","properties":{"theme_color":{"type":["string","null"]},"manifest":{"type":"boolean"},"stylesheets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"icons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["theme_color","manifest","stylesheets","icons"],"additionalProperties":false}},"required":["domain","url","signals"],"additionalProperties":false},"read_at":{"type":"string"}},"required":["palette","logo","source","read_at"],"additionalProperties":false},{"type":"null"}]},"read":{"type":"object","properties":{"requested_at":{"type":["string","null"]},"at":{"type":["string","null"]},"outcome":{"anyOf":[{"type":"string","enum":["ok","free_mail","unreachable","nothing_usable","private_edition","refused"]},{"type":"null"}]}},"required":["requested_at","at","outcome"],"additionalProperties":false},"confirmed_by":{"type":["string","null"]},"confirmed_at":{"type":["string","null"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["org_id","state","palette","logo","source_domain","proposal","read","confirmed_by","confirmed_at","version"],"additionalProperties":false}}}},"429":{"description":"CLD-E430: the website was read less than a minute ago; `Retry-After` says when","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E430: the website was read less than a minute ago; `Retry-After` says when"}}}}}}},"/v1/orgs/{org}/brand/logo":{"get":{"summary":"The organisation's confirmed logo, as bytes (every member)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","maxLength":64},"in":"query","name":"v","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{org}/brand/proposal/logo":{"get":{"summary":"The logo the website read proposed, as bytes (owners)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","maxLength":64},"in":"query","name":"v","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{org}/intake/address":{"get":{"summary":"The organisation's forwarding address: forward invoices and statements to it, or share a Drive file with the mailbox (ADR 0086)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"An organisation's shared intake address (ADR 0086)","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"available":{"type":"boolean"},"status":{"type":"string","enum":["on","off"]},"address":{"type":["string","null"]},"sender_address":{"type":"string"},"drive_share_to":{"type":["string","null"]},"since":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["org_id","available","status","address","sender_address","drive_share_to","since"],"additionalProperties":false,"description":"An organisation's shared intake address (ADR 0086)"}}}}}},"delete":{"summary":"Turn the forwarding address off: mail sent to it waits in this list instead of being filed (administrators)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"An organisation's shared intake address (ADR 0086)","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"available":{"type":"boolean"},"status":{"type":"string","enum":["on","off"]},"address":{"type":["string","null"]},"sender_address":{"type":"string"},"drive_share_to":{"type":["string","null"]},"since":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["org_id","available","status","address","sender_address","drive_share_to","since"],"additionalProperties":false,"description":"An organisation's shared intake address (ADR 0086)"}}}}}}},"/v1/orgs/{org}/intake/address/rotate":{"post":{"summary":"Replace the forwarding address: a new one is made and the old one stops filing at once (administrators)","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"An organisation's shared intake address (ADR 0086)","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"available":{"type":"boolean"},"status":{"type":"string","enum":["on","off"]},"address":{"type":["string","null"]},"sender_address":{"type":"string"},"drive_share_to":{"type":["string","null"]},"since":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["org_id","available","status","address","sender_address","drive_share_to","since"],"additionalProperties":false,"description":"An organisation's shared intake address (ADR 0086)"}}}}}}},"/v1/orgs/{org}/intake/items":{"get":{"summary":"Forwarded documents: what waits for a person here (and what you sent that waits for you), and what was filed in the last fourteen days. Metadata only","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["mail","drive"]},"received_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"from":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["routed","held","filed","discarded","expired"]},"reason_code":{"anyOf":[{"type":"string","enum":["unknown_address","retired_address","two_addresses","unknown_sender","unverified_sender","sender_in_several","sender_may_not_add","rate_limited","no_intake_product","own_cell","not_filed","not_a_file","too_large","loop"]},{"type":"null"}]},"reason":{"type":["string","null"]},"matched_by":{"anyOf":[{"type":"string","enum":["tag","sender","sharer","person"]},{"type":"null"}]},"yours":{"type":"boolean"},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"settled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"outcomes":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","statement","none"]},"status":{"type":"string","enum":["received","unassigned","set_aside","quarantined"]},"record_id":{"type":"string","maxLength":120},"deployment_id":{"type":"string","maxLength":120},"error_code":{"type":"string","maxLength":30}},"required":["kind","status"],"additionalProperties":false}}},"required":["id","source","received_at","from","subject","status","reason_code","reason","matched_by","yours","expires_at","settled_at","outcomes"],"additionalProperties":false,"description":"One forwarded message or shared file (metadata only; ADR 0086)"}},"waiting":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["data","waiting"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/intake/items/{item}/assign":{"post":{"summary":"File a waiting forwarded document into this organisation: its cell reads it from the mailbox and files it as an upload","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"item","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"One forwarded message or shared file (metadata only; ADR 0086)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["mail","drive"]},"received_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"from":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["routed","held","filed","discarded","expired"]},"reason_code":{"anyOf":[{"type":"string","enum":["unknown_address","retired_address","two_addresses","unknown_sender","unverified_sender","sender_in_several","sender_may_not_add","rate_limited","no_intake_product","own_cell","not_filed","not_a_file","too_large","loop"]},{"type":"null"}]},"reason":{"type":["string","null"]},"matched_by":{"anyOf":[{"type":"string","enum":["tag","sender","sharer","person"]},{"type":"null"}]},"yours":{"type":"boolean"},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"settled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"outcomes":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","statement","none"]},"status":{"type":"string","enum":["received","unassigned","set_aside","quarantined"]},"record_id":{"type":"string","maxLength":120},"deployment_id":{"type":"string","maxLength":120},"error_code":{"type":"string","maxLength":30}},"required":["kind","status"],"additionalProperties":false}}},"required":["id","source","received_at","from","subject","status","reason_code","reason","matched_by","yours","expires_at","settled_at","outcomes"],"additionalProperties":false,"description":"One forwarded message or shared file (metadata only; ADR 0086)"}}}},"409":{"description":"CLD-E409: the document is no longer waiting","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the document is no longer waiting"}}}},"422":{"description":"CLD-E422: this organisation's cell takes no forwarded documents","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E422: this organisation's cell takes no forwarded documents"}}}}}}},"/v1/orgs/{org}/intake/items/{item}/discard":{"post":{"summary":"Discard a waiting forwarded document: it is removed from the mailbox and never filed","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"reason":{"type":"string","maxLength":200}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"item","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"One forwarded message or shared file (metadata only; ADR 0086)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["mail","drive"]},"received_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"from":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["routed","held","filed","discarded","expired"]},"reason_code":{"anyOf":[{"type":"string","enum":["unknown_address","retired_address","two_addresses","unknown_sender","unverified_sender","sender_in_several","sender_may_not_add","rate_limited","no_intake_product","own_cell","not_filed","not_a_file","too_large","loop"]},{"type":"null"}]},"reason":{"type":["string","null"]},"matched_by":{"anyOf":[{"type":"string","enum":["tag","sender","sharer","person"]},{"type":"null"}]},"yours":{"type":"boolean"},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"settled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"outcomes":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","statement","none"]},"status":{"type":"string","enum":["received","unassigned","set_aside","quarantined"]},"record_id":{"type":"string","maxLength":120},"deployment_id":{"type":"string","maxLength":120},"error_code":{"type":"string","maxLength":30}},"required":["kind","status"],"additionalProperties":false}}},"required":["id","source","received_at","from","subject","status","reason_code","reason","matched_by","yours","expires_at","settled_at","outcomes"],"additionalProperties":false,"description":"One forwarded message or shared file (metadata only; ADR 0086)"}}}},"409":{"description":"CLD-E409: the document is no longer waiting","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the document is no longer waiting"}}}}}}},"/v1/cells/{cell}/intake/claim":{"post":{"summary":"Lease forwarded documents routed to this cell's organisations, with a short-lived mailbox token","tags":["cells"],"description":"The cell pulls (ADR 0008's shape). Each item names a Gmail message or a Drive file of the shared intake mailbox; the cell reads its bytes from Google with `access_token` (Google's hour, minted here from the mailbox's refresh token and never stored) and files them into the organisation's own records. Only a shared cell is handed a token (ADR 0086 §1).","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{"max":5},"type":"object","properties":{"max":{"default":5,"type":"integer","minimum":1,"maximum":10}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":["string","null"]},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["gmail","drive"]},"external_id":{"type":"string"},"org_id":{"type":"string"},"received_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","source","external_id","org_id","received_at"],"additionalProperties":false}}},"required":["access_token","token_expires_at","items"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/intake/{item}/report":{"post":{"summary":"Report what a cell filed from a forwarded document: kinds, statuses and record ids, no content","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["filed","held"]},"reason_code":{"type":"string","enum":["no_intake_product","not_filed"]},"outcomes":{"default":[],"maxItems":12,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","statement","none"]},"status":{"type":"string","enum":["received","unassigned","set_aside","quarantined"]},"record_id":{"type":"string","maxLength":120},"deployment_id":{"type":"string","maxLength":120},"error_code":{"type":"string","maxLength":30}},"required":["kind","status"]}}},"required":["status"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"item","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/api-keys":{"post":{"summary":"Mint an API key. The secret is shown once and never again","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["memories:read","memories:credentials","packs:publish","deployments:write","jobs:submit","jobs:read","runs:respond","ledger:read","admin","catalog:write","cells:write","orders:read","orders:write","disputes:write","support:read","approvals:read","offers:read","desk:read"]}},"memory_ids":{"type":"array","items":{"type":"string"}},"expires_in_days":{"type":"integer","exclusiveMinimum":0,"maximum":3650}},"required":["name","scopes"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"]},"token":{"type":"string"}},"required":["id","name","prefix","scopes","expires_at","token"],"additionalProperties":false}}}}}},"get":{"summary":"List API keys. Never their secrets","tags":["auth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"last_used_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","prefix","scopes","expires_at","revoked_at","last_used_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/api-keys/{id}":{"delete":{"summary":"Revoke an API key immediately","tags":["auth"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/service-principals":{"post":{"summary":"Create a service principal for a vertical application","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"pattern":"^[a-z][a-z0-9-]*$"},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["memories:read","memories:credentials","packs:publish","deployments:write","jobs:submit","jobs:read","runs:respond","ledger:read","admin","catalog:write","cells:write","orders:read","orders:write","disputes:write","support:read","approvals:read","offers:read","desk:read"]}},"delegated_respond":{"default":false,"type":"boolean"}},"required":["name","scopes"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"principal":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"delegated_respond":{"type":"boolean"},"token":{"type":"string"}},"required":["id","name","principal","scopes","delegated_respond","token"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/memories":{"post":{"summary":"Provision a memory in one of the organisation's cells","tags":["memories"],"description":"Returns 202: the memory is recorded as `provisioning` and a worker inside the cell creates the schema, its roles and its anonymization key. The control plane never opens a memory (spec §2, §7.1). The memory lives in `cell_id` when given — a shared cell in a zone the organisation may hold, or a cell of its own — else in the organisation's default cell (ADR 0029 §4).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","maxLength":200},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"schema_name":{"type":"string","pattern":"^mem_[a-z0-9_]{1,55}$"},"embedder":{"default":"none","type":"string","maxLength":100},"profile":{"default":"standard","type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"environment":{"default":"production","type":"string","enum":["production","staging","dev"]},"cell_id":{"type":"string","minLength":1,"maxLength":100}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"cell_id":{"type":"string"},"schema_name":{"type":"string"},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"environment":{"type":"string","enum":["production","staging","dev"]},"label":{"type":["string","null"]},"core_version":{"type":"string"},"embedder":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"residency":{"type":["string","null"]},"purpose":{"type":["string","null"]}},"required":["id","org_id","entity_id","cell_id","schema_name","profile","environment","label","core_version","embedder","status","status_reason"],"additionalProperties":false}}}}}},"get":{"summary":"Memories in an organisation","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"cell_id":{"type":"string"},"schema_name":{"type":"string"},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"environment":{"type":"string","enum":["production","staging","dev"]},"label":{"type":["string","null"]},"core_version":{"type":"string"},"embedder":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"residency":{"type":["string","null"]},"purpose":{"type":["string","null"]}},"required":["id","org_id","entity_id","cell_id","schema_name","profile","environment","label","core_version","embedder","status","status_reason"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/memories/{id}":{"get":{"summary":"One memory","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"cell_id":{"type":"string"},"schema_name":{"type":"string"},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"environment":{"type":"string","enum":["production","staging","dev"]},"label":{"type":["string","null"]},"core_version":{"type":"string"},"embedder":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"residency":{"type":["string","null"]},"purpose":{"type":["string","null"]}},"required":["id","org_id","entity_id","cell_id","schema_name","profile","environment","label","core_version","embedder","status","status_reason"],"additionalProperties":false}}}}}},"patch":{"summary":"Rename a memory or raise its compliance profile","tags":["memories"],"description":"A profile is tightened and never loosened; the raise is re-checked against every pack installed in the memory on its cell (spec §7.6, §17). Requires Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"cell_id":{"type":"string"},"schema_name":{"type":"string"},"profile":{"type":"string","enum":["standard","financial","gdpr","healthcare-ksa","hiring-eu-ai-act"]},"environment":{"type":"string","enum":["production","staging","dev"]},"label":{"type":["string","null"]},"core_version":{"type":"string"},"embedder":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"residency":{"type":["string","null"]},"purpose":{"type":["string","null"]}},"required":["id","org_id","entity_id","cell_id","schema_name","profile","environment","label","core_version","embedder","status","status_reason"],"additionalProperties":false}}}}}},"delete":{"summary":"Retire a memory: revoke its credentials and drop its schema","tags":["memories"],"description":"Returns 202. The memory becomes `erasing`; a worker inside the cell drops the schema and reports, and the memory becomes `erased` with a deletion receipt. Irreversible: export first if the contents are wanted (§16).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","minLength":1,"maxLength":63},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["confirm","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"schema_name":{"type":"string"}},"required":["id","status","schema_name"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/timeline":{"get":{"summary":"Everything the control plane knows about this memory, in order","tags":["memories"],"description":"The newest 1000 entries, oldest first; `truncated` says when there were more. No cursor: a memory has hundreds of entries at most.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"memory_id":{"type":"string"},"truncated":{"type":"boolean"},"entries":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string"},"summary":{"type":"string"},"source":{"type":"object","properties":{"table":{"type":"string"},"id":{"type":"string"}},"required":["table","id"],"additionalProperties":false},"actor":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["at","kind","summary","source"],"additionalProperties":false}}},"required":["memory_id","truncated","entries"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/reprovision":{"post":{"summary":"Provision a suspended memory again","tags":["memories"],"description":"Returns 202: the memory moves from `suspended` back to `provisioning` and its cell provisions it again on its next plan with the credentials it already stored. Requires Idempotency-Key; owner or admin, or a credential with the admin scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["provisioning"]}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/archive":{"post":{"summary":"Archive a memory to its cell's bucket","tags":["memories"],"description":"Returns 202: the memory becomes `archiving`; its cell bundles it to the cell's bucket, drops the schema and reports, and it becomes `archived` with a receipt. `POST /v1/memories/{id}/restore` brings it back. Requires Idempotency-Key; owner or admin, or a credential with the admin scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["archiving"]}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/restore":{"post":{"summary":"Restore an archived memory from its bundle","tags":["memories"],"description":"Returns 202: the memory becomes `restoring` and its cell restores it on its next plan. Requires Idempotency-Key; owner or admin, or a credential with the admin scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["restoring"]}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/credentials":{"post":{"summary":"Request a database credential for a memory; its password is claimed once from the cell","tags":["memories"],"description":"A per-credential Postgres role, member of the memory's rw or ro role, with VALID UNTIL, minted by the memory's cell. The answer carries the DSN without its password and a claim_url on the cell's Gateway, where a person of this organisation holding a cell-audience token with memories.credentials reads the password once, after GET …/credentials/{cred} says minted. Expiry is enforced by Postgres and revocation is dropping the role (spec §7.2).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"default":"ro","type":"string","enum":["rw","ro"]},"ttl_hours":{"default":24,"type":"integer","minimum":1,"maximum":2160},"issued_to":{"type":"string","maxLength":200},"without_schema":{"default":false,"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["rw","ro"]},"role":{"type":"string"},"dsn_template":{"type":"string"},"dsn":{"type":"string"},"ca_pem":{"type":["string","null"]},"expires_at":{"type":"string"},"core_version":{"type":"string"},"status":{"type":"string","enum":["requested","minted","delivered","revoked","failed"]},"anon_key":{"type":["string","null"]},"claim_url":{"type":["string","null"]}},"required":["id","kind","role","dsn_template","dsn","ca_pem","expires_at","core_version","status","anon_key","claim_url"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/credentials/{cred}":{"get":{"summary":"A credential's state: requested, minted (claim it), delivered, revoked or failed","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cred","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["rw","ro"]},"role":{"type":"string"},"dsn_template":{"type":"string"},"dsn":{"type":"string"},"ca_pem":{"type":["string","null"]},"expires_at":{"type":"string"},"core_version":{"type":"string"},"status":{"type":"string","enum":["requested","minted","delivered","revoked","failed"]},"anon_key":{"type":["string","null"]},"claim_url":{"type":["string","null"]},"minted_at":{"type":["string","null"]},"delivered_at":{"type":["string","null"]},"delivered_to":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"failure":{"type":["string","null"]}},"required":["id","kind","role","dsn_template","dsn","ca_pem","expires_at","core_version","status","anon_key","claim_url","minted_at","delivered_at","delivered_to","revoked_at","failure"],"additionalProperties":false}}}}}},"delete":{"summary":"Revoke a credential: its cell drops the role and any password it still holds","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cred","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"},"status":{"type":["string","null"]}},"required":["revoked","status"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities":{"get":{"summary":"Business identity directory for an organisation administrator","tags":["entities"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["self","managed"]},"status":{"type":"string","enum":["active","archived"]},"client_relationship_ref":{"type":["string","null"]},"country":{"type":["string","null"]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16 (docs/api/CHANGELOG.md): the mirror of filing.signers[0]. Read filing.signers.","type":["string","null"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","org_id","label","kind","status","client_relationship_ref","country","signatory_principal","filing","version","created_at","updated_at","created_by"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Register a business identity without moving or merging records","tags":["entities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"default":"managed","type":"string","enum":["self","managed"]},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["label"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["self","managed"]},"status":{"type":"string","enum":["active","archived"]},"client_relationship_ref":{"type":["string","null"]},"country":{"type":["string","null"]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16 (docs/api/CHANGELOG.md): the mirror of filing.signers[0]. Read filing.signers.","type":["string","null"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","org_id","label","kind","status","client_relationship_ref","country","signatory_principal","filing","version","created_at","updated_at","created_by"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities/{entity}":{"get":{"summary":"Read a business identity","tags":["entities"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["self","managed"]},"status":{"type":"string","enum":["active","archived"]},"client_relationship_ref":{"type":["string","null"]},"country":{"type":["string","null"]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16 (docs/api/CHANGELOG.md): the mirror of filing.signers[0]. Read filing.signers.","type":["string","null"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","org_id","label","kind","status","client_relationship_ref","country","signatory_principal","filing","version","created_at","updated_at","created_by"],"additionalProperties":false}}}}}},"patch":{"summary":"Rename an entity, say where it is, or set how it files its returns and who signs them, without changing its identity or access","tags":["entities"],"description":"Owners and administrators. `filing` carries the business's filing settings (ADR 0110): `signing_method`, the signatory's `signatory_pan`, the ordered `signers` (every one an active organisation member), `preparer_may_sign`, `owner_approves_filing` and the `dsc_registered_at` attestation. `signatory_principal` is the deprecated mirror of the first signer: writing it makes that person the first signer, and clearing it is refused `CLD-E409` for a business that names several.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16: writing it makes that person the first of filing.signers. Write filing.signers.","anyOf":[{"type":"string","maxLength":260,"pattern":"^user:[^\\s@]+@[^\\s@]+$"},{"type":"null"}]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"anyOf":[{"type":"string","pattern":"^[A-Z]{5}[0-9]{4}[A-Z]$"},{"type":"null"}]},"signers":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":260,"pattern":"^user:[^\\s@]+@[^\\s@]+$"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"additionalProperties":false},"expected_version":{"type":"integer","minimum":1,"maximum":2147483646}},"required":["expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["self","managed"]},"status":{"type":"string","enum":["active","archived"]},"client_relationship_ref":{"type":["string","null"]},"country":{"type":["string","null"]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16 (docs/api/CHANGELOG.md): the mirror of filing.signers[0]. Read filing.signers.","type":["string","null"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","org_id","label","kind","status","client_relationship_ref","country","signatory_principal","filing","version","created_at","updated_at","created_by"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities/{entity}/archive":{"post":{"summary":"Archive a business: it leaves every picker and scope and can no longer be edited; its records and audit stay","tags":["entities"],"description":"Owners and administrators. Refused CLD-E409 for the organisation's own business, for a business with a product still running in it (a provisioning or active memory), and for a stale `expected_version`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_version":{"type":"integer","minimum":1,"maximum":2147483646},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["expected_version","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["self","managed"]},"status":{"type":"string","enum":["active","archived"]},"client_relationship_ref":{"type":["string","null"]},"country":{"type":["string","null"]},"signatory_principal":{"deprecated":true,"description":"Deprecated 2026-10-16, sunset 2027-10-16 (docs/api/CHANGELOG.md): the mirror of filing.signers[0]. Read filing.signers.","type":["string","null"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"string"}},"required":["id","org_id","label","kind","status","client_relationship_ref","country","signatory_principal","filing","version","created_at","updated_at","created_by"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities/{entity}/members":{"get":{"summary":"Staff explicitly assigned to a business","tags":["entities"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"org_id":{"type":"string"},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"account_id":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":"string"}},"required":["org_id","entity_id","account_id","created_at","created_by"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Assign an organisation member to a business","tags":["entities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","pattern":"^acc_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["account_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"account_id":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":"string"}},"required":["org_id","entity_id","account_id","created_at","created_by"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities/{entity}/members/{account}":{"delete":{"summary":"Revoke a staff member's business assignment","tags":["entities"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"entity","required":true},{"schema":{"type":"string","pattern":"^acc_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"account","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean","enum":[true]}},"required":["revoked"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/navigation":{"get":{"summary":"The Desk's seven destinations, their labels, entries, pins and landing view for you","tags":["desk"],"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"destinations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["home","work","records","reports","products","money","setup"]},"label":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"workflow":{"type":"string","minLength":1,"maxLength":120},"journey":{"type":"object","properties":{"kind":{"type":"string","enum":["gst-return"]},"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A"]},"actions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}},"required":["kind","form","actions"],"additionalProperties":false},"id":{"type":"string"},"label":{"type":"string"},"family":{"type":"string","enum":["queue","record","report","setup","schedule","conversation"]},"action":{"type":"string"},"capability":{"type":"string"},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"type":"string","enum":["active","paused"]},"scopes":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":["string","null"]},"entity_label":{"type":["string","null"]},"deployment_id":{"type":"string"},"pack":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"],"additionalProperties":false},"state":{"type":"string","enum":["active","paused"]},"workflows":{"type":"array","items":{"type":"string"}}},"required":["entity_id","entity_label","deployment_id","pack","state"],"additionalProperties":false}},"pinned":{"type":"boolean"},"record_types":{"type":"array","items":{"type":"object","properties":{"record_type_id":{"type":"string"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"role":{"type":"string","enum":["produces","consumes","extends"]}},"required":["record_type_id","major","minor","role"],"additionalProperties":false}},"row_actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"record_type":{"type":"string"},"action":{"type":"string"}},"required":["id","record_type","action"],"additionalProperties":false}},"pin_suggested":{"type":"boolean"}},"required":["id","label","family","action","capability","mark","order","state","scopes","pinned","record_types","pin_suggested"],"additionalProperties":false}}},"required":["id","label","entries"],"additionalProperties":false}},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"prominence":{"type":"string","enum":["primary","secondary"]},"entry_ids":{"type":"array","items":{"type":"string"}},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]}},"required":["id","label","prominence","entry_ids"],"additionalProperties":false}},"terminology":{"type":"object","propertyNames":{"type":"string","enum":["records","entity","work","report","product","setup","conversation"]},"additionalProperties":{"type":"object","properties":{"one":{"type":"string"},"many":{"type":"string"},"source":{"type":"string","enum":["pack","org","default"]}},"required":["one","many","source"],"additionalProperties":false},"required":["records","entity","work","report","product","setup","conversation"]},"conflicts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["records","entity","work","report","product","setup","conversation"]},"candidates":{"type":"array","items":{"type":"object","properties":{"value":{"type":"object","properties":{"one":{"type":"string"},"many":{"type":"string"}},"required":["one","many"],"additionalProperties":false},"packs":{"type":"array","items":{"type":"string"}}},"required":["value","packs"],"additionalProperties":false}}},"required":["key","candidates"],"additionalProperties":false}},"pins":{"type":"array","items":{"type":"string"}},"suggested_pins":{"type":"array","items":{"type":"string"}},"repairs":{"type":"array","items":{"type":"object","properties":{"pin":{"type":"string"},"reason":{"type":"string","enum":["not_present","not_permitted"]}},"required":["pin","reason"],"additionalProperties":false}},"landing":{"type":"string","enum":["home","work","records","reports","products","money","setup"]},"preferences_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["schema_version","org_id","entity_id","destinations","terminology","conflicts","pins","suggested_pins","repairs","landing","preferences_version"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/orgs/{org}/desk/entities":{"get":{"summary":"The businesses you may scope the Desk to: all for an administrator, your assigned ones otherwise","tags":["desk"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]},"filing":{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false}},"required":["id","label","kind"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/terminology":{"get":{"summary":"The organisation's own nouns for the Desk's concepts","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"object","propertyNames":{"type":"string","enum":["records","entity","work","report","product","setup","conversation"]},"additionalProperties":{"type":"object","properties":{"one":{"type":"string"},"many":{"type":"string"}},"required":["one","many"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["entries","version"],"additionalProperties":false}}}}}},"put":{"summary":"Replace the organisation's Desk terminology (whole map, optimistic version)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"object","propertyNames":{"type":"string","enum":["records","entity","work","report","product","setup","conversation"]},"additionalProperties":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false}},"expected_version":{"type":"integer","minimum":0,"maximum":2147483646}},"required":["entries","expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"object","propertyNames":{"type":"string","enum":["records","entity","work","report","product","setup","conversation"]},"additionalProperties":{"type":"object","properties":{"one":{"type":"string"},"many":{"type":"string"}},"required":["one","many"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["entries","version"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the terminology changed since `version` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the terminology changed since `version` was read"}}}}}}},"/v1/orgs/{org}/desk/preferences":{"get":{"summary":"Your own Desk pins, landing view, saved Home view and Home-proposals setting in this organisation","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pins":{"type":"array","items":{"type":"string"}},"landing":{"anyOf":[{"type":"string","enum":["home","work","records","reports","products","money","setup"]},{"type":"null"}]},"home_view_id":{"type":["string","null"]},"home_proposals":{"type":"string","enum":["automatic","ask","additions","never"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":["string","null"]}},"required":["pins","landing","home_view_id","home_proposals","version","updated_at"],"additionalProperties":false}}}}}},"put":{"summary":"Save your own Desk pins, landing view, Home view and Home-proposals setting (optimistic version)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pins":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*$"}},"landing":{"anyOf":[{"type":"string","enum":["home","work","records","reports","products","money","setup"]},{"type":"null"}]},"home_view_id":{"anyOf":[{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"home_proposals":{"type":"string","enum":["automatic","ask","additions","never"]},"expected_version":{"type":"integer","minimum":0,"maximum":2147483646}},"required":["pins","landing","expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pins":{"type":"array","items":{"type":"string"}},"landing":{"anyOf":[{"type":"string","enum":["home","work","records","reports","products","money","setup"]},{"type":"null"}]},"home_view_id":{"type":["string","null"]},"home_proposals":{"type":"string","enum":["automatic","ask","additions","never"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":["string","null"]}},"required":["pins","landing","home_view_id","home_proposals","version","updated_at"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the preferences changed since `version` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the preferences changed since `version` was read"}}}}}}},"/v1/orgs/{org}/desk/home/descriptors":{"get":{"summary":"What you may put on Home in this scope: components, zones, permitted queries, capabilities and their recipes","tags":["desk"],"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"view_schema_versions":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","version"],"additionalProperties":false}},"zones":{"type":"object","propertyNames":{"type":"string","enum":["pulse","main","side","products"]},"additionalProperties":{"type":"object","properties":{"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"components":{"type":"array","items":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]}},"sizes":{"type":"array","items":{"type":"string","enum":["s","m","l"]}}},"required":["capacity","components","sizes"],"additionalProperties":false},"required":["pulse","main","side","products"]},"stages":{"type":"array","items":{"type":"string","enum":["waiting","working","needs_you","done","stopped"]}},"queries":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"components":{"type":"array","items":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]}},"unit":{"type":"string","enum":["count","money","status","link"]},"capability":{"type":"string","enum":["optional","none","required"]},"describes":{"type":"string"}},"required":["ref","version","components","unit","capability","describes"],"additionalProperties":false}},"capabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["active","paused"]},"entry_ids":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"state":{"type":"string","enum":["active","paused"]}},"required":["deployment_id","entity_id","state"],"additionalProperties":false}},"recipes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"capability":{"type":"string"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ref","version"],"additionalProperties":false},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"title":{"type":"string"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prominence":{"type":"string","enum":["primary","secondary"]},"source":{"type":"string","enum":["declared","derived"]}},"required":["id","capability","component","query","params","title","order","prominence","source"],"additionalProperties":false}},"stage_labels":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"string","minLength":1,"maxLength":24},"working":{"type":"string","minLength":1,"maxLength":24},"needs_you":{"type":"string","minLength":1,"maxLength":24},"done":{"type":"string","minLength":1,"maxLength":24},"stopped":{"type":"string","minLength":1,"maxLength":24}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","mark","state","entry_ids","scopes","recipes","stage_labels"],"additionalProperties":false}},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"family":{"type":"string"},"capability":{"type":"string"},"state":{"type":"string","enum":["active","paused"]}},"required":["id","label","family","capability","state"],"additionalProperties":false}},"pins":{"type":"array","items":{"type":"string"}},"currencies":{"type":"array","items":{"type":"string"}},"ask":{"default":null,"anyOf":[{"type":"object","properties":{"suggestions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["suggestions"],"additionalProperties":false},{"type":"null"}]},"limits":{"type":"object","properties":{"cards":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queue_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_days_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"views_per_person":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cards","queue_rows","period_days_max","views_per_person"],"additionalProperties":false}},"required":["schema_version","org_id","entity_id","view_schema_versions","components","zones","stages","queries","capabilities","entries","pins","currencies","ask","limits"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/home":{"get":{"summary":"Your Home in this scope: the saved view you chose, or the default for what this business runs, with each card's data","tags":["desk"],"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"view":{"type":"object","properties":{"id":{"type":["string","null"]},"source":{"type":"string","enum":["saved","default"]},"audience":{"anyOf":[{"type":"string","enum":["personal","org"]},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]}},"required":["id","component","query","params","capability","size"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false}]}},"required":["id","source","audience","revision","definition"],"additionalProperties":false},"fallback":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["no_saved_view","not_found","scope_mismatch","unsupported_schema_version","invalid","not_applicable"]},"view_id":{"type":["string","null"]}},"required":["reason","view_id"],"additionalProperties":false},{"type":"null"}]},"repairs":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"card_id":{"type":["string","null"]},"code":{"type":"string","enum":["schema","unsupported_schema_version","unsupported_query_version","component_not_supported","query_not_permitted","capability_not_available","capability_not_allowed","capability_required","params_invalid","currency_required","entry_not_present","scope_not_permitted","zone_not_allowed","size_not_allowed","zone_full"]},"message":{"type":"string"}},"required":["path","card_id","code","message"],"additionalProperties":false}},"repair_preview":{"anyOf":[{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]}},"required":["id","component","query","params","capability","size"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false}]},{"type":"null"}]},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"title":{"type":"string"},"capability":{"type":["string","null"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ref","version"],"additionalProperties":false},"size":{"type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"type":"boolean"},"state":{"type":"string","enum":["ready","empty","not_applicable","refused"]},"data":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["metric"]},"unit":{"type":"string","enum":["count","money"]},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]},"period_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["kind","unit","value","currency","period_days"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["approvals"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"approval_id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":"string"},"asked_at":{"type":"string"},"kind":{"type":"string","enum":["approval","sign"]},"due_at":{"type":["string","null"]},"amount_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]}},"required":["approval_id","job_id","deployment_id","asked_at","kind","due_at","amount_minor","currency"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["jobs"]},"items":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string"},"deployment_id":{"type":"string"},"created_at":{"type":"string"}},"required":["job_id","status","deployment_id","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["status_counts"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","count"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","period_days","counts","total"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["setup"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"activation_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":["string","null"]},"state":{"type":"string"},"sections_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sections_required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["activation_id","entity_id","deployment_id","state","sections_done","sections_required"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["money"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","amount_minor"],"additionalProperties":false}}},"required":["kind","period_days","totals"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["entry"]},"entry_id":{"type":"string"},"label":{"type":"string"},"family":{"type":"string"},"state":{"type":"string","enum":["active","paused"]}},"required":["kind","entry_id","label","family","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["attention"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["approval","sign","setup","plan_ending","paused"]},"id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"at":{"type":"string"},"due_at":{"type":["string","null"]},"amount_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]}},"required":["kind","id","job_id","deployment_id","entity_id","at","due_at","amount_minor","currency"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["active_counts"]},"running":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","running","queued","parked","gated","total"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["series"]},"unit":{"type":"string","enum":["count","money"]},"currency":{"type":["string","null"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bucket":{"type":"string","enum":["day","week"]},"points":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","value"],"additionalProperties":false}},"current":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"previous":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","unit","currency","period_days","bucket","points","current","previous"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["stages"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"capability":{"type":"string"},"labels":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"string","minLength":1,"maxLength":24},"working":{"type":"string","minLength":1,"maxLength":24},"needs_you":{"type":"string","minLength":1,"maxLength":24},"done":{"type":"string","minLength":1,"maxLength":24},"stopped":{"type":"string","minLength":1,"maxLength":24}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"counts":{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["capability","labels","counts","total"],"additionalProperties":false}}},"required":["kind","period_days","rows"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["balance"]},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"available_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","available_minor","held_minor"],"additionalProperties":false}}},"required":["kind","totals"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["plans"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"entitlement_id":{"type":"string"},"offer_name":{"type":["string","null"]},"period_end":{"type":"string"},"deployment_id":{"type":["string","null"]}},"required":["entitlement_id","offer_name","period_end","deployment_id"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["product"]},"capability":{"type":"string"},"name":{"type":["string","null"]},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["active","paused"]},"deployments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity_ids":{"type":"array","items":{"type":"string"}},"last_activity_at":{"type":["string","null"]},"waiting":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stages":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"labels":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"string","minLength":1,"maxLength":24},"working":{"type":"string","minLength":1,"maxLength":24},"needs_you":{"type":"string","minLength":1,"maxLength":24},"done":{"type":"string","minLength":1,"maxLength":24},"stopped":{"type":"string","minLength":1,"maxLength":24}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["kind","capability","name","mark","state","deployments","entity_ids","last_activity_at","waiting","stages","labels","setup_pending"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["ask_suggestions"]},"questions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"],"additionalProperties":false}}},"required":["kind","questions"],"additionalProperties":false}]},{"type":"null"}]}},"required":["id","component","title","capability","query","size","zone","pinned","state","data"],"additionalProperties":false}},"home_view_id":{"type":["string","null"]},"preferences_version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["schema_version","org_id","entity_id","view","fallback","repairs","repair_preview","cards","home_view_id","preferences_version"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/home/preview":{"post":{"summary":"Check a Home definition and show it with current data, without saving it (reads only; no Idempotency-Key)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["definition"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"faults":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","number"]}},"card_id":{"type":["string","null"]},"code":{"type":"string","enum":["schema","unsupported_schema_version","unsupported_query_version","component_not_supported","query_not_permitted","capability_not_available","capability_not_allowed","capability_required","params_invalid","currency_required","entry_not_present","scope_not_permitted","zone_not_allowed","size_not_allowed","zone_full"]},"message":{"type":"string"}},"required":["path","card_id","code","message"],"additionalProperties":false}},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"title":{"type":"string"},"capability":{"type":["string","null"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ref","version"],"additionalProperties":false},"size":{"type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"type":"boolean"},"state":{"type":"string","enum":["ready","empty","not_applicable","refused"]},"data":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["metric"]},"unit":{"type":"string","enum":["count","money"]},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]},"period_days":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["kind","unit","value","currency","period_days"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["approvals"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"approval_id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":"string"},"asked_at":{"type":"string"},"kind":{"type":"string","enum":["approval","sign"]},"due_at":{"type":["string","null"]},"amount_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]}},"required":["approval_id","job_id","deployment_id","asked_at","kind","due_at","amount_minor","currency"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["jobs"]},"items":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string"},"deployment_id":{"type":"string"},"created_at":{"type":"string"}},"required":["job_id","status","deployment_id","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["status_counts"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","count"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","period_days","counts","total"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["setup"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"activation_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":["string","null"]},"state":{"type":"string"},"sections_done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sections_required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["activation_id","entity_id","deployment_id","state","sections_done","sections_required"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["money"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","amount_minor"],"additionalProperties":false}}},"required":["kind","period_days","totals"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["entry"]},"entry_id":{"type":"string"},"label":{"type":"string"},"family":{"type":"string"},"state":{"type":"string","enum":["active","paused"]}},"required":["kind","entry_id","label","family","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["attention"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["approval","sign","setup","plan_ending","paused"]},"id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"at":{"type":"string"},"due_at":{"type":["string","null"]},"amount_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]}},"required":["kind","id","job_id","deployment_id","entity_id","at","due_at","amount_minor","currency"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["active_counts"]},"running":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","running","queued","parked","gated","total"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["series"]},"unit":{"type":"string","enum":["count","money"]},"currency":{"type":["string","null"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bucket":{"type":"string","enum":["day","week"]},"points":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","value"],"additionalProperties":false}},"current":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"previous":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","unit","currency","period_days","bucket","points","current","previous"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["stages"]},"period_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"capability":{"type":"string"},"labels":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"string","minLength":1,"maxLength":24},"working":{"type":"string","minLength":1,"maxLength":24},"needs_you":{"type":"string","minLength":1,"maxLength":24},"done":{"type":"string","minLength":1,"maxLength":24},"stopped":{"type":"string","minLength":1,"maxLength":24}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"counts":{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["capability","labels","counts","total"],"additionalProperties":false}}},"required":["kind","period_days","rows"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["balance"]},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"available_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","available_minor","held_minor"],"additionalProperties":false}}},"required":["kind","totals"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["plans"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"entitlement_id":{"type":"string"},"offer_name":{"type":["string","null"]},"period_end":{"type":"string"},"deployment_id":{"type":["string","null"]}},"required":["entitlement_id","offer_name","period_end","deployment_id"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["kind","count","items","has_more"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["product"]},"capability":{"type":"string"},"name":{"type":["string","null"]},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"state":{"type":"string","enum":["active","paused"]},"deployments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entity_ids":{"type":"array","items":{"type":"string"}},"last_activity_at":{"type":["string","null"]},"waiting":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stages":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"labels":{"anyOf":[{"type":"object","properties":{"waiting":{"type":"string","minLength":1,"maxLength":24},"working":{"type":"string","minLength":1,"maxLength":24},"needs_you":{"type":"string","minLength":1,"maxLength":24},"done":{"type":"string","minLength":1,"maxLength":24},"stopped":{"type":"string","minLength":1,"maxLength":24}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["kind","capability","name","mark","state","deployments","entity_ids","last_activity_at","waiting","stages","labels","setup_pending"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["ask_suggestions"]},"questions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"],"additionalProperties":false}}},"required":["kind","questions"],"additionalProperties":false}]},{"type":"null"}]}},"required":["id","component","title","capability","query","size","zone","pinned","state","data"],"additionalProperties":false}}},"required":["valid","faults","cards"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/views":{"get":{"summary":"Your saved Home views and the organisation's","tags":["desk"],"parameters":[{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["personal","org"]},"title":{"type":"string"},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"compatible":{"type":"boolean"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","audience","title","schema_version","compatible","definition","revision","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Save a Home view: personal, or the organisation's (administrators)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"audience":{"default":"personal","type":"string","enum":["personal","org"]},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["definition"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["personal","org"]},"title":{"type":"string"},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"compatible":{"type":"boolean"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","audience","title","schema_version","compatible","definition","revision","created_at","updated_at"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: you already hold the most views allowed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: you already hold the most views allowed"}}}}}}},"/v1/orgs/{org}/desk/views/{view}":{"get":{"summary":"One saved Home view","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"view","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["personal","org"]},"title":{"type":"string"},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"compatible":{"type":"boolean"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","audience","title","schema_version","compatible","definition","revision","created_at","updated_at"],"additionalProperties":false}}}}}},"put":{"summary":"Replace a saved Home view's definition (optimistic revision)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expected_revision":{"type":"integer","minimum":1,"maximum":2147483646}},"required":["definition","expected_revision"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"view","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["personal","org"]},"title":{"type":"string"},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"compatible":{"type":"boolean"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","audience","title","schema_version","compatible","definition","revision","created_at","updated_at"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the view changed since `revision` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the view changed since `revision` was read"}}}}}},"delete":{"summary":"Delete a saved Home view; whoever opened it as Home sees the default","tags":["desk"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":2147483646},"in":"query","name":"expected_revision","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"view","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"204":{"description":"Default Response"},"409":{"description":"CLD-E409: the view changed since `revision` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the view changed since `revision` was read"}}}}}}},"/v1/orgs/{org}/desk/usage":{"post":{"summary":"Add a minute of your own Home usage counts (shown, opens, dismissals) for today or yesterday; counts only, six batches a minute","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"subject":{"type":"string","enum":["card","view","entry","capability"]},"id":{"type":"string","minLength":1,"maxLength":100},"shown":{"default":0,"type":"integer","minimum":0,"maximum":500},"opens":{"default":0,"type":"integer","minimum":0,"maximum":200},"dismissals":{"default":0,"type":"integer","minimum":0,"maximum":50}},"required":["subject","id"],"additionalProperties":false}}},"required":["day","events"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string"},"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","events"],"additionalProperties":false}}}},"429":{"description":"CLD-E430: more than six batches a minute; `Retry-After` says when","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E430: more than six batches a minute; `Retry-After` says when"}}}}}},"get":{"summary":"Your own Home usage counts in this organisation, by day, and your proposal decisions","tags":["desk"],"parameters":[{"schema":{"default":90,"type":"integer","minimum":1,"maximum":90},"in":"query","name":"days","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"retention_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject":{"type":"string","enum":["card","view","entry","capability"]},"id":{"type":"string"},"shown":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"opens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dismissals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","subject","id","shown","opens","dismissals"],"additionalProperties":false}},"proposals":{"type":"object","properties":{"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dismissed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["accepted","dismissed","applied"],"additionalProperties":false}},"required":["retention_days","rows","proposals"],"additionalProperties":false}}}}}},"delete":{"summary":"Clear every usage count of yours in this organisation, and every decision the Home scorer made for you","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/v1/orgs/{org}/desk/home/proposals":{"get":{"summary":"Your Home proposals in this organisation, open first; the Desk shows an open one as a banner","tags":["desk"],"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"in":"query","name":"status","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"trigger":{"type":"string","enum":["activation_ready","capability_paused","plan_ended","usage_shift","periodic","requested"]},"status":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"base_view_id":{"type":["string","null"]},"base_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"null"}]},"diff":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","move","resize"]},"card_id":{"type":"string"},"from":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string","enum":["new_product","waiting_items","often_opened","rarely_opened","product_paused","plan_ended","space","pinned_kept"]}},"required":["op","card_id","from","to","reason"],"additionalProperties":false}},{"type":"null"}]},"model":{"anyOf":[{"type":"object","properties":{"scorer":{"type":"string","enum":["prior","jev-openrouter","inhouse"]},"model":{"type":"string"},"provider":{"type":"string"},"features_version":{"type":"string"},"planner_version":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"latencies_ms":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["scorer","model","provider","features_version","planner_version","fallback","fallback_reason","requests","cached","input_tokens","cost_usd_micros","latencies_ms"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"ready_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"result_view_id":{"type":["string","null"]},"result_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","org_id","entity_id","trigger","status","base_view_id","base_revision","definition","diff","model","created_at","ready_at","expires_at","decided_at","result_view_id","result_revision"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Ask for a Home proposal for this scope now (one a minute); the scheduler plans it","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"trigger":{"type":"string","enum":["activation_ready","capability_paused","plan_ended","usage_shift","periodic","requested"]},"status":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"base_view_id":{"type":["string","null"]},"base_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"null"}]},"diff":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","move","resize"]},"card_id":{"type":"string"},"from":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string","enum":["new_product","waiting_items","often_opened","rarely_opened","product_paused","plan_ended","space","pinned_kept"]}},"required":["op","card_id","from","to","reason"],"additionalProperties":false}},{"type":"null"}]},"model":{"anyOf":[{"type":"object","properties":{"scorer":{"type":"string","enum":["prior","jev-openrouter","inhouse"]},"model":{"type":"string"},"provider":{"type":"string"},"features_version":{"type":"string"},"planner_version":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"latencies_ms":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["scorer","model","provider","features_version","planner_version","fallback","fallback_reason","requests","cached","input_tokens","cost_usd_micros","latencies_ms"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"ready_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"result_view_id":{"type":["string","null"]},"result_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","org_id","entity_id","trigger","status","base_view_id","base_revision","definition","diff","model","created_at","ready_at","expires_at","decided_at","result_view_id","result_revision"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: Home proposals are off for this organisation, or you turned them off","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: Home proposals are off for this organisation, or you turned them off"}}}},"429":{"description":"CLD-E430: one request a minute; `Retry-After` says when","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E430: one request a minute; `Retry-After` says when"}}}}}}},"/v1/orgs/{org}/desk/home/proposals/{id}":{"get":{"summary":"One of your Home proposals, with its definition and the diff to preview","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dhp_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"trigger":{"type":"string","enum":["activation_ready","capability_paused","plan_ended","usage_shift","periodic","requested"]},"status":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"base_view_id":{"type":["string","null"]},"base_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"null"}]},"diff":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","move","resize"]},"card_id":{"type":"string"},"from":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string","enum":["new_product","waiting_items","often_opened","rarely_opened","product_paused","plan_ended","space","pinned_kept"]}},"required":["op","card_id","from","to","reason"],"additionalProperties":false}},{"type":"null"}]},"model":{"anyOf":[{"type":"object","properties":{"scorer":{"type":"string","enum":["prior","jev-openrouter","inhouse"]},"model":{"type":"string"},"provider":{"type":"string"},"features_version":{"type":"string"},"planner_version":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"latencies_ms":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["scorer","model","provider","features_version","planner_version","fallback","fallback_reason","requests","cached","input_tokens","cost_usd_micros","latencies_ms"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"ready_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"result_view_id":{"type":["string","null"]},"result_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","org_id","entity_id","trigger","status","base_view_id","base_revision","definition","diff","model","created_at","ready_at","expires_at","decided_at","result_view_id","result_revision"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/home/proposals/{id}/accept":{"post":{"summary":"Accept a proposal as a new revision of your own Home view (or a new personal view titled Home when you were on the default)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_revision":{"anyOf":[{"type":"integer","minimum":1,"maximum":2147483646},{"type":"null"}]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dhp_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"trigger":{"type":"string","enum":["activation_ready","capability_paused","plan_ended","usage_shift","periodic","requested"]},"status":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"base_view_id":{"type":["string","null"]},"base_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"null"}]},"diff":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","move","resize"]},"card_id":{"type":"string"},"from":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string","enum":["new_product","waiting_items","often_opened","rarely_opened","product_paused","plan_ended","space","pinned_kept"]}},"required":["op","card_id","from","to","reason"],"additionalProperties":false}},{"type":"null"}]},"model":{"anyOf":[{"type":"object","properties":{"scorer":{"type":"string","enum":["prior","jev-openrouter","inhouse"]},"model":{"type":"string"},"provider":{"type":"string"},"features_version":{"type":"string"},"planner_version":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"latencies_ms":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["scorer","model","provider","features_version","planner_version","fallback","fallback_reason","requests","cached","input_tokens","cost_usd_micros","latencies_ms"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"ready_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"result_view_id":{"type":["string","null"]},"result_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","org_id","entity_id","trigger","status","base_view_id","base_revision","definition","diff","model","created_at","ready_at","expires_at","decided_at","result_view_id","result_revision"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the proposal is not open, or your view moved since it was planned","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the proposal is not open, or your view moved since it was planned"}}}}}}},"/v1/orgs/{org}/desk/home/proposals/{id}/dismiss":{"post":{"summary":"Keep your Home as it is; with `remember`, the cards this proposal would have added are never suggested again","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"remember":{"default":false,"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dhp_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"trigger":{"type":"string","enum":["activation_ready","capability_paused","plan_ended","usage_shift","periodic","requested"]},"status":{"type":"string","enum":["pending","open","accepted","applied","dismissed","superseded","expired"]},"base_view_id":{"type":["string","null"]},"base_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"null"}]},"diff":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","move","resize"]},"card_id":{"type":"string"},"from":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"to":{"anyOf":[{"type":"object","properties":{"zone":{"type":"string","enum":["pulse","main","side","products"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size":{"type":"string","enum":["s","m","l"]}},"required":["zone","index","size"],"additionalProperties":false},{"type":"null"}]},"reason":{"type":"string","enum":["new_product","waiting_items","often_opened","rarely_opened","product_paused","plan_ended","space","pinned_kept"]}},"required":["op","card_id","from","to","reason"],"additionalProperties":false}},{"type":"null"}]},"model":{"anyOf":[{"type":"object","properties":{"scorer":{"type":"string","enum":["prior","jev-openrouter","inhouse"]},"model":{"type":"string"},"provider":{"type":"string"},"features_version":{"type":"string"},"planner_version":{"type":"string"},"fallback":{"type":"boolean"},"fallback_reason":{"type":["string","null"]},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"latencies_ms":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["scorer","model","provider","features_version","planner_version","fallback","fallback_reason","requests","cached","input_tokens","cost_usd_micros","latencies_ms"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"ready_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"result_view_id":{"type":["string","null"]},"result_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","org_id","entity_id","trigger","status","base_view_id","base_revision","definition","diff","model","created_at","ready_at","expires_at","decided_at","result_view_id","result_revision"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the proposal is not open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the proposal is not open"}}}}}}},"/v1/orgs/{org}/desk/home/exclusions":{"get":{"summary":"Cards a proposal will not suggest to you: removed from your view, or declined","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"card_id":{"type":"string"},"reason":{"type":"string","enum":["dismissed","removed"]},"until":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["card_id","reason","until","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/home/exclusions/{card}":{"delete":{"summary":"Forget an exclusion: the card may be suggested again","tags":["desk"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"card","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/v1/orgs/{org}/desk/views/{view}/revisions":{"get":{"summary":"Every definition this view has held, newest first: what Restore brings back","tags":["desk"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"view","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"view_id":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]}},"required":["id","component","query","params","capability","size"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false},{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"title":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"object","properties":{"binding":{"type":"string","enum":["current-entity","fixed-entity"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["binding"],"additionalProperties":false},"cards":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z][a-z0-9_-]*)*$"},"component":{"type":"string","enum":["metric","queue","checklist","breakdown","shortcut","pulse","trend","stage_track","flow","product","ask"]},"query":{"type":"object","properties":{"ref":{"type":"string","enum":["approvals.waiting","jobs.recent","jobs.by_status","setup.pending","spend.by_currency","navigation.entry","attention.items","jobs.active","jobs.completed.trend","jobs.by_stage","wallet.balance","spend.trend","plans.ending","capability.summary","ask.suggestions"]},"version":{"type":"integer","minimum":1,"maximum":1000}},"required":["ref","version"],"additionalProperties":false},"params":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"integer","minimum":-1000000,"maximum":1000000},{"maxItems":12,"type":"array","items":{"type":"string","maxLength":40}}]}},"capability":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9_-]*(\\.[a-z0-9_-]+)*$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":60},"size":{"default":"m","type":"string","enum":["s","m","l"]},"zone":{"type":"string","enum":["pulse","main","side","products"]},"pinned":{"default":false,"type":"boolean"}},"required":["id","component","query","params","capability","size","zone","pinned"],"additionalProperties":false}},"density":{"default":"comfortable","type":"string","enum":["comfortable","compact"]}},"required":["schema_version","title","scope","cards","density"],"additionalProperties":false}]},"saved_by":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string"}},"required":["view_id","revision","definition","saved_by","source","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/desk/views/{view}/restore":{"post":{"summary":"Write an earlier revision back as a new one: Undo for an accepted or automatically applied proposal","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"integer","minimum":1,"maximum":2147483646},"expected_revision":{"type":"integer","minimum":1,"maximum":2147483646}},"required":["revision","expected_revision"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^dvw_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"view","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"audience":{"type":"string","enum":["personal","org"]},"title":{"type":"string"},"schema_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"compatible":{"type":"boolean"},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","audience","title","schema_version","compatible","definition","revision","created_at","updated_at"],"additionalProperties":false}}}},"409":{"description":"CLD-E409: the view changed since `expected_revision` was read","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{},"request_id":{"type":"string"}},"required":["code","message"],"additionalProperties":false,"description":"CLD-E409: the view changed since `expected_revision` was read"}}}}}}},"/v1/admin/orgs/{org}/desk-home":{"put":{"summary":"Set an organisation's adaptive-Home mode: off (default), prior or model (the founder or a catalogue administrator)","tags":["desk"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["off","prior","model"]}},"required":["mode"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"x-internal":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"mode":{"type":"string","enum":["off","prior","model"]}},"required":["org_id","mode"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/gst/portfolio":{"get":{"summary":"The GST filing portfolio across clients for a period: who runs GST, their jobs, the due dates","tags":["desk"],"description":"Control-plane facts only. The filing stages and the GSTINs under each business are the cell's records and are read at the Gateway each client row names, with the cell token (ADR 0005).","parameters":[{"schema":{"type":"string","pattern":"^(20\\d{2})-(0[1-9]|1[0-2])$"},"in":"query","name":"period","required":false},{"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"in":"query","name":"today","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"period":{"type":"string"},"today":{"type":"string"},"due":{"type":"array","items":{"type":"object","properties":{"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A"]},"due_on":{"type":"string"},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["form","due_on","days_left"],"additionalProperties":false}},"next_due":{"type":"object","properties":{"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A"]},"due_on":{"type":"string"},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["form","due_on","days_left"],"additionalProperties":false},"clients":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]},"deployments":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"pack_version":{"type":"string"},"status":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"cell_id":{"type":"string"},"memory_id":{"type":"string"}},"required":["deployment_id","pack_name","pack_version","status","domains","cell_id","memory_id"],"additionalProperties":false}},"jobs":{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false},"filer":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly"]},"regime":{"type":"string","enum":["regular","composition"]},"state_code":{"type":"string"}},"required":["frequency","regime","state_code"],"additionalProperties":false},{"type":"null"}]},"due":{"type":"array","items":{"type":"object","properties":{"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A","PMT06","IFF"]},"due_on":{"type":"string"},"days_left":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"optional":{"type":"boolean","enum":[true]}},"required":["form","due_on","days_left"],"additionalProperties":false}},"modelled":{"type":"boolean"},"stages":{"type":"null"}},"required":["entity_id","label","kind","deployments","jobs","filer","due","modelled","stages"],"additionalProperties":false}},"counts":{"type":"object","properties":{"clients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deployments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobs":{"type":"object","properties":{"waiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_you":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stopped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["waiting","working","needs_you","done","stopped"],"additionalProperties":false}},"required":["clients","deployments","jobs"],"additionalProperties":false}},"required":["org_id","period","today","due","next_due","clients","counts"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/people":{"get":{"summary":"People & access: every member with their role, business assignments and teams; every business's members; the teams and the review routes","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","approver","operator","viewer"]},"source":{"type":"string","enum":["direct","group"]},"status":{"type":"string","enum":["active","suspended","deleted"]},"joined_at":{"type":"string"},"last_login_at":{"type":["string","null"]},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"teams":{"type":"array","items":{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false}}},"required":["account_id","email","display_name","role","source","status","joined_at","last_login_at","businesses","teams"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"teams":{"type":"array","items":{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false}}},"required":["entity_id","label","kind","member_count","teams"],"additionalProperties":false}},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string"}},"required":["account_id","email","display_name","role"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","members","businesses","version","created_at","updated_at"],"additionalProperties":false}},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"ask_kind":{"type":"string","enum":["approval","sign","review","any"]},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"team":{"anyOf":[{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false},{"type":"null"}]},"person":{"anyOf":[{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["account_id","email","display_name"],"additionalProperties":false},{"type":"null"}]}},"required":["position","team","person"],"additionalProperties":false}},"escalate_after_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","ask_kind","steps","escalate_after_sec","version","created_at","updated_at"],"additionalProperties":false}},"counts":{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_role":{"type":"object","properties":{"owner":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"admin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approver":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"operator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"viewer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["owner","admin","approver","operator","viewer"],"additionalProperties":false},"not_signed_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"businesses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"teams":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"routes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["members","by_role","not_signed_in","businesses","teams","routes"],"additionalProperties":false}},"required":["org_id","members","businesses","teams","routes","counts"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/teams":{"get":{"summary":"The organisation's teams, each with its members and the businesses it grants","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string"}},"required":["account_id","email","display_name","role"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","members","businesses","version","created_at","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Create a team: a name, its members and the businesses it grants them","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"member_account_ids":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","pattern":"^acc_[0-9A-HJKMNP-TV-Z]{26}$"}},"entity_ids":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}}},"required":["name"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string"}},"required":["account_id","email","display_name","role"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","members","businesses","version","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/teams/{team}":{"get":{"summary":"Read one team","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"team","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string"}},"required":["account_id","email","display_name","role"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","members","businesses","version","created_at","updated_at"],"additionalProperties":false}}}}}},"put":{"summary":"Change a team's name, members or businesses, at the version you read","tags":["tenancy"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"member_account_ids":{"maxItems":500,"type":"array","items":{"type":"string","pattern":"^acc_[0-9A-HJKMNP-TV-Z]{26}$"}},"entity_ids":{"maxItems":500,"type":"array","items":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"}},"expected_version":{"type":"integer","minimum":1,"maximum":2147483646}},"required":["expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"team","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]},"role":{"type":"string"}},"required":["account_id","email","display_name","role"],"additionalProperties":false}},"businesses":{"type":"array","items":{"type":"object","properties":{"entity_id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]}},"required":["entity_id","label","kind"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","members","businesses","version","created_at","updated_at"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a team; its business grants and the route steps that named it go with it","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"team","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/review-routes":{"get":{"summary":"Every business's review routes: whom a parked ask is shown and told first, in order","tags":["tenancy"],"parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"ask_kind":{"type":"string","enum":["approval","sign","review","any"]},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"team":{"anyOf":[{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false},{"type":"null"}]},"person":{"anyOf":[{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["account_id","email","display_name"],"additionalProperties":false},{"type":"null"}]}},"required":["position","team","person"],"additionalProperties":false}},"escalate_after_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","ask_kind","steps","escalate_after_sec","version","created_at","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"put":{"summary":"Set a business's route for one ask kind — the ordered teams and people — at the version you read (0 to create)","tags":["tenancy"],"description":"Routing orders; it never hides an ask from anybody the permission table lets answer it, and it never binds. A `sign` route may name only the business's signatory (ADR 0063).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"ask_kind":{"type":"string","enum":["approval","sign","review","any"]},"steps":{"maxItems":20,"type":"array","items":{"anyOf":[{"type":"object","properties":{"team_id":{"type":"string","pattern":"^team_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["team_id"],"additionalProperties":false},{"type":"object","properties":{"account_id":{"type":"string","pattern":"^acc_[0-9A-HJKMNP-TV-Z]{26}$"}},"required":["account_id"],"additionalProperties":false}]}},"escalate_after_sec":{"default":null,"anyOf":[{"type":"integer","minimum":60,"maximum":604800},{"type":"null"}]},"expected_version":{"type":"integer","minimum":0,"maximum":2147483646}},"required":["entity_id","ask_kind","steps","expected_version"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"ask_kind":{"type":"string","enum":["approval","sign","review","any"]},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"team":{"anyOf":[{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false},{"type":"null"}]},"person":{"anyOf":[{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["account_id","email","display_name"],"additionalProperties":false},{"type":"null"}]}},"required":["position","team","person"],"additionalProperties":false}},"escalate_after_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","ask_kind","steps","escalate_after_sec","version","created_at","updated_at"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"ask_kind":{"type":"string","enum":["approval","sign","review","any"]},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":1,"maximum":9007199254740991},"team":{"anyOf":[{"type":"object","properties":{"team_id":{"type":"string"},"name":{"type":"string"}},"required":["team_id","name"],"additionalProperties":false},{"type":"null"}]},"person":{"anyOf":[{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":["string","null"]}},"required":["account_id","email","display_name"],"additionalProperties":false},{"type":"null"}]}},"required":["position","team","person"],"additionalProperties":false}},"escalate_after_sec":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","ask_kind","steps","escalate_after_sec","version","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/review-routes/{route}":{"delete":{"summary":"Clear a business's route for one ask kind; its asks are shown and told as before routing","tags":["tenancy"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^rrt_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"route","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entities/{entity}/sources":{"get":{"summary":"What feeds one business — its connections, uploads and jobs by door — and a by-month timeline of arrivals and quiet days","tags":["desk"],"parameters":[{"schema":{"default":6,"type":"integer","minimum":1,"maximum":12},"in":"query","name":"months","required":false},{"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"in":"query","name":"today","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"entity","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"entity_id":{"type":"string"},"today":{"type":"string"},"months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"display_name":{"type":"string"},"status":{"type":"string"},"last_poll_at":{"type":["string","null"]},"items_seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"used_by":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"required":{"type":"boolean"}},"required":["deployment_id","pack_name","required"],"additionalProperties":false}}},"required":["id","kind","label","display_name","status","last_poll_at","items_seen","used_by"],"additionalProperties":false}},"missing_connections":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"required":{"type":"boolean"}},"required":["label","deployment_id","pack_name","required"],"additionalProperties":false}},"gateway_provided":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"display_name":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"required":{"type":"boolean"}},"required":["label","display_name","deployment_id","pack_name","required"],"additionalProperties":false}},"deployments":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"status":{"type":"string"}},"required":["deployment_id","pack_name","status"],"additionalProperties":false}},"timeline":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"days_in_month":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobs_by_source":{"type":"object","properties":{"api":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"console":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"store":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fork":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rounic":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["api","console","store","trigger","fork","rounic"],"additionalProperties":false},"active_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quiet_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","uploads","jobs"],"additionalProperties":false}}},"required":["month","days_in_month","uploads","jobs","jobs_by_source","active_days","quiet_days","days"],"additionalProperties":false}}},"required":["org_id","entity_id","today","months","connections","missing_connections","gateway_provided","deployments","timeline"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/overview":{"get":{"summary":"An agent's page in one read: the deployment, its settings, learning, versions and credentials","tags":["packs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"paused_reason":{"type":["string","null"]},"principal":{"type":"string"},"release_tuple_sha256":{"type":"string"},"data_domains":{"type":"array","items":{"type":"string"}},"setup_domain":{"type":["string","null"]},"model_route_id":{"type":["string","null"]},"trigger_daily_cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cloned_from":{"type":["string","null"]},"pack":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"pack_version_id":{"type":"string"}},"required":["name","version","pack_version_id"],"additionalProperties":false},"offer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"slug":{"type":["string","null"]},"name":{"type":["string","null"]},"title":{"type":"string"},"price":{"anyOf":[{"type":"object","properties":{"rule_id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"unit":{"type":["string","null"]},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rule_id","kind","amount_cents","currency","label","description","unit","unit_multiple"],"additionalProperties":false},{"type":"null"}]}},"required":["id","sku","slug","name","title","price"],"additionalProperties":false},{"type":"null"}]}},"required":["id","org_id","memory_id","cell_id","entity_id","status","status_reason","paused_reason","principal","release_tuple_sha256","data_domains","setup_domain","model_route_id","trigger_daily_cap","cloned_from","pack","offer"],"additionalProperties":false},"settings":{"type":"object","properties":{"overlay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"overlay_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["overlay","overlay_version","fields"],"additionalProperties":false},"learning":{"type":"object","properties":{"policy":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"loop_paused":{"type":"boolean"},"loop_last_run_at":{"type":["string","null"]},"last_run":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string"},"finished_at":{"type":["string","null"]},"proposed":{"type":"number"},"auto_applied":{"type":"number"},"auto_dismissed":{"type":"number"},"error":{"type":["string","null"]}},"required":["id","started_at","finished_at","proposed","auto_applied","auto_dismissed","error"],"additionalProperties":false},{"type":"null"}]},"lessons":{"type":"object","properties":{"proposed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dismissed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rolled_back":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["proposed","approved","applied","dismissed","rolled_back"],"additionalProperties":false}},"required":["policy","loop_paused","loop_last_run_at","last_run","lessons"],"additionalProperties":false},"versions":{"type":"object","properties":{"current":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"],"additionalProperties":false},"upgrade_policy":{"type":"string"},"waiting":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"to_version":{"type":"string"},"status":{"type":"string"},"class":{"type":"string"}},"required":["id","to_version","status","class"],"additionalProperties":false},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"status":{"type":"string"},"class":{"type":"string"}},"required":["id","from_version","to_version","status","class"],"additionalProperties":false}}},"required":["current","upgrade_policy","waiting","history"],"additionalProperties":false},"connections":{"type":"object","properties":{"required":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"kind":{"type":["string","null"]}},"required":["label","kind"],"additionalProperties":false}},"optional":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"kind":{"type":["string","null"]}},"required":["label","kind"],"additionalProperties":false}}},"required":["required","optional"],"additionalProperties":false},"setup_sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"connectors":{"type":"array","items":{"type":"string"}}},"required":["id","kind","connectors"],"additionalProperties":false}},"credentials":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"staged":{"type":"boolean"},"placed_cells":{"type":"array","items":{"type":"string"}},"staged_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]}},"required":["label","staged","placed_cells","staged_at","updated_at"],"additionalProperties":false}}},"required":["deployment","settings","learning","versions","connections","setup_sections","credentials"],"additionalProperties":false}}}}}}},"/v1/record-types":{"get":{"summary":"List published record types, newest version per id, page by page","tags":["record-types"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"org","required":false},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}$"},"in":"query","name":"ns","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","enum":["published","deprecated"]},"in":"query","name":"status","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"version_id":{"type":"string","pattern":"^rtv_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["draft","published","deprecated"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner_pack_id":{"type":["string","null"]},"sunset_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"unit":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"currency_column":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"identifier_kind":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"provenance_required":{"type":"boolean"},"deprecated_since":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d+$"},{"type":"null"}]}},"required":["path","type","unit","currency_column","identifier_kind","provenance_required","deprecated_since"],"additionalProperties":false}}},"required":["id","major","minor","version_id","status","sha256","owner_pack_id","sunset_at","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Publish a record-type version (the platform's catalogue); immutable once published","tags":["record-types"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":999999},"minor":{"type":"integer","minimum":0,"maximum":999999},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"owner_pack_id":{"type":"string","minLength":1,"maxLength":100}},"required":["id","major","minor","json_schema"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"version_id":{"type":"string","pattern":"^rtv_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["draft","published","deprecated"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner_pack_id":{"type":["string","null"]},"sunset_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"unit":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"currency_column":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"identifier_kind":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"provenance_required":{"type":"boolean"},"deprecated_since":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d+$"},{"type":"null"}]}},"required":["path","type","unit","currency_column","identifier_kind","provenance_required","deprecated_since"],"additionalProperties":false}}},"required":["id","major","minor","version_id","status","sha256","owner_pack_id","sunset_at","created_at","updated_at"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"version_id":{"type":"string","pattern":"^rtv_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["draft","published","deprecated"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner_pack_id":{"type":["string","null"]},"sunset_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"unit":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"currency_column":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"identifier_kind":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"provenance_required":{"type":"boolean"},"deprecated_since":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d+$"},{"type":"null"}]}},"required":["path","type","unit","currency_column","identifier_kind","provenance_required","deprecated_since"],"additionalProperties":false}}},"required":["id","major","minor","version_id","status","sha256","owner_pack_id","sunset_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/record-types/{id}/versions/{v}":{"get":{"summary":"Read one record-type version: its schema and its fields","tags":["record-types"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"org","required":false},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","pattern":"^\\d{1,6}\\.\\d{1,6}$"},"in":"path","name":"v","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"version_id":{"type":"string","pattern":"^rtv_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["draft","published","deprecated"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner_pack_id":{"type":["string","null"]},"sunset_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"unit":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"currency_column":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"identifier_kind":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"provenance_required":{"type":"boolean"},"deprecated_since":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d+$"},{"type":"null"}]}},"required":["path","type","unit","currency_column","identifier_kind","provenance_required","deprecated_since"],"additionalProperties":false}},"extensions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^rte_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"record_type_id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"path":{"type":"string","pattern":"^x_[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"added_by":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","record_type_id","path","type","json_schema","added_by","version","created_at","updated_at"],"additionalProperties":false}}},"required":["id","major","minor","version_id","status","sha256","owner_pack_id","sunset_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/record-types/{id}/deprecate":{"post":{"summary":"Deprecate a published record-type version, with an optional sunset","tags":["record-types"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"sunset_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["major","minor","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"version_id":{"type":"string","pattern":"^rtv_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["draft","published","deprecated"]},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner_pack_id":{"type":["string","null"]},"sunset_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"unit":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"currency_column":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"identifier_kind":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"provenance_required":{"type":"boolean"},"deprecated_since":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d+$"},{"type":"null"}]}},"required":["path","type","unit","currency_column","identifier_kind","provenance_required","deprecated_since"],"additionalProperties":false}}},"required":["id","major","minor","version_id","status","sha256","owner_pack_id","sunset_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/packs/{version}/record-types":{"get":{"summary":"The record types a pack version produces, consumes and extends (its dependency edge)","tags":["record-types"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"org","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"version","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"record_type_id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"major":{"type":"integer","minimum":0,"maximum":9007199254740991},"role":{"type":"string","enum":["produces","consumes","extends"]},"required":{"type":"boolean"},"version_range":{"type":["string","null"]},"minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["record_type_id","major","role","required","version_range","minor"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/record-type-extensions":{"get":{"summary":"An organisation's own x_ fields on shared record types, page by page","tags":["record-types"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"in":"query","name":"record_type","required":false},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^rte_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"record_type_id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"path":{"type":"string","pattern":"^x_[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"added_by":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","record_type_id","path","type","json_schema","added_by","version","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}},"post":{"summary":"Declare an organisation's own x_ field on a shared record type","tags":["record-types"],"description":"Organisation-wide, or for one entity with `entity_id`. The shared type never changes and no value passes through here: the field's values are grains in the cell. An identical declaration answers 200 with the same id; a changed schema is a new `version` (201). There is no DELETE: retiring an extension waits for a consumer that needs it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record_type":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"path":{"type":"string","pattern":"^x_[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["record_type","path","type","json_schema"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^rte_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"record_type_id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"path":{"type":"string","pattern":"^x_[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"added_by":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","record_type_id","path","type","json_schema","added_by","version","created_at","updated_at"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^rte_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"record_type_id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"path":{"type":"string","pattern":"^x_[a-z][a-z0-9_]{0,62}$"},"type":{"type":"string","enum":["string","integer","number","boolean","date","datetime","money","object","array"]},"json_schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"added_by":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","record_type_id","path","type","json_schema","added_by","version","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/demand":{"get":{"summary":"What is waiting for this cell and what it is running (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"at":{"type":"string"},"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"running":{"type":"integer","minimum":0,"maximum":9007199254740991},"parked":{"type":"integer","minimum":0,"maximum":9007199254740991},"installs_pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"provisions_pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"demand":{"type":"integer","minimum":0,"maximum":9007199254740991},"questions":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"running":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["queued","running"],"additionalProperties":false}},"required":["cell_id","at","queued","running","parked","installs_pending","provisions_pending","demand","questions"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/plan":{"get":{"summary":"Desired state for a cell (cell-authenticated)","tags":["cells"],"description":"With `wait` (1 to 25 seconds), a plan that carries no work is held until work arrives for this cell — a queued job a lane with slots would claim, an answered ask, a memory or a deployment in transition — and then built again and returned, or returned as it was at the deadline (ADR 0116). Without it, at once.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":25},"in":"query","name":"wait","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"issued_at":{"type":"string"},"core_version":{"type":"string"},"residency":{"type":"object","properties":{"id":{"type":"string"},"residency":{"type":"string"},"mode":{"type":"string"},"model_routes_allowed":{"type":"array","items":{"type":"string"}},"egress_floor_required":{"type":"boolean"},"allowed_regions":{"type":"array","items":{"type":"string"}},"decision_chain":{"type":"string","enum":["on","off"]}},"required":["id","residency","mode","model_routes_allowed","egress_floor_required","allowed_regions","decision_chain"],"additionalProperties":false},"memories":{"type":"array","items":{"type":"object","properties":{"memory_id":{"type":"string"},"schema_name":{"type":"string"},"org_id":{"type":"string"},"status":{"type":"string"},"rw_role":{"type":"string"},"ro_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"ro_secret_ref":{"default":"","type":"string"},"anon_key_ref":{"default":"","type":"string"},"namespace":{"type":"string"},"isolation_probe_schema":{"type":["string","null"]},"archive_key":{"default":null,"type":["string","null"]},"archive_sha256":{"default":null,"type":["string","null"]}},"required":["memory_id","schema_name","org_id","status","rw_role","ro_role","rw_secret_ref","ro_secret_ref","anon_key_ref","namespace","isolation_probe_schema","archive_key","archive_sha256"],"additionalProperties":false}},"deployments":{"type":"array","items":{}},"trigger_deployments":{"type":"array","items":{}},"jobs":{"type":"array","items":{}},"approvals":{"type":"array","items":{}},"erasures":{"type":"array","items":{}},"checks":{"default":[],"type":"array","items":{"type":"string"}},"upgrades":{"default":[],"type":"array","items":{}},"moves":{"default":[],"type":"array","items":{}},"exports":{"default":[],"type":"array","items":{}},"imports":{"default":[],"type":"array","items":{}},"overlay_changes":{"default":[],"type":"array","items":{}},"corrections":{"default":[],"type":"array","items":{}},"recommendations":{"default":[],"type":"array","items":{}},"credentials":{"default":[],"type":"array","items":{}},"revocations":{"default":[],"type":"array","items":{}},"retention":{"default":[],"type":"array","items":{}},"upload_retention":{"default":[],"type":"array","items":{}},"loops":{"default":[],"type":"array","items":{}},"evaluations":{"default":[],"type":"array","items":{}},"golden_exports":{"default":[],"type":"array","items":{}},"kill":{"type":"object","properties":{"paused_deployments":{"type":"array","items":{"type":"string"}},"frozen_orgs":{"type":"array","items":{"type":"string"}},"draining":{"type":"boolean"}},"required":["paused_deployments","frozen_orgs","draining"],"additionalProperties":false},"token_rotation":{"default":null,"anyOf":[{"type":"object","properties":{"requested_at":{"type":"string"},"overlap_sec":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["requested_at","overlap_sec"],"additionalProperties":false},{"type":"null"}]}},"required":["cell_id","issued_at","core_version","residency","memories","deployments","trigger_deployments","jobs","approvals","erasures","checks","upgrades","moves","exports","imports","overlay_changes","corrections","recommendations","credentials","revocations","retention","upload_retention","loops","evaluations","golden_exports","kill","token_rotation"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/questions":{"get":{"summary":"Claim the Areev questions waiting for this cell, and nothing else (cell-authenticated)","tags":["cells"],"description":"The `question` lane of the plan alone, under `x-areev-ask-slots`: each item as the plan's `jobs[]` carries it, with the asker's credential minted at the claim. With `wait` (1 to 25 seconds), held until a question is queued. A worker polls it while its tick runs a product job, so a person's question never waits for a long run.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":25},"in":"query","name":"wait","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"residency":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"jobs":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["cell_id","residency","jobs"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/packs/{version}/archive":{"get":{"summary":"The published pack archive, for a cell to install from (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"version","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pack_version_id":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"content_base64":{"type":"string"},"sha256":{"type":"string"}},"required":["path","content_base64","sha256"],"additionalProperties":false}}},"required":["pack_version_id","files"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/report":{"post":{"summary":"A cell reports the outcome of provisioning one memory","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["active"]},"rwRole":{"type":"string"},"roRole":{"type":"string"},"rwSecretRef":{"type":"string"},"roSecretRef":{"type":"string"},"anonKeyRef":{"type":"string"},"coreVersion":{"type":"string"},"warnings":{}},"required":["status","rwRole","roRole","rwSecretRef","roSecretRef","anonKeyRef","coreVersion"]},{"type":"object","properties":{"status":{"type":"string","enum":["erased"]},"counts":{},"credentialsDropped":{"type":"integer","minimum":0,"maximum":9007199254740991},"secretsRemoved":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status","counts","credentialsDropped","secretsRemoved"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","maxLength":500}},"required":["status","reason"]},{"type":"object","properties":{"status":{"type":"string","enum":["archived"]},"object_key":{"type":"string","minLength":1,"maxLength":512},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"counts":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"credentialsDropped":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status","object_key","sha256","bytes"]},{"type":"object","properties":{"status":{"type":"string","enum":["archive_failed"]},"reason":{"type":"string","minLength":1,"maxLength":500},"bundle":{"type":"object","properties":{"object_key":{"type":"string","minLength":1,"maxLength":512},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["object_key","sha256"]}},"required":["status","reason"]},{"type":"object","properties":{"status":{"type":"string","enum":["restored"]},"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"verify":{"type":"string","maxLength":500},"counts":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["status","applied","verify"]},{"type":"object","properties":{"status":{"type":"string","enum":["restore_failed"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"memory","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/exports/{id}/report":{"post":{"summary":"A cell reports one memory export (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["ready"]},"object_key":{"type":"string","minLength":1,"maxLength":512},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"counts":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["status","object_key","sha256","bytes"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"},"receipt_id":{"type":["string","null"]}},"required":["recorded","status","receipt_id"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/credentials/{id}/report":{"post":{"summary":"A cell reports one memory credential: minted, failed, delivered or dropped (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["minted"]},"role":{"type":"string","minLength":1,"maxLength":63},"secret_ref":{"type":"string","minLength":1,"maxLength":500}},"required":["status","role","secret_ref"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["status","reason"]},{"type":"object","properties":{"status":{"type":"string","enum":["delivered"]},"delivered_to":{"type":"string","minLength":1,"maxLength":200}},"required":["status","delivered_to"]},{"type":"object","properties":{"status":{"type":"string","enum":["dropped"]}},"required":["status"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"}},"required":["recorded","status"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/exports/{id}":{"get":{"summary":"One memory export on this cell, for its Gateway (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"status":{"type":"string"},"object_key":{"type":["string","null"]},"sha256":{"type":["string","null"]},"expires_at":{"type":["string","null"]}},"required":["id","org_id","memory_id","status","object_key","sha256","expires_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/golden-candidates/{id}":{"get":{"summary":"One golden candidate on this cell, for its Gateway (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"pack_name":{"type":"string"},"status":{"type":"string"},"export_key":{"type":["string","null"]},"export_sha256":{"type":["string","null"]}},"required":["id","org_id","pack_name","status","export_key","export_sha256"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/imports/{id}":{"get":{"summary":"One memory import on this cell, for its Gateway (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"status":{"type":"string"},"bundle_key":{"type":"string"},"sha256":{"type":"string"}},"required":["id","org_id","memory_id","status","bundle_key","sha256"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/archive":{"get":{"summary":"One memory's archive bundle on this cell, for its Gateway (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"memory","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"memory_id":{"type":"string"},"org_id":{"type":"string"},"status":{"type":"string"},"object_key":{"type":["string","null"]},"sha256":{"type":["string","null"]}},"required":["memory_id","org_id","status","object_key","sha256"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/imports/{id}/report":{"post":{"summary":"A cell reports one memory import (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["imported"]},"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"verify":{"type":"string","maxLength":500},"counts":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["status","applied","verify"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"}},"required":["recorded","status"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/retention/{run}/uploads":{"get":{"summary":"The uploads one upload-retention run may delete now (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"run","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"},"uploads":{"type":"array","items":{"type":"object","properties":{"upload_id":{"type":"string","minLength":1,"maxLength":100},"object_key":{"type":"string","maxLength":1024,"pattern":"^orgs\\/[A-Za-z0-9_-]+\\/uploads\\/(?!(?:.*\\/)?\\.\\.(?:\\/|$)).+$"}},"required":["upload_id","object_key"],"additionalProperties":false}}},"required":["run_id","uploads"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/retention/{run}/report":{"post":{"summary":"A cell reports one retention pass over one memory (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["applied","skipped","failed"]},"cutoff":{"default":null,"type":["string","null"]},"counts_before":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"counts_after":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"reason":{"type":"string","maxLength":500},"uploads_swept":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["status"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"run","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"},"receipt_id":{"type":["string","null"]}},"required":["recorded","status","receipt_id"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/erasures/{request}/report":{"post":{"summary":"A cell reports a subject report or a subject erasure (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["reported"]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["status","counts"]},{"type":"object","properties":{"status":{"type":"string","enum":["erased"]},"ok":{"type":"boolean"},"countsBefore":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"countsAfter":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"verified":{"type":"boolean"},"objectsRemoved":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"reason":{"type":"string","maxLength":500}},"required":["status","ok","countsBefore","countsAfter","verified"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"request","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"stage":{"type":"string"},"report_sha256":{"type":["string","null"]},"receipt_id":{"type":["string","null"]}},"required":["recorded","stage","report_sha256","receipt_id"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/report":{"post":{"summary":"A cell reports health, liveness and job transitions (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"health":{"type":"object","properties":{"core_version":{"type":"string"},"worker_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"queue_depth":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"pg_connections":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warnings":{"default":[],"type":"array","items":{"type":"string"}}},"required":["core_version","worker_count"]},"jobs_held":{"default":[],"type":"array","items":{"type":"string"}},"jobs_started":{"default":[],"type":"array","items":{"type":"string"}},"runs_started":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string","maxLength":100},"run_id":{"type":"string","maxLength":200}},"required":["job_id","run_id"]}},"jobs_released":{"default":[],"type":"array","items":{"type":"string"}},"checks":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["isolation_probe","restore_drill","egress_floor","upload_scanner"]},"ok":{"type":"boolean"},"detail":{"type":"string","maxLength":500},"at":{"type":"string"}},"required":["name","ok","detail","at"]}},"job_transitions":{"default":[],"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"state":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"at":{"type":"string"},"attempt":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"run_ids":{"default":[],"type":"array","items":{"type":"string"}},"quality":{"default":null,"anyOf":[{"type":"object","properties":{"verdict":{"type":"string","enum":["PASS","RETRY","ABSTAIN","FAIL"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["verdict","reasons"]},{"type":"null"}]},"evidence_key":{"default":null,"type":["string","null"]},"evidence_sha256":{"default":null,"type":["string","null"]},"cost":{"default":null,"anyOf":[{"type":"object","properties":{"usd_micros":{"type":"integer","minimum":0,"maximum":9007199254740991},"tokens_in":{"type":"integer","minimum":0,"maximum":9007199254740991},"tokens_out":{"type":"integer","minimum":0,"maximum":9007199254740991},"tool_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"cpu_ms":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"infra_usd_micros":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":0,"maximum":9007199254740991},"model_calls":{"type":"integer","minimum":0,"maximum":9007199254740991},"cached_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"model_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"cost_wait_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["usd_micros","tokens_in","tokens_out","tool_calls","wall_ms"]},{"type":"null"}]},"error_code":{"default":null,"type":["string","null"]},"reason":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"ask":{"default":null,"anyOf":[{"type":"object","properties":{"tool_call_id":{"type":"string"},"run_id":{"type":"string"},"summary":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["tool_call_id","run_id"]},{"type":"null"}]},"finding":{"default":null,"anyOf":[{"type":"object","properties":{"verdict_code":{"type":"string","minLength":1,"maxLength":64},"recommendation":{"type":"string","enum":["credit","partial","uphold"]},"recommended_cents":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"confidence":{"type":"number","minimum":0,"maximum":1},"checks":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"ok":{"type":"boolean"}},"required":["label","ok"]}}},"required":["verdict_code","recommendation","confidence","checks"]},{"type":"null"}]},"usage":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unit","quantity"],"additionalProperties":false}}},"required":["job_id","state","at"]}},"asks":{"default":[],"type":"array","items":{"type":"object","properties":{"approval_id":{"type":"string"},"job_id":{"type":"string"},"run_id":{"type":"string"},"tool_call_id":{"type":"string"},"summary":{"type":"string"},"asked_at":{"type":"string"},"ttl_sec":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"initiator":{"type":"string"}},"required":["approval_id","job_id","run_id","tool_call_id","summary","asked_at","ttl_sec","initiator"]}},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"org_id":{"type":"string"},"metric":{"type":"string"},"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"day":{"type":"string"}},"required":["org_id","metric","value","day"]}},"namespaces_seen":{"default":[],"type":"array","items":{"type":"object","properties":{"memory_id":{"type":"string"},"namespaces":{"type":"array","items":{"type":"string"}}},"required":["memory_id","namespaces"]}},"corrections_applied":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"correction_id":{"type":"string","maxLength":100},"applied_at":{"type":"string","maxLength":40},"grain_hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["correction_id","applied_at","grain_hash"],"additionalProperties":false}},"corrections_failed":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"correction_id":{"type":"string","maxLength":100},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["correction_id","reason"],"additionalProperties":false}},"recommendations_decided":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string","maxLength":100},"hash":{"type":"string","maxLength":200},"status":{"type":"string","enum":["applied","dismissed","rolled_back"]},"at":{"type":"string","maxLength":40}},"required":["deployment_id","hash","status","at"],"additionalProperties":false}},"recommendations_failed":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string","maxLength":100},"hash":{"type":"string","maxLength":200},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["deployment_id","hash","reason"],"additionalProperties":false}},"loop_runs":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"loop_run_id":{"type":"string","maxLength":100},"deployment_id":{"type":"string","maxLength":100},"proposed":{"type":"integer","minimum":0,"maximum":9007199254740991},"auto_applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"auto_dismissed":{"type":"integer","minimum":0,"maximum":9007199254740991},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":60},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"error":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"recommendations":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"hash":{"type":"string","maxLength":200},"kind":{"type":"string","maxLength":40},"surface":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"target":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"summary":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"status":{"type":"string","enum":["open","applied","dismissed"]},"auto_reason":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["hash","kind","surface","target","origin","summary","evidence","status","auto_reason"],"additionalProperties":false}}},"required":["loop_run_id","deployment_id","proposed","auto_applied","auto_dismissed","health"],"additionalProperties":false}},"evaluations":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"evaluation_id":{"type":"string","maxLength":100},"score":{"type":"number","minimum":0,"maximum":1},"labels":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"check":{"type":"string","maxLength":100},"ok":{"type":"boolean"}},"required":["check","ok"],"additionalProperties":false}},"gate_loose":{"type":"boolean"},"usd_micros":{"type":"integer","minimum":0,"maximum":1000000000000}},"required":["evaluation_id","score","labels","gate_loose"],"additionalProperties":false}},"evaluations_failed":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"evaluation_id":{"type":"string","maxLength":100},"reason":{"type":"string","minLength":1,"maxLength":300},"usd_micros":{"type":"integer","minimum":0,"maximum":1000000000000}},"required":["evaluation_id","reason"],"additionalProperties":false}},"golden_exports":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"candidate_id":{"type":"string","maxLength":100},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"cases":{"type":"integer","minimum":0,"maximum":20},"policy":{"type":"string","enum":["declared","floor"]}},"required":["candidate_id","sha256","cases","policy"],"additionalProperties":false}},"golden_exports_failed":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"candidate_id":{"type":"string","maxLength":100},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["candidate_id","reason"],"additionalProperties":false}},"cell_id":{"type":"string"},"reported_at":{"type":"string"}},"required":["health"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"applied":{"type":"array","items":{"type":"string"}},"held":{"type":"array","items":{"type":"string"}},"released":{"default":[],"type":"array","items":{"type":"string"}},"corrections_applied":{"default":[],"type":"array","items":{"type":"string"}},"recommendations_recorded":{"default":[],"type":"array","items":{"type":"string"}},"loop_runs_recorded":{"default":[],"type":"array","items":{"type":"string"}},"evaluations_recorded":{"default":[],"type":"array","items":{"type":"string"}},"golden_exports_recorded":{"default":[],"type":"array","items":{"type":"string"}}},"required":["recorded","applied","held","released","corrections_applied","recommendations_recorded","loop_runs_recorded","evaluations_recorded","golden_exports_recorded"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/agent-cards":{"get":{"summary":"The organisation's agent card on each cell that serves it","tags":["cells"],"description":"One row per cell with an active deployment of this organisation: its residency and the URLs of that cell's organisation-level A2A card, MCP server and A2A endpoint. Each is key-gated at the cell; nothing is proxied. Cursor-paged by cell id.","parameters":[{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"cell_id":{"type":"string"},"residency":{"type":"string"},"card_url":{"type":"string"},"mcp_url":{"type":"string"},"a2a_url":{"type":"string"}},"required":["cell_id","residency","card_url","mcp_url","a2a_url"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/admin/cells":{"get":{"summary":"The cell registry","tags":["cells"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"residency":{"type":"string"},"mode":{"type":"string","enum":["shared","dedicated","byoc","sovereign","onprem"]},"gateway_url":{"type":"string"},"core_version":{"type":"string"},"status":{"type":"string"},"decision_chain":{"type":"string","enum":["on","off"]},"account_ref":{"type":["string","null"]},"org_id":{"type":["string","null"]},"last_heartbeat_at":{"type":["string","null"]},"memory_capacity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"memories":{"type":"integer","minimum":0,"maximum":9007199254740991},"demand":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"running":{"type":"integer","minimum":0,"maximum":9007199254740991},"parked":{"type":"integer","minimum":0,"maximum":9007199254740991},"installs_pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"provisions_pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"demand":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["queued","running","parked","installs_pending","provisions_pending","demand"],"additionalProperties":false}},"required":["id","provider","region","residency","mode","gateway_url","core_version","status","decision_chain","account_ref","last_heartbeat_at","memory_capacity","memories","demand"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Register or update a cell, from infra/cells.yaml","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"residency":{"type":"string","minLength":1},"mode":{"type":"string","enum":["shared","dedicated","byoc","sovereign","onprem"]},"gateway_url":{"type":"string"},"pg_host":{"type":"string"},"pg_port":{"default":5432,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"pg_db":{"type":"string"},"pg_ca_ref":{"default":"","type":"string"},"object_bucket":{"default":"","type":"string"},"secrets_backend":{"default":"vault","type":"string","enum":["vault","gcp-sm","aws-sm","azure-kv","file-sealed"]},"model_routes_allowed":{"default":[],"type":"array","items":{"type":"string"}},"core_version":{"type":"string"},"status":{"default":"active","type":"string","enum":["planned","provisioning","active","draining","retired"]},"decision_chain":{"default":"on","type":"string","enum":["on","off"]},"account_ref":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"org_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"memory_capacity":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","provider","region","residency","mode","gateway_url","pg_host","pg_db","core_version"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/sources":{"get":{"summary":"The live paired sources of a memory on this cell and the newest upload of each collection (cell-authenticated)","tags":["cells"],"description":"Metadata only: ids, states, the paired company's label and, per collection, the newest ready upload's object key, sha256 and window, and with `on` the newest one whose window covers that day. Never a body. A memory on another cell is `CLD-E404`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"memory_id","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"on","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string","enum":["agent","direct","file"]},"status":{"type":"string","enum":["active","paused"]},"subject_label":{"type":"string"},"last_seen_at":{"type":["string","null"]},"latest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"upload_id":{"type":"string"},"object_key":{"type":"string"},"sha256":{"type":"string"},"window_from":{"type":"string"},"window_to":{"type":"string"},"created_at":{"type":"string"}},"required":["upload_id","object_key","sha256","window_from","window_to","created_at"],"additionalProperties":false}},"covering":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"upload_id":{"type":"string"},"object_key":{"type":"string"},"sha256":{"type":"string"},"window_from":{"type":"string"},"window_to":{"type":"string"},"created_at":{"type":"string"}},"required":["upload_id","object_key","sha256","window_from","window_to","created_at"],"additionalProperties":false}},"refresh_requested":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["source_id","kind","reach","status","subject_label","last_seen_at","latest","covering","refresh_requested"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/sources/{id}/refresh":{"post":{"summary":"Ask a paired source to read one collection again now (cell-authenticated)","tags":["cells"],"description":"Sets the collection's `refresh.requested_at` in the source's manifest; the plugin reads it on its next poll. A source whose memory is on another cell is `CLD-E404`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collection_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"}},"required":["collection_id"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requested_at":{"type":"string"}},"required":["requested_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/credentials/{id}":{"get":{"summary":"One memory credential on this cell, for its Gateway's hand-off (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["rw","ro"]},"role":{"type":"string"},"status":{"type":"string"},"secret_ref":{"type":["string","null"]},"anon_key_ref":{"type":["string","null"]},"issued_to":{"type":"string"},"expires_at":{"type":"string"},"revoked":{"type":"boolean"},"dsn_template":{"type":"string"}},"required":["id","memory_id","org_id","kind","role","status","secret_ref","anon_key_ref","issued_to","expires_at","revoked","dsn_template"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/jobs/{job}":{"get":{"summary":"A job this cell runs: organisation, deployment, state, evidence key","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"job","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string"},"evidence_key":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"run_ids":{"type":"array","items":{"type":"string"}},"cell_record_ref":{"type":"object","properties":{"domain":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"record_id":{"type":"string","minLength":1,"maxLength":100},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["domain","record_id","revision","sha256"],"additionalProperties":false},"workflow":{"type":"string","minLength":1},"workflow_base":{"type":"string","minLength":1},"work_contract_id":{"type":"string","minLength":1},"submitted_by":{"type":["string","null"]},"open_ask":{"anyOf":[{"type":"object","properties":{"approval_id":{"type":"string"},"kind":{"type":["string","null"]},"filing_ref":{"type":["string","null"]},"expires_at":{"type":"string"}},"required":["approval_id","kind","filing_ref","expires_at"],"additionalProperties":false},{"type":"null"}]},"signatory_principal":{"type":["string","null"]},"filing":{"anyOf":[{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},{"type":"null"}]},"parent_job_id":{"type":["string","null"]},"lane":{"type":"string","enum":["work","question"]},"question_opener":{"type":["string","null"]}},"required":["id","org_id","deployment_id","status","evidence_key","evidence_sha256","run_ids","submitted_by","open_ask"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/records/{record}/job":{"get":{"summary":"The job a prepared record of this cell was submitted as, if any","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string"},"evidence_key":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"run_ids":{"type":"array","items":{"type":"string"}},"cell_record_ref":{"type":"object","properties":{"domain":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"record_id":{"type":"string","minLength":1,"maxLength":100},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["domain","record_id","revision","sha256"],"additionalProperties":false},"workflow":{"type":"string","minLength":1},"workflow_base":{"type":"string","minLength":1},"work_contract_id":{"type":"string","minLength":1},"submitted_by":{"type":["string","null"]},"open_ask":{"anyOf":[{"type":"object","properties":{"approval_id":{"type":"string"},"kind":{"type":["string","null"]},"filing_ref":{"type":["string","null"]},"expires_at":{"type":"string"}},"required":["approval_id","kind","filing_ref","expires_at"],"additionalProperties":false},{"type":"null"}]},"signatory_principal":{"type":["string","null"]},"filing":{"anyOf":[{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},{"type":"null"}]},"parent_job_id":{"type":["string","null"]},"lane":{"type":"string","enum":["work","question"]},"question_opener":{"type":["string","null"]}},"required":["id","org_id","deployment_id","status","evidence_key","evidence_sha256","run_ids","submitted_by","open_ask"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/surfaces":{"get":{"summary":"The deployments this cell's Gateway serves (cell-authenticated)","tags":["cells"],"description":"Everything needed to generate a deployment's REST surface: its Work Contract, its status and pause reason, its rate limit, and the read-only credential REF for the stream. No secrets, no grains.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"issued_at":{"type":"string"},"residency":{"type":"string"},"core_version":{"type":"string"},"pg":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"database":{"type":"string"}},"required":["host","port","database"],"additionalProperties":false},"kill":{"type":"object","properties":{"paused_deployments":{"type":"array","items":{"type":"string"}},"frozen_orgs":{"type":"array","items":{"type":"string"}},"draining":{"type":"boolean"}},"required":["paused_deployments","frozen_orgs","draining"],"additionalProperties":false},"deployments":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"entity_id":{"type":["string","null"]},"entity_label":{"type":["string","null"]},"brand":{"anyOf":[{"type":"object","properties":{"brand_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"highlight_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"deep_color":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"on_brand":{"type":"string","enum":["white","ink"]}},"required":["brand_color","highlight_color","deep_color","on_brand"],"additionalProperties":false},{"type":"null"}]},"filing":{"anyOf":[{"type":"object","properties":{"signing_method":{"type":"string","enum":["evc","dsc"]},"signatory_pan":{"type":["string","null"]},"signers":{"type":"array","items":{"type":"string"}},"preparer_may_sign":{"type":"boolean"},"owner_approves_filing":{"type":"boolean"},"dsc_registered_at":{"type":["string","null"]}},"required":["signing_method","signatory_pan","signers","preparer_may_sign","owner_approves_filing","dsc_registered_at"],"additionalProperties":false},{"type":"null"}]},"data_domains":{"default":[],"type":"array","items":{"type":"string"}},"setup_domain":{"type":["string","null"]},"overlay":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schema_name":{"type":"string"},"principal":{"type":"string"},"pack_name":{"type":"string"},"pack_version":{"type":"string"},"cell_workflows":{"default":[],"type":"array","items":{"type":"string"}},"status":{"type":"string"},"paused_reason":{"type":["string","null"]},"profile":{"default":"standard","type":"string"},"rate_limit_rpm":{"type":["number","null"]},"ro_role":{"type":"string"},"ro_secret_ref":{"type":"string"},"ops_namespace":{"type":["string","null"]},"cases":{"anyOf":[{"type":"object","properties":{"key_field":{"type":"string"},"intake":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},{"type":"null"}]},"work_contract":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"ui":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"overlay_schema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"a2ui_templates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"messages":{"type":"array","items":{}},"problem":{"type":"string"}},"additionalProperties":false}},"skills":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"protocols":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"queries":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"templates":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"null"}]},"pack_purpose":{"type":["string","null"]},"offer_name":{"default":null,"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"clone":{"default":false,"type":"boolean"},"system":{"default":false,"type":"boolean"}},"required":["deployment_id","org_id","memory_id","data_domains","overlay","schema_name","principal","pack_name","pack_version","cell_workflows","status","paused_reason","profile","rate_limit_rpm","ro_role","ro_secret_ref","work_contract","ui","overlay_schema","a2ui_templates","skills","protocols","queries","templates","pack_purpose","offer_name","release_tuple_sha256","clone","system"],"additionalProperties":false}}},"required":["cell_id","issued_at","residency","core_version","pg","kill","deployments"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/uploads/{id}/resolve":{"post":{"summary":"Check an upload ticket's one-time secret (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string","minLength":1,"maxLength":500}},"required":["secret"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"object_key":{"type":"string"},"status":{"type":"string"},"max_bytes":{"type":"number"},"accepted_mime":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string"},"expected_sha256":{"type":["string","null"]}},"required":["id","org_id","object_key","status","max_bytes","accepted_mime","expires_at","expected_sha256"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/uploads/{id}":{"get":{"summary":"One upload on this cell, for its Gateway to read the bytes back (cell-authenticated)","tags":["cells"],"description":"The worker never holds a bucket credential (spec §17): when a job names an upload, the worker asks its own cell's Gateway for the bytes, and the Gateway asks here whether the upload is this cell's, ready and clean. Metadata only; the bytes stay in the cell (ADR 0018).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"object_key":{"type":"string"},"deployment_id":{"type":["string","null"]},"sha256":{"type":["string","null"]},"mime":{"type":["string","null"]},"bytes":{"type":["number","null"]},"status":{"type":"string"},"scan":{"type":"string"}},"required":["id","org_id","object_key","mime","bytes","status","scan"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/uploads/{id}/report":{"post":{"summary":"What the Gateway's probes measured (cell-authenticated)","tags":["cells"],"description":"Numbers and labels only: size, MIME, page or record counts, a language label and a scan verdict. Never a line of the document (spec §11.3, §17).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"mime":{"type":"string","maxLength":255},"sha256":{"type":"string","minLength":64,"maxLength":64},"probe":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"scan":{"type":"string","enum":["clean","infected","skipped"]},"status":{"type":"string","enum":["ready","rejected"]},"reason":{"type":"string","maxLength":500}},"required":["bytes","mime","sha256","scan","status"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean"}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deliveries/lease":{"post":{"summary":"Lease webhook deliveries due for this cell","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"default":20,"type":"integer","minimum":1,"maximum":100}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"url":{"type":"string"},"secret_ref":{"type":"string"},"event":{"type":"string"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"attempts":{"type":"number"}},"required":["id","webhook_id","url","secret_ref","event","body","attempts"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deliveries/{id}/report":{"post":{"summary":"The outcome of one webhook delivery","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["delivered","status_code","error"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean"},"given_up":{"type":"boolean"}},"required":["recorded","given_up"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/webhooks/secrets":{"post":{"summary":"Collect webhook signing secrets waiting to be placed in this cell","tags":["cells"],"description":"The customer supplies the secret; it is held in the control plane only until every cell the organisation runs in has collected it, and then cleared (migrations 0008, 0087).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collected":{"default":[],"type":"array","items":{"type":"string","maxLength":100}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"secret_ref":{"type":"string"},"secret":{"type":"string"}},"required":["id","secret_ref","secret"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/connectors/tokens":{"post":{"summary":"Collect connector token bundles waiting to be placed in this cell","tags":["cells"],"description":"The control plane runs the OAuth code exchange, because a redirect URI is one public URL. It then hands the tokens here and forgets them; every refresh afterwards happens at the cell (spec §13, migration 0009).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collected":{"default":[],"type":"array","items":{"type":"string","maxLength":100}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"secret_ref":{"type":"string"},"bundle":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind","secret_ref","bundle"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/connectors":{"get":{"summary":"The connectors this cell resolves tokens for (refs only)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"secret_ref":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"}},"required":["id","org_id","kind","label","secret_ref","config","status"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/connectors/{id}/report":{"post":{"summary":"Where a connector's cursor sits, as the cell last saw it","tags":["cells"],"description":"The authoritative cursor lives inside the memory; this is the projection an operator reads when a customer says nothing has arrived.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cursor":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"items_seen":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"status":{"type":"string","enum":["active","expired","error","revoked"]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/grant-tasks":{"get":{"summary":"Memories whose grants need reconciling, and who should hold what","tags":["cells"],"description":"The control plane cannot write a grant — it holds no memory handle (§2) — so a membership change enqueues work here and the cell does it. Idempotent: grants are content-addressed Facts, so a task applied twice is one Fact.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"org_id":{"type":"string"},"schema_name":{"type":"string"},"ops_namespace":{"type":"string"},"ops_namespaces":{"type":"array","items":{"type":"string"}},"rw_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"anon_key_ref":{"type":"string"},"reason":{"type":"string"},"attempts":{"type":"number"},"memberships":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string"},"source":{"type":"string"},"scope":{"type":"string","enum":["org"]}},"required":["email","role","source","scope"],"additionalProperties":false}},"agent_principals":{"type":"array","items":{"type":"string"}},"source_principals":{"type":"array","items":{"type":"object","properties":{"principal":{"type":"string"},"ops_namespaces":{"type":"array","items":{"type":"string"}}},"required":["principal","ops_namespaces"],"additionalProperties":false}},"revoke_principals":{"type":"array","items":{"type":"string"}}},"required":["id","memory_id","org_id","schema_name","ops_namespace","ops_namespaces","rw_role","rw_secret_ref","anon_key_ref","reason","attempts","memberships","agent_principals","source_principals","revoke_principals"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/grant-tasks/{id}/report":{"post":{"summary":"What the reconciler wrote, and what it found that nothing justifies","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"written":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"extra":{"default":[],"type":"array","items":{"type":"object","properties":{"principal":{"type":"string"},"namespace":{"type":"string"},"verbs":{"type":"array","items":{"type":"string"}}},"required":["principal","namespace","verbs"]}},"namespaces":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},"memory_id":{"type":"string","maxLength":100},"error":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"source_principals":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^source:src_[0-9A-HJKMNP-TV-Z]{26}$"}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"new_namespaces":{"type":"number"}},"required":["recorded","new_namespaces"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/counters":{"post":{"summary":"Edge counters from the Gateway (numbers only)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":["string","null"]},"metric":{"type":"string","maxLength":100},"value":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["deployment_id","metric","value"]}}},"required":["counters"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"number"}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/signing-key":{"post":{"summary":"Publish the cell's evidence-signing public key","tags":["cells"],"description":"So a verifier can read the key from the control plane rather than from the cell whose signature they are checking (spec §11.5).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"public_key_pem":{"type":"string","minLength":40,"maxLength":4000},"alg":{"type":"string","maxLength":40}},"required":["public_key_pem","alg"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/setup-context":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"session_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"connector_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"}},"required":["account_id","session_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"environment":{"type":"string"},"principal":{"type":"string"},"connector":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"kind":{"type":"string"},"secret_ref":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"}},"required":["id","kind","secret_ref","scopes","config","status"],"additionalProperties":false},{"type":"null"}]}},"required":["org_id","entity_id","environment","principal","connector"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/setup-sessions":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"session_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"recipe_id":{"type":"string","maxLength":64},"recipe_digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"recipe_version":{"type":"string","maxLength":30},"mode":{"type":"string","enum":["api","oauth","manual","browser"]},"step_id":{"type":"string","minLength":1,"maxLength":64},"key_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"request_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["account_id","session_id","recipe_id","recipe_digest","recipe_version","mode","step_id","key_hash","request_hash"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"id":{"type":"string","pattern":"^setup_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":"string"},"recipe_id":{"type":"string"},"recipe_digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"recipe_version":{"type":"string"},"state":{"type":"string","enum":["awaiting_user","verifying","running","outcome_unknown","ready","failed","cancelled","expired"]},"mode":{"type":"string","enum":["api","oauth","manual","browser"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller_epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller":{"type":"string","enum":["human","automation"]},"step_id":{"type":"string","maxLength":64},"reason":{"type":"string","enum":["consent_required","connection_missing","scope_missing","identity_missing","identity_mismatch","provider_unavailable","browser_unavailable","human_required","interrupted","verified","cancelled","expired"]},"actions":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allowed_commands":{"type":"array","items":{"type":"string","enum":["verify","cancel","take_control","hand_back","start_browser","advance"]}},"identity":{"type":"object","properties":{"gstin":{"type":"string","pattern":"^[0-9]{2}[A-Z0-9]{13}$"},"company_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"tax_id":{"type":"string","minLength":1,"maxLength":100},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"continuation":{"type":"string","enum":["gst_connect","oauth_connect","browser","manual","none"]}},"required":["schema_version","id","org_id","entity_id","memory_id","cell_id","recipe_id","recipe_digest","recipe_version","state","mode","revision","controller_epoch","controller","step_id","reason","actions","created_at","updated_at","expires_at","verified_at","allowed_commands","continuation"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/setup-sessions/{setup}/command-key":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"session_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"key_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"request_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"phase":{"type":"string","enum":["reserve","settle","release"]},"result":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"id":{"type":"string","pattern":"^setup_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":"string"},"recipe_id":{"type":"string"},"recipe_digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"recipe_version":{"type":"string"},"state":{"type":"string","enum":["awaiting_user","verifying","running","outcome_unknown","ready","failed","cancelled","expired"]},"mode":{"type":"string","enum":["api","oauth","manual","browser"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller_epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller":{"type":"string","enum":["human","automation"]},"step_id":{"type":"string","maxLength":64},"reason":{"type":"string","enum":["consent_required","connection_missing","scope_missing","identity_missing","identity_mismatch","provider_unavailable","browser_unavailable","human_required","interrupted","verified","cancelled","expired"]},"actions":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allowed_commands":{"type":"array","items":{"type":"string","enum":["verify","cancel","take_control","hand_back","start_browser","advance"]}},"continuation":{"type":"string","enum":["gst_connect","oauth_connect","browser","manual","none"]}},"required":["schema_version","id","org_id","entity_id","memory_id","cell_id","recipe_id","recipe_digest","recipe_version","state","mode","revision","controller_epoch","controller","step_id","reason","actions","created_at","updated_at","expires_at","verified_at","allowed_commands","continuation"],"additionalProperties":false}},"required":["account_id","session_id","key_hash","request_hash","phase"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"setup","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"replay":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"id":{"type":"string","pattern":"^setup_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":"string"},"recipe_id":{"type":"string"},"recipe_digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"recipe_version":{"type":"string"},"state":{"type":"string","enum":["awaiting_user","verifying","running","outcome_unknown","ready","failed","cancelled","expired"]},"mode":{"type":"string","enum":["api","oauth","manual","browser"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller_epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller":{"type":"string","enum":["human","automation"]},"step_id":{"type":"string","maxLength":64},"reason":{"type":"string","enum":["consent_required","connection_missing","scope_missing","identity_missing","identity_mismatch","provider_unavailable","browser_unavailable","human_required","interrupted","verified","cancelled","expired"]},"actions":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allowed_commands":{"type":"array","items":{"type":"string","enum":["verify","cancel","take_control","hand_back","start_browser","advance"]}},"identity":{"type":"object","properties":{"gstin":{"type":"string","pattern":"^[0-9]{2}[A-Z0-9]{13}$"},"company_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"tax_id":{"type":"string","minLength":1,"maxLength":100},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"continuation":{"type":"string","enum":["gst_connect","oauth_connect","browser","manual","none"]}},"required":["schema_version","id","org_id","entity_id","memory_id","cell_id","recipe_id","recipe_digest","recipe_version","state","mode","revision","controller_epoch","controller","step_id","reason","actions","created_at","updated_at","expires_at","verified_at","allowed_commands","continuation"],"additionalProperties":false},{"type":"null"}]}},"required":["replay"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/setup-sessions/{setup}":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"session_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"transition":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller_epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"string","enum":["awaiting_user","verifying","running","outcome_unknown","ready","failed","cancelled","expired"]},"reason":{"type":"string","enum":["consent_required","connection_missing","scope_missing","identity_missing","identity_mismatch","provider_unavailable","browser_unavailable","human_required","interrupted","verified","cancelled","expired"]},"controller":{"type":"string","enum":["human","automation"]},"increment_epoch":{"type":"boolean"},"increment_actions":{"type":"boolean"},"proof_ref":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"}},"required":["expected_revision","controller_epoch","state","reason"],"additionalProperties":false}},"required":["account_id","session_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"setup","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"id":{"type":"string","pattern":"^setup_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":"string"},"recipe_id":{"type":"string"},"recipe_digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"recipe_version":{"type":"string"},"state":{"type":"string","enum":["awaiting_user","verifying","running","outcome_unknown","ready","failed","cancelled","expired"]},"mode":{"type":"string","enum":["api","oauth","manual","browser"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller_epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"controller":{"type":"string","enum":["human","automation"]},"step_id":{"type":"string","maxLength":64},"reason":{"type":"string","enum":["consent_required","connection_missing","scope_missing","identity_missing","identity_mismatch","provider_unavailable","browser_unavailable","human_required","interrupted","verified","cancelled","expired"]},"actions":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"verified_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allowed_commands":{"type":"array","items":{"type":"string","enum":["verify","cancel","take_control","hand_back","start_browser","advance"]}},"identity":{"type":"object","properties":{"gstin":{"type":"string","pattern":"^[0-9]{2}[A-Z0-9]{13}$"},"company_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"tax_id":{"type":"string","minLength":1,"maxLength":100},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"continuation":{"type":"string","enum":["gst_connect","oauth_connect","browser","manual","none"]}},"required":["schema_version","id","org_id","entity_id","memory_id","cell_id","recipe_id","recipe_digest","recipe_version","state","mode","revision","controller_epoch","controller","step_id","reason","actions","created_at","updated_at","expires_at","verified_at","allowed_commands","continuation"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/records":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":600},"in":"query","name":"fields","required":false},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},"in":"query","name":"record_type","required":false},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"record_type_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},{"type":"null"}]},"type_major":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"type_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"summary":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"object_key":{"type":["string","null"]}},"required":["id","memory_id","entity_id","domain","record_type_id","type_major","type_minor","kind","revision","sha256","bytes","created_at","updated_at","object_key"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/records/{record}":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"record_type_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"},{"type":"null"}]},"type_major":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"type_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"summary":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"object_key":{"type":["string","null"]}},"required":["id","memory_id","entity_id","domain","record_type_id","type_major","type_minor","kind","revision","sha256","bytes","created_at","updated_at","org_id","object_key"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/records/{domain}/reserve":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"kind":{"type":"string","enum":["setup","document","operation"]},"dedup_key":{"type":"string","pattern":"^[a-f0-9]{64}$"},"mutation_key":{"type":"string","minLength":1,"maxLength":255},"mutation_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"actor":{"type":"string","minLength":1,"maxLength":200},"record_type_id":{"type":"string","maxLength":120,"pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}},"required":["id","kind","dedup_key","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"path","name":"domain","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"object_key":{"type":["string","null"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","memory_id","org_id","entity_id","domain","kind","revision","object_key","sha256","bytes"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/records/{domain}":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","enum":["setup","document","operation"]},"in":"query","name":"kind","required":true},{"schema":{"type":"string","maxLength":120},"in":"query","name":"cursor","required":false},{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"default":"asc","type":"string","enum":["asc","desc"]},"in":"query","name":"order","required":false},{"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"in":"query","name":"dedup_key","required":false},{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"path","name":"domain","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"object_key":{"type":["string","null"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","memory_id","org_id","entity_id","domain","kind","revision","object_key","sha256","bytes"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/records/{domain}/{record}":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"path","name":"domain","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"object_key":{"type":["string","null"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","memory_id","org_id","entity_id","domain","kind","revision","object_key","sha256","bytes"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/memories/{memory}/records/{domain}/{record}/replay":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mutation_key":{"type":"string","minLength":1,"maxLength":255},"mutation_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["mutation_key","mutation_sha256"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"path","name":"domain","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"object_key":{"type":["string","null"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","memory_id","org_id","entity_id","domain","kind","revision","object_key","sha256","bytes"],"additionalProperties":false},{"type":"null"}]}}}}}}},"/v1/cells/{cell}/memories/{memory}/records/{domain}/{record}/commit":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"object_key":{"type":"string","minLength":1,"maxLength":500},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"bytes":{"type":"integer","minimum":0,"maximum":33554432},"projection_deployment_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"mutation_key":{"type":"string","minLength":1,"maxLength":255},"mutation_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"actor":{"type":"string","minLength":1,"maxLength":200}},"required":["expected_revision","object_key","sha256","bytes","mutation_key","mutation_sha256","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"memory","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"path","name":"domain","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"org_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"entity_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"domain":{"type":"string"},"kind":{"type":"string","enum":["setup","document","operation"]},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"object_key":{"type":["string","null"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","memory_id","org_id","entity_id","domain","kind","revision","object_key","sha256","bytes"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/workflows":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string","minLength":1,"maxLength":100},"record_id":{"type":"string","minLength":1,"maxLength":100},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"workflow":{"type":"string","minLength":1,"maxLength":100},"run_id":{"type":"string","minLength":1,"maxLength":100},"actor":{"type":"string","minLength":1,"maxLength":200}},"required":["deployment_id","record_id","revision","sha256","workflow","run_id","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record_id":{"type":"string","minLength":1,"maxLength":100},"deployment_id":{"type":"string","minLength":1,"maxLength":100},"pack_version_id":{"type":"string","minLength":1,"maxLength":100},"memory_id":{"type":"string","minLength":1,"maxLength":100},"org_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","minLength":1,"maxLength":100},"domain":{"type":"string","minLength":1,"maxLength":100},"workflow":{"type":"string","minLength":1,"maxLength":100},"input_revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"input_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"input_object_key":{"type":"string"},"input_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_id":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claim":{"type":["string","null"]},"result_revision":{"type":["number","null"]},"result_sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"error_code":{"type":["string","null"]}},"required":["record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","workflow","input_revision","input_sha256","input_object_key","input_bytes","run_id","status","attempts","claim","result_revision","result_sha256","error_code"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/workflows/claim":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"worker":{"type":"string","minLength":1,"maxLength":100}},"required":["worker"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"record_id":{"type":"string","minLength":1,"maxLength":100},"deployment_id":{"type":"string","minLength":1,"maxLength":100},"pack_version_id":{"type":"string","minLength":1,"maxLength":100},"memory_id":{"type":"string","minLength":1,"maxLength":100},"org_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","minLength":1,"maxLength":100},"domain":{"type":"string","minLength":1,"maxLength":100},"workflow":{"type":"string","minLength":1,"maxLength":100},"input_revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"input_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"input_object_key":{"type":"string"},"input_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_id":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claim":{"type":["string","null"]},"result_revision":{"type":["number","null"]},"result_sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"error_code":{"type":["string","null"]},"namespace":{"type":"string"},"principal":{"type":"string"},"schema_name":{"type":"string"},"rw_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"anon_key_ref":{"type":["string","null"]},"workflow_hash":{"type":"string"},"max_wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":240000},"executor_pins":{"type":"array","items":{"type":"string"}},"manifest":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string"},"kind":{"type":"string"},"secret_ref":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"}},"required":["id","label","kind","secret_ref","config","status"],"additionalProperties":false}}},"required":["record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","workflow","input_revision","input_sha256","input_object_key","input_bytes","run_id","status","attempts","claim","result_revision","result_sha256","error_code","namespace","principal","schema_name","rw_role","rw_secret_ref","anon_key_ref","workflow_hash","max_wall_ms","executor_pins","manifest","connectors"],"additionalProperties":false},{"type":"null"}]}}}}}}},"/v1/cells/{cell}/workflows/{record}":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","maxLength":100},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record_id":{"type":"string","minLength":1,"maxLength":100},"deployment_id":{"type":"string","minLength":1,"maxLength":100},"pack_version_id":{"type":"string","minLength":1,"maxLength":100},"memory_id":{"type":"string","minLength":1,"maxLength":100},"org_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","minLength":1,"maxLength":100},"domain":{"type":"string","minLength":1,"maxLength":100},"workflow":{"type":"string","minLength":1,"maxLength":100},"input_revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"input_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"input_object_key":{"type":"string"},"input_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_id":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claim":{"type":["string","null"]},"result_revision":{"type":["number","null"]},"result_sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"error_code":{"type":["string","null"]}},"required":["record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","workflow","input_revision","input_sha256","input_object_key","input_bytes","run_id","status","attempts","claim","result_revision","result_sha256","error_code"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/workflows/{record}/finish":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"claim":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["succeeded","failed"]},"result_revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"result_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"error_code":{"type":"string","enum":["CLD-E409","CLD-E427","CLD-E503"]}},"required":["claim","status","result_revision","result_sha256"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","maxLength":100},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record_id":{"type":"string","minLength":1,"maxLength":100},"deployment_id":{"type":"string","minLength":1,"maxLength":100},"pack_version_id":{"type":"string","minLength":1,"maxLength":100},"memory_id":{"type":"string","minLength":1,"maxLength":100},"org_id":{"type":"string","minLength":1,"maxLength":100},"entity_id":{"type":"string","minLength":1,"maxLength":100},"domain":{"type":"string","minLength":1,"maxLength":100},"workflow":{"type":"string","minLength":1,"maxLength":100},"input_revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"input_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"input_object_key":{"type":"string"},"input_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_id":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claim":{"type":["string","null"]},"result_revision":{"type":["number","null"]},"result_sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"error_code":{"type":["string","null"]}},"required":["record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","workflow","input_revision","input_sha256","input_object_key","input_bytes","run_id","status","attempts","claim","result_revision","result_sha256","error_code"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/dispatch-notices":{"post":{"summary":"A cell's e-way bill expiry notice, content-free","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string","minLength":1,"maxLength":120},"event":{"type":"string","enum":["gst.ewaybill_expiring"]},"subject":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["deployment_id","event","subject"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["queued"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/connection-renewals":{"post":{"summary":"A cell's notice that a business's GST portal access is about to end","tags":["cells"],"description":"The business, a masked GSTIN and the date the taxpayer's API access ends (ADR 0110 item 8). The control plane tells the business's signers and the organisation's owners once per expiry; the full GSTIN, the session and every figure stay in the cell.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":120},"gstin_masked":{"type":"string","pattern":"^[0-9]{2}[A-Z]{5}•{6}[0-9A-Z]{2}$"},"access_until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["entity_id","gstin_masked","access_until"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"recorded":{"type":"boolean"}},"required":["queued","recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/gst-profiles":{"post":{"summary":"A cell's report of how one of its businesses files GST: frequency, regime, state code","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":120},"frequency":{"type":"string","enum":["monthly","quarterly"]},"regime":{"type":"string","enum":["regular","composition"]},"state_code":{"type":"string","pattern":"^[0-9]{2}$"}},"required":["entity_id","frequency","regime","state_code"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"boolean"}},"required":["changed"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/gst-filings":{"post":{"summary":"A cell's report of a return the GST portal lists as filed: form, period, ARN, day, method","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":120},"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A"]},"period":{"type":"string","pattern":"^20[0-9]{2}-(0[1-9]|1[0-2])$"},"arn":{"type":"string","pattern":"^[A-Z]{2}[0-9A-Z]{13}$"},"filed_on":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"method":{"anyOf":[{"type":"string","enum":["EVC","DSC"]},{"type":"null"}]},"source":{"type":"string","enum":["portal"]}},"required":["entity_id","form","period","arn","filed_on","method","source"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean"}},"required":["recorded"],"additionalProperties":false}}}}}},"get":{"summary":"The returns the GST portal listed as filed for one of this cell's businesses","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120},"in":"query","name":"entity_id","required":true},{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"form":{"type":"string","enum":["GSTR1","GSTR3B","GSTR1A"]},"period":{"type":"string"},"arn":{"type":["string","null"]},"filed_on":{"type":["string","null"]},"method":{"anyOf":[{"type":"string","enum":["EVC","DSC"]},{"type":"null"}]},"source":{"type":"string","enum":["portal"]}},"required":["form","period","arn","filed_on","method","source"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/gst-portal-checks":{"post":{"summary":"Claim today's read of the GST portal's return tracking for a business, form and period","tags":["cells"],"description":"At most one claim per business, form, period and India day; refused when the business runs no pack that files the form, when the return is already known filed, or when today's read was claimed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":120},"form":{"type":"string","enum":["GSTR1","GSTR3B"]},"period":{"type":"string","pattern":"^20[0-9]{2}-(0[1-9]|1[0-2])$"}},"required":["entity_id","form","period"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"claimed":{"type":"boolean"},"reason":{"type":"string","enum":["claimed","no_filing_pack","filed","already_checked"]},"checked_on":{"type":"string"}},"required":["claimed","reason","checked_on"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/gst-portal-checks/settle":{"post":{"summary":"What today's claimed read of the GST portal found","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":120},"form":{"type":"string","enum":["GSTR1","GSTR3B"]},"period":{"type":"string","pattern":"^20[0-9]{2}-(0[1-9]|1[0-2])$"},"checked_on":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"outcome":{"type":"string","enum":["filed","not_found","unknown","unavailable"]}},"required":["entity_id","form","period","checked_on","outcome"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"settled":{"type":"boolean"}},"required":["settled"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-projections/claim":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"worker":{"type":"string","minLength":1,"maxLength":100}},"required":["worker"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"record_id":{"type":"string","minLength":1,"maxLength":120},"deployment_id":{"type":"string","minLength":1,"maxLength":120},"pack_version_id":{"type":"string","minLength":1,"maxLength":120},"memory_id":{"type":"string","minLength":1,"maxLength":120},"org_id":{"type":"string","minLength":1,"maxLength":120},"entity_id":{"type":"string","minLength":1,"maxLength":120},"domain":{"type":"string","minLength":1,"maxLength":120},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"object_key":{"type":"string"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"captured_at":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"claim":{"type":["string","null"]},"claimed_until":{"type":["string","null"]},"principal":{"type":"string"},"schema_name":{"type":"string"},"rw_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"anon_key_ref":{"type":["string","null"]},"declarations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"namespace":{"type":"string"},"schema":{}},"required":["id","namespace","schema"],"additionalProperties":false}}},"required":["id","record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","revision","sha256","object_key","bytes","captured_at","status","cursor","claim","claimed_until","principal","schema_name","rw_role","rw_secret_ref","anon_key_ref","declarations"],"additionalProperties":false},{"type":"null"}]}}}}}}},"/v1/cells/{cell}/record-projections/{projection}":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","maxLength":100},"in":"path","name":"projection","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"record_id":{"type":"string","minLength":1,"maxLength":120},"deployment_id":{"type":"string","minLength":1,"maxLength":120},"pack_version_id":{"type":"string","minLength":1,"maxLength":120},"memory_id":{"type":"string","minLength":1,"maxLength":120},"org_id":{"type":"string","minLength":1,"maxLength":120},"entity_id":{"type":"string","minLength":1,"maxLength":120},"domain":{"type":"string","minLength":1,"maxLength":120},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"object_key":{"type":"string"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"captured_at":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"claim":{"type":["string","null"]},"claimed_until":{"type":["string","null"]}},"required":["id","record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","revision","sha256","object_key","bytes","captured_at","status","cursor","claim","claimed_until"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-projections/{projection}/advance":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"claim":{"type":"string","minLength":1,"maxLength":100},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"next_cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"done":{"type":"boolean"}},"required":["claim","cursor","next_cursor","done"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","maxLength":100},"in":"path","name":"projection","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"record_id":{"type":"string","minLength":1,"maxLength":120},"deployment_id":{"type":"string","minLength":1,"maxLength":120},"pack_version_id":{"type":"string","minLength":1,"maxLength":120},"memory_id":{"type":"string","minLength":1,"maxLength":120},"org_id":{"type":"string","minLength":1,"maxLength":120},"entity_id":{"type":"string","minLength":1,"maxLength":120},"domain":{"type":"string","minLength":1,"maxLength":120},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"object_key":{"type":"string"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"captured_at":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"claim":{"type":["string","null"]},"claimed_until":{"type":["string","null"]}},"required":["id","record_id","deployment_id","pack_version_id","memory_id","org_id","entity_id","domain","revision","sha256","object_key","bytes","captured_at","status","cursor","claim","claimed_until"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/retention":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"retention_days":{"type":"integer","minimum":1,"maximum":365},"upload_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"actor":{"type":"string","maxLength":200}},"required":["retention_days","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/statutory":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"basis":{"type":"string","enum":["in-cgst-s36-rule56"]},"retain_until":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"actor":{"type":"string","maxLength":200}},"required":["basis","retain_until","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"extended":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["recorded","extended"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/runs":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"run_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"namespace":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_.:-]+$"},"actor":{"type":"string","maxLength":200}},"required":["deployment_id","run_id","namespace","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/children":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"child_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"actor":{"type":"string","maxLength":200}},"required":["child_id","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/objects":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object_key":{"type":"string","maxLength":500},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"actor":{"type":"string","maxLength":200}},"required":["object_key","sha256","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/claim":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"worker":{"type":"string","minLength":1,"maxLength":200}},"required":["worker"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"record_id":{"type":"string"},"memory_id":{"type":"string"},"org_id":{"type":"string"},"domain":{"type":"string"},"schema_name":{"type":"string"},"rw_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"anon_key_ref":{"type":"string"},"objects":{"maxItems":10000,"type":"array","items":{"type":"string"}},"jobs":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"run_ids":{"maxItems":100,"type":"array","items":{"type":"string"}},"evidence_key":{"type":["string","null"]}},"required":["id","namespace","run_ids","evidence_key"],"additionalProperties":false}}},"required":["record_id","memory_id","org_id","domain","schema_name","rw_role","rw_secret_ref","anon_key_ref","objects","jobs"],"additionalProperties":false},{"type":"null"}]}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/erasure":{"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"record_id":{"type":"string"},"memory_id":{"type":"string"},"org_id":{"type":"string"},"domain":{"type":"string"},"schema_name":{"type":"string"},"rw_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"anon_key_ref":{"type":"string"},"objects":{"maxItems":10000,"type":"array","items":{"type":"string"}},"jobs":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"run_ids":{"maxItems":100,"type":"array","items":{"type":"string"}},"evidence_key":{"type":["string","null"]}},"required":["id","namespace","run_ids","evidence_key"],"additionalProperties":false}}},"required":["record_id","memory_id","org_id","domain","schema_name","rw_role","rw_secret_ref","anon_key_ref","objects","jobs"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/complete":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grains_removed":{"type":"integer","minimum":0,"maximum":9007199254740991},"objects_removed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["grains_removed","objects_removed"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"receipt_id":{"type":"string"}},"required":["receipt_id"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/jobs/{job}/retained-objects":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object_key":{"type":"string","maxLength":500}},"required":["object_key"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"job","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/record-lifecycle/{record}/census":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grains":{"type":"integer","minimum":0,"maximum":9007199254740991},"objects":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"in":"path","name":"record","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/ephemeral-secrets":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memory_id":{"type":"string","pattern":"^[a-z][a-z0-9]*_[A-Za-z0-9_-]{1,100}$"},"secret_ref":{"type":"string","pattern":"^statement-passwords\\/cred_[A-Za-z0-9_-]+$"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":600},"actor":{"type":"string","maxLength":200}},"required":["memory_id","secret_ref","ttl_seconds","actor"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}},"get":{"tags":["cells"],"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"secret_ref":{"type":"string","pattern":"^statement-passwords\\/cred_[A-Za-z0-9_-]+$"}},"required":["secret_ref"],"additionalProperties":false}}}}}}}},"/v1/cells/{cell}/ephemeral-secrets/deleted":{"post":{"tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"secret_ref":{"type":"string","pattern":"^statement-passwords\\/cred_[A-Za-z0-9_-]+$"}},"required":["secret_ref"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/uploads":{"post":{"summary":"Start an upload. Returns a one-time URL at the cell's Agent Gateway","tags":["jobs"],"description":"The control plane never receives upload bytes (spec §17). Send them to `upload_url` with `Authorization: Bearer <upload_secret>`; the Gateway probes and reports what it measured, and the upload becomes usable as a job input.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","maxLength":255},"mime":{"type":"string","maxLength":255},"ttl_sec":{"default":3600,"type":"integer","minimum":60,"maximum":86400},"deployment_id":{"type":"string","minLength":1,"maxLength":100}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"upload_url":{"type":"string"},"upload_secret":{"type":"string"},"object_key":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","upload_url","upload_secret","object_key","expires_at"],"additionalProperties":false}}}}}}},"/v1/uploads/{id}":{"get":{"summary":"What the Gateway's probes measured for one upload","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"mime":{"type":["string","null"]},"bytes":{"type":["number","null"]},"sha256":{"type":["string","null"]},"probe":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"scan":{"type":"string"},"reason":{"type":["string","null"]}},"required":["id","status","mime","bytes","sha256","probe","scan","reason"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/work-contracts":{"post":{"summary":"Publish a Work Contract version","tags":["jobs"],"description":"Immutable: re-publishing the same body is a no-op, publishing different content at the same version is refused. A changed promise is a new version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"contract_id":{"type":"string"},"version":{"type":"string"},"sha256":{"type":"string"}},"required":["id","contract_id","version","sha256"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/quality-contracts":{"post":{"summary":"Publish a Quality Contract version","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"contract_id":{"type":"string"},"version":{"type":"string"},"sha256":{"type":"string"}},"required":["id","contract_id","version","sha256"],"additionalProperties":false}}}}}}},"/v1/work-contracts/{id}":{"get":{"summary":"Read a Work Contract; the newest version unless one is named","tags":["jobs"],"parameters":[{"schema":{"type":"string","maxLength":50},"in":"query","name":"version","required":false},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"contract_id":{"type":"string"},"version":{"type":"string"},"sha256":{"type":"string"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","contract_id","version","sha256","body"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/webhooks":{"post":{"summary":"Subscribe to job events","tags":["jobs"],"description":"Deliveries are posted **from the cell**, so an endpoint inside your own network is reachable. Each delivery carries `x-areev-signature` over `timestamp.body`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","maxLength":100}},"secret":{"type":"string","minLength":16,"maxLength":200}},"required":["url","events"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}}},"required":["id","url","events"],"additionalProperties":false}}}}}},"get":{"summary":"List webhook subscriptions","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":["id","url","events","status"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/connectors/providers":{"get":{"summary":"Which connectors this deployment can authorise","tags":["connectors"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"scope_menu":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"available":{"type":"boolean"},"reason":{"type":["string","null"]},"picker":{"anyOf":[{"type":"object","properties":{"developer_key":{"type":"string"},"app_id":{"type":"string"}},"required":["developer_key","app_id"],"additionalProperties":false},{"type":"null"}]},"auth":{"type":"string","enum":["oauth","typed"]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"secret":{"type":"boolean"},"hint":{"type":"string"}},"required":["name","label","secret","hint"],"additionalProperties":false}}},"required":["kind","label","scopes","scope_menu","available","reason","picker","auth","fields"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/connectors/{kind}/authorize":{"post":{"summary":"Begin an OAuth authorisation. Returns the provider URL to send a person to","tags":["connectors"],"description":"A connection is a decision about who may read a mailbox or a ledger, so it needs a named person: an API key cannot start this flow (spec §12).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scopes":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":200}},"drive_access":{"type":"string","enum":["selected_files","watch_folder"]},"redirect_to":{"type":"string","maxLength":2000},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"label":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,100}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":50},"in":"path","name":"kind","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorize_url":{"type":"string"},"state":{"type":"string"},"expires_in":{"type":"number"}},"required":["authorize_url","state","expires_in"],"additionalProperties":false}}}}}}},"/v1/connectors/callback":{"get":{"summary":"OAuth redirect target (provider-facing)","tags":["connectors"],"parameters":[{"schema":{"type":"string","maxLength":4000},"in":"query","name":"code","required":false},{"schema":{"type":"string","maxLength":500},"in":"query","name":"state","required":true},{"schema":{"type":"string","maxLength":200},"in":"query","name":"error","required":false},{"schema":{"type":"string","maxLength":1000},"in":"query","name":"error_description","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"realmId","required":false},{"schema":{"type":"string","maxLength":20},"in":"query","name":"location","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"accounts-server","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/v1/orgs/{org}/connectors":{"get":{"summary":"List this organisation's connections","tags":["connectors"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"display_name":{"type":"string"},"account_ref":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"last_ok_at":{"type":["string","null"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"placements":{"type":"array","items":{"type":"object","properties":{"cell_id":{"type":"string"},"cell_name":{"type":"string"},"state":{"type":"string","enum":["placed","missing","revoked"]},"placed_at":{"type":["string","null"]}},"required":["cell_id","cell_name","state","placed_at"],"additionalProperties":false}},"reconsent_required":{"type":"boolean"},"access_expired":{"type":"boolean"},"token_staged":{"type":"boolean"},"token_target_cells":{"type":"array","items":{"type":"string"}},"requested_by":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"pack":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"],"additionalProperties":false},"required":{"type":"boolean"}},"required":["deployment_id","entity_id","pack","required"],"additionalProperties":false}}},"required":["id","kind","label","display_name","account_ref","scopes","status","status_reason","expires_at","last_ok_at","config","placements","reconsent_required","access_expired","token_staged","token_target_cells","requested_by"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"post":{"summary":"Connect a typed account — the buyer's own Plivo or Vobiz — by its auth id and token","tags":["connectors"],"description":"The first connection kinds that are not OAuth (ADR 0108 decision 5). A named person (`connectors.consent`, session only) types the account's auth id and token once; the token is sealed at once to every cell the organisation runs in and never stored, logged or echoed in the clear; each cell places it as a connector token is. The same auth id again updates the connection (a rotation). `CLD-E503` while a cell has not published the key credentials are sealed to. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["plivo","vobiz"]},"auth_id":{"type":"string","pattern":"^[A-Za-z0-9_]{8,64}$"},"auth_token":{"type":"string","minLength":16,"maxLength":256},"label":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,100}$"}},"required":["kind","auth_id","auth_token"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"display_name":{"type":"string"},"account_ref":{"type":"string"},"status":{"type":"string"},"sealed_for":{"type":"array","items":{"type":"string"}},"created":{"type":"boolean"}},"required":["id","kind","label","display_name","account_ref","status","sealed_for","created"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"display_name":{"type":"string"},"account_ref":{"type":"string"},"status":{"type":"string"},"sealed_for":{"type":"array","items":{"type":"string"}},"created":{"type":"boolean"}},"required":["id","kind","label","display_name","account_ref","status","sealed_for","created"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/connectors/asked":{"get":{"summary":"What this organisation's running products ask of their connections","tags":["connectors"],"description":"Each connection a running product's pack declares (`connections[]`, ADR 0051): the label it is asked for by, the provider that answers it, the permissions asked and why, and the organisation's connection under that label when there is one, with the asked permissions it does not hold. A Connect that sends this label and these scopes to `POST …/connectors/{kind}/authorize` makes exactly the connection the product uses.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"provider":{"type":"string"},"provider_label":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"purpose":{"type":"string"},"required":{"type":"boolean"},"available":{"type":"boolean"},"reason":{"type":["string","null"]},"asked_by":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]}},"required":["deployment_id","entity_id"],"additionalProperties":false}},"connection":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"display_name":{"type":"string"},"missing_scopes":{"type":"array","items":{"type":"string"}}},"required":["id","kind","status","display_name","missing_scopes"],"additionalProperties":false},{"type":"null"}]}},"required":["label","provider","provider_label","scopes","purpose","required","available","reason","asked_by","connection"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/connectors/{id}/reconsent":{"post":{"summary":"Re-consent a connection for the cells missing its token","tags":["connectors"],"description":"A connection is placed per cell; a cell the organisation joined after the token was placed never received it. This returns the provider URL to send a named person to, with the cells the new token is for recorded. A revoked connection cannot be re-consented: connect afresh.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"redirect_to":{"type":"string","maxLength":2000},"scopes":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":200}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorize_url":{"type":"string"},"state":{"type":"string"},"expires_in":{"type":"number"},"target_cells":{"type":"array","items":{"type":"string"}},"missing_cells":{"type":"array","items":{"type":"string"}}},"required":["authorize_url","state","expires_in","target_cells","missing_cells"],"additionalProperties":false}}}}}}},"/v1/connectors/{id}":{"patch":{"summary":"Rename a connection's label","tags":["connectors"],"description":"The label is what a pack asks for (`connectors_required`), so it is the customer's to choose: two mailboxes become `inbox` and `archive`, and a pack asking for `inbox` gets the one they meant (spec §13).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,100}$"}},"required":["label"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}}}}},"delete":{"summary":"Revoke a connection","tags":["connectors"],"description":"The connection stops; the consent record stays. Who granted an agent access to a mailbox outlives the access itself.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"default":"revoked by the customer","type":"string","maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/consents":{"get":{"summary":"Who granted what, and when","tags":["connectors"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connector_id":{"type":["string","null"]},"subject":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"granted_by":{"type":"string"},"granted_at":{"type":"string"},"revoked_at":{"type":["string","null"]}},"required":["id","connector_id","subject","scopes","granted_by","granted_at","revoked_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/runs/{runId}/respond":{"post":{"summary":"Answer a run's open ask, by run id","tags":["jobs"],"description":"A named session, a written reason, and never the principal that started the run (spec §12). A service principal with delegated respond may answer on behalf of a verified person, and the delegation is recorded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool_call_id":{"type":"string","maxLength":200},"decision":{"type":"string","enum":["approve","reject","cancel"]},"reason":{"type":"string","minLength":3,"maxLength":1000},"responder":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["decision","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"run_id":{"type":"string"},"decision":{"type":"string"},"responder":{"type":"string"},"via":{"type":"string"}},"required":["id","run_id","decision","responder","via"],"additionalProperties":false}}}}}}},"/v1/approvals/{id}/opened":{"post":{"summary":"Mark an ask as opened in the Desk (first open wins)","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"opened_at":{"type":"string"}},"required":["id","opened_at"],"additionalProperties":false}}}}}}},"/v1/approvals/{id}/notify":{"post":{"summary":"Email an ask to an approver, with a reply marker","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["to"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"number"},"token":{"type":"string"}},"required":["sent","token"],"additionalProperties":false}}}}}}},"/v1/inbound/mail":{"post":{"summary":"Inbound approval replies (provider-facing)","tags":["jobs"],"description":"DKIM must pass and the sender must be an account that may approve here. Holding the marker is not enough: a forwarded email would otherwise approve.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string","maxLength":500},"from":{"type":"string","maxLength":500},"to":{"type":"string","maxLength":500},"subject":{"type":"string","maxLength":1000},"text":{"type":"string","maxLength":200000},"dkim":{"default":"none","type":"string","enum":["pass","fail","none"]},"spf":{"default":"none","type":"string","enum":["pass","fail","none"]}},"required":["from","to"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["applied","refused","ignored"]},"reason":{"type":"string"}},"required":["outcome","reason"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/corrections":{"post":{"summary":"Tell the agent one answer was wrong","tags":["jobs"],"description":"Always accepted, because it is a fact about a job that already happened. Whether it changes future behaviour is a separate decision — propose a lesson for that.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":200},"correction":{"type":"string","minLength":1,"maxLength":4000},"note":{"type":"string","maxLength":2000},"scope":{"default":"org","type":"string","enum":["personal","team","org"]}},"required":["field","correction"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":"string"},"scope":{"type":"string"},"recorded_at":{"type":"string"},"fork_id":{"type":["string","null"]}},"required":["id","job_id","scope","recorded_at","fork_id"],"additionalProperties":false}}}}}},"get":{"summary":"Corrections recorded against one job","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"correction":{"type":"string"},"note":{"type":["string","null"]},"by_principal":{"type":"string"},"created_at":{"type":"string"},"applied_at":{"type":["string","null"]}},"required":["id","field","correction","note","by_principal","created_at","applied_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/lessons":{"post":{"summary":"Propose something the agent should carry forward","tags":["jobs"],"description":"Proposed, not applied. A lesson changes future behaviour, so a person approves it first — and the person who proposed it is not enough on its own (proposal §6).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lesson":{"type":"string","minLength":5,"maxLength":4000},"from_job_id":{"type":"string","maxLength":100},"scope":{"default":"deployment","type":"string","enum":["deployment","org"]}},"required":["lesson"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["proposed"]},"proposed_at":{"type":"string"}},"required":["id","status","proposed_at"],"additionalProperties":false}}}}}}},"/v1/lessons/{id}/review":{"post":{"summary":"Approve, apply, dismiss or roll back a proposed lesson","tags":["jobs"],"description":"Approving is not applying. A lesson is reviewed by somebody who did not propose it, and rolling one back is a first-class action because a lesson that made things worse must be removable without an engineer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","dismiss","rollback"]},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["decision","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/forks":{"get":{"summary":"Where two people corrected the same thing differently","tags":["jobs"],"description":"Both sides stay addressable with their authors and reasons. Silent last-write-wins does not exist: the person whose correction lost would never learn that it did.","parameters":[{"schema":{"type":"string","enum":["open","resolved"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"field":{"type":"string"},"status":{"type":"string"},"resolved_to":{"type":["string","null"]},"resolved_by":{"type":["string","null"]},"resolution":{"type":["string","null"]},"sides":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"correction":{"type":"string"},"by_principal":{"type":"string"},"created_at":{"type":"string"}},"required":["id","correction","by_principal","created_at"],"additionalProperties":false}}},"required":["id","deployment_id","field","status","resolved_to","resolved_by","resolution","sides"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/forks/{id}/resolve":{"post":{"summary":"Settle a contradiction by keeping one side","tags":["jobs"],"description":"The other corrections are superseded, not deleted: the record of somebody having said the opposite is what stops the same disagreement recurring silently.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keep_correction_id":{"type":"string","minLength":1,"maxLength":100},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["keep_correction_id","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"superseded":{"type":"number"}},"required":["id","superseded"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/lessons":{"get":{"summary":"Proposed and reviewed lessons","tags":["jobs"],"parameters":[{"schema":{"type":"string","maxLength":30},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"lesson":{"type":"string"},"scope":{"type":"string"},"status":{"type":"string"},"by_principal":{"type":"string"},"reviewed_by":{"type":["string","null"]},"review_reason":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","deployment_id","lesson","scope","status","by_principal","reviewed_by","review_reason","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/recommendations":{"get":{"summary":"What this agent proposes to learn","tags":["jobs"],"description":"Recommendations against a frozen surface never appear here: they are dismissed with reason `frozen-surface` when the Loop runs, because a frozen surface is a decision already made (spec §9).","parameters":[{"schema":{"type":"string","maxLength":30},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"deployment_id":{"type":"string"},"kind":{"type":"string"},"surface":{"type":["string","null"]},"target":{"type":["string","null"]},"origin":{"type":["string","null"]},"summary":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"},"auto_reason":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"first_seen_at":{"type":"string"},"requested_decision":{"anyOf":[{"type":"string","enum":["apply","dismiss","rollback"]},{"type":"null"}]},"requested_by":{"type":["string","null"]},"requested_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]}},"required":["hash","deployment_id","kind","surface","target","origin","summary","evidence","status","auto_reason","decided_by","decided_at","reason","first_seen_at","requested_decision","requested_by","requested_at","cell_error"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/recommendations/{hash}/{decision}":{"post":{"summary":"Approve, apply, dismiss or roll back a recommendation","tags":["jobs"],"description":"Approving is not applying: approval says the change is right, applying makes it take effect, and the gap between them is where a gating run happens. Every decision needs a written reason and a named person. `approve` is recorded at once (200). `apply`, `dismiss` and `rollback` reach the memory through the cell: the answer is 202 with `requested_decision` set and `status` unchanged, and the status moves when the cell confirms (spec §9.1).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000},"gating_run_id":{"type":"string","maxLength":200}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":4,"maxLength":200},"in":"path","name":"hash","required":true},{"schema":{"type":"string","enum":["approve","apply","dismiss","rollback"]},"in":"path","name":"decision","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"hash":{"type":"string"},"deployment_id":{"type":"string"},"kind":{"type":"string"},"surface":{"type":["string","null"]},"target":{"type":["string","null"]},"origin":{"type":["string","null"]},"summary":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"},"auto_reason":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"first_seen_at":{"type":"string"},"requested_decision":{"anyOf":[{"type":"string","enum":["apply","dismiss","rollback"]},{"type":"null"}]},"requested_by":{"type":["string","null"]},"requested_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]}},"required":["hash","deployment_id","kind","surface","target","origin","summary","evidence","status","auto_reason","decided_by","decided_at","reason","first_seen_at","requested_decision","requested_by","requested_at","cell_error"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"hash":{"type":"string"},"deployment_id":{"type":"string"},"kind":{"type":"string"},"surface":{"type":["string","null"]},"target":{"type":["string","null"]},"origin":{"type":["string","null"]},"summary":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"},"auto_reason":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"first_seen_at":{"type":"string"},"requested_decision":{"anyOf":[{"type":"string","enum":["apply","dismiss","rollback"]},{"type":"null"}]},"requested_by":{"type":["string","null"]},"requested_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]}},"required":["hash","deployment_id","kind","surface","target","origin","summary","evidence","status","auto_reason","decided_by","decided_at","reason","first_seen_at","requested_decision","requested_by","requested_at","cell_error"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/learning-policy":{"get":{"summary":"How this agent is allowed to learn, and what each setting means","tags":["jobs"],"description":"The customer-facing words are *proposes* and *frozen*. `automatic` means the built-in analyzers may tidy up value-identical duplicates and nothing else; anything a model proposed still waits for a person (spec §9).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"policy":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"surfaces":{"type":"array","items":{"type":"object","properties":{"surface":{"type":"string"},"label":{"type":"string"},"mode":{"type":"string"},"mode_label":{"type":"string"},"available_modes":{"type":"array","items":{"type":"string"}}},"required":["surface","label","mode","mode_label","available_modes"],"additionalProperties":false}},"rendered":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"core_policy":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"loop_paused":{"type":"boolean"},"loop_last_run_at":{"type":["string","null"]},"last_run":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string"},"finished_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"proposed":{"type":"number"},"auto_applied":{"type":"number"},"auto_dismissed":{"type":"number"},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"error":{"type":["string","null"]}},"required":["id","started_at","finished_at","reason","proposed","auto_applied","auto_dismissed","health","error"],"additionalProperties":false},{"type":"null"}]}},"required":["deployment_id","policy","surfaces","rendered","core_policy","loop_paused","loop_last_run_at","last_run"],"additionalProperties":false}}}}}},"put":{"summary":"Change how this agent is allowed to learn","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"object","propertyNames":{"type":"string","enum":["tools","workflow_steps","heuristics","facts","context_query","thresholds","permissions","examples","prompt_slot"]},"additionalProperties":{"type":"string","enum":["automatic","propose","frozen"]}},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["policy","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"policy":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"release_tuple_sha256":{"type":"string"},"jobs_restamped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["deployment_id","policy","release_tuple_sha256","jobs_restamped"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/loop":{"put":{"summary":"Pause or resume this agent's learning","tags":["jobs"],"description":"A paused Loop is not scheduled: nothing new is proposed for this deployment until it is resumed. Decisions already asked of the memory still reach it. The canary pauses a deployment whose quality it flags, and only a person resumes it (spec §9.1).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paused":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["paused","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"changed":{"type":"boolean"},"loop_paused":{"type":"boolean"},"loop_last_run_at":{"type":["string","null"]},"last_run":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string"},"finished_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"proposed":{"type":"number"},"auto_applied":{"type":"number"},"auto_dismissed":{"type":"number"},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"error":{"type":["string","null"]}},"required":["id","started_at","finished_at","reason","proposed","auto_applied","auto_dismissed","health","error"],"additionalProperties":false},{"type":"null"}]}},"required":["deployment_id","changed","loop_paused","loop_last_run_at","last_run"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/learning":{"get":{"summary":"What every agent here has proposed, and what became of it","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"open":{"type":"number"},"approved":{"type":"number"},"applied":{"type":"number"},"dismissed":{"type":"number"},"rolled_back":{"type":"number"}},"required":["open","approved","applied","dismissed","rolled_back"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"deployment_id":{"type":"string"},"kind":{"type":"string"},"surface":{"type":["string","null"]},"target":{"type":["string","null"]},"origin":{"type":["string","null"]},"summary":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"status":{"type":"string"},"auto_reason":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"first_seen_at":{"type":"string"},"requested_decision":{"anyOf":[{"type":"string","enum":["apply","dismiss","rollback"]},{"type":"null"}]},"requested_by":{"type":["string","null"]},"requested_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]}},"required":["hash","deployment_id","kind","surface","target","origin","summary","evidence","status","auto_reason","decided_by","decided_at","reason","first_seen_at","requested_decision","requested_by","requested_at","cell_error"],"additionalProperties":false}}},"required":["summary","data"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/subjects/{subject}/report":{"post":{"summary":"What this memory holds about one person","tags":["memories"],"description":"Phase one of an erasure. Returns the counts and a `report_sha256` the erase call must present, so nobody erases a footprint they have not seen (spec §16).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"namespace":{"type":"string","maxLength":200},"text_mentions":{"default":false,"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":300},"in":"path","name":"subject","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"subject":{"type":"string"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"report_sha256":{"type":"string"},"expires_at":{"type":"string"},"note":{"type":"string"}},"required":["request_id","subject","counts","report_sha256","expires_at","note"],"additionalProperties":false}}}}}},"get":{"summary":"The counts the cell reported for a subject","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":300},"in":"path","name":"subject","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"report_sha256":{"type":"string"},"expires_at":{"type":"string"},"ready":{"type":"boolean"},"stage":{"type":"string"}},"required":["request_id","counts","report_sha256","expires_at","ready","stage"],"additionalProperties":false}}}}}}},"/v1/erasures/{id}":{"get":{"summary":"Where one subject erasure has got to","tags":["memories"],"description":"`reporting` the cell is counting, `reported` the counts are real and the hash may be confirmed, `erasing` the cell has it, `erased` there is a receipt, `failed` the cell refused and said why (spec §16).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"subject":{"type":"string"},"stage":{"type":"string"},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"report_sha256":{"type":"string"},"receipt_id":{"type":["string","null"]},"failure":{"type":["string","null"]},"expires_at":{"type":"string"}},"required":["id","memory_id","subject","stage","counts","report_sha256","receipt_id","failure","expires_at"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/subjects/{subject}/erase":{"post":{"summary":"Erase everything this memory holds about one person","tags":["memories"],"description":"Phase two. Present the `report_sha256` from the report you were shown. A stale or unrecognised hash is refused: the footprint may have grown since.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report_sha256":{"type":"string","minLength":64,"maxLength":64},"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["report_sha256","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":300},"in":"path","name":"subject","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"status":{"type":"string","enum":["queued"]},"note":{"type":"string"}},"required":["request_id","status","note"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/receipts":{"get":{"summary":"Deletion receipts for this memory","tags":["memories"],"description":"What was counted before, what was counted after, the hash of what the approver saw, and their name. Keep these: they are the evidence, not the log line.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"kind":{"type":"string"},"subject":{"type":["string","null"]},"counts_before":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"counts_after":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"report_sha256":{"type":"string"},"objects_removed":{"type":"number"},"approver":{"type":"string"},"reason":{"type":"string"},"verified":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","memory_id","kind","subject","counts_before","counts_after","report_sha256","objects_removed","approver","reason","verified","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/retention":{"get":{"summary":"How long each class of data lives here","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data_class":{"type":"string"},"min_days":{"type":"number"},"max_days":{"type":["number","null"]},"set_by":{"type":"string"},"reason":{"type":["string","null"]}},"required":["id","data_class","min_days","max_days","set_by","reason"],"additionalProperties":false}},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"matter":{"type":"string"},"placed_by":{"type":"string"},"placed_at":{"type":"string"}},"required":["id","matter","placed_by","placed_at"],"additionalProperties":false}}},"required":["data","holds"],"additionalProperties":false}}}}}},"put":{"summary":"Set how long a class of data lives","tags":["memories"],"description":"`min_days` is a floor Core also holds inside the memory, so a control-plane bug cannot delete something your own configuration protects (C-16).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data_class":{"type":"string","enum":["uploads","evidence","journals","grains","audit"]},"min_days":{"type":"integer","minimum":0,"maximum":3650},"max_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":3650},{"type":"null"}]},"reason":{"type":"string","maxLength":500}},"required":["data_class","min_days"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"data_class":{"type":"string"},"min_days":{"type":"number"},"max_days":{"type":["number","null"]}},"required":["id","data_class","min_days","max_days"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/legal-holds":{"post":{"summary":"Place a legal hold. Nothing under it can be deleted","tags":["memories"],"description":"Checked by the retention sweep, by subject erasure and by offboarding — a hold that stopped only the sweep would be one a support request could walk around.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matter":{"type":"string","minLength":3,"maxLength":200},"reason":{"type":"string","minLength":3,"maxLength":1000},"memory_id":{"type":"string","maxLength":100}},"required":["matter","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"matter":{"type":"string"},"placed_by":{"type":"string"}},"required":["id","matter","placed_by"],"additionalProperties":false}}}}}}},"/v1/legal-holds/{id}":{"delete":{"summary":"Lift a legal hold","tags":["memories"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"lifted":{"type":"boolean"}},"required":["id","lifted"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/export":{"post":{"summary":"Export a memory","tags":["memories"],"description":"Returns 202. The memory's cell bundles it with Core's `bundle` into the cell's bucket and reports its hash; read `GET /v1/exports/{id}` for the Gateway link and the receipt when it is ready. The bytes never pass through the control plane (spec §16, §17). `mgb` only: a worker carries no pg_dump (ADR 0030).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"default":"mgb","type":"string","enum":["mgb","pgdump"]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"}},"required":["id","status","note"],"additionalProperties":false}}}}}}},"/v1/exports/{id}":{"get":{"summary":"An export's state, and where to fetch it when ready","tags":["memories"],"description":"Keys and hashes only. `gateway_url` is the memory's cell Gateway route that answers a presigned link to the bundle for a cell-audience token of this organisation's owner or admin; the control plane never serves the bytes (spec §17).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"format":{"type":"string"},"status":{"type":"string"},"sha256":{"type":["string","null"]},"bytes":{"type":["number","null"]},"object_key":{"type":["string","null"]},"gateway_url":{"type":["string","null"]},"receipt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sha256":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","sha256","created_at"],"additionalProperties":false},{"type":"null"}]},"error":{"type":["string","null"]},"expires_at":{"type":["string","null"]}},"required":["id","kind","format","status","sha256","bytes","object_key","gateway_url","receipt","error","expires_at"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/import":{"post":{"summary":"Import a bundle into a memory","tags":["memories"],"description":"Returns 202 and an import in `requested`; the memory's cell imports the bundle with Core's importBundle after checking its sha256, runs verify() and reports. Requires Idempotency-Key; owner or admin, or a credential with the admin scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bundle_key":{"type":"string","minLength":1,"maxLength":512},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["bundle_key","sha256"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"memory_id":{"type":"string"}},"required":["id","status","memory_id"],"additionalProperties":false}}}}}}},"/v1/imports/{id}":{"get":{"summary":"An import's state","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"status":{"type":"string"},"bundle_key":{"type":"string"},"sha256":{"type":"string"},"applied_ops":{"type":["number","null"]},"verify":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["id","memory_id","status","bundle_key","sha256","applied_ops","verify","error"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/audit-export":{"get":{"summary":"The control plane's audit events, with the chain verified","tags":["memories"],"description":"The chain is verified as it is read, and the response says so. An export whose chain does not verify is worth less than no export, so it is reported rather than returned quietly.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"query","name":"since","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"until","required":false},{"schema":{"default":1000,"type":"integer","minimum":1,"maximum":10000},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"chain_verified":{"type":"boolean"},"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"number"},"at":{"type":"string"},"actor":{"type":"string"},"action":{"type":"string"},"target_type":{"type":"string"},"target_id":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"hash":{"type":"string"}},"required":["seq","at","actor","action","target_type","target_id","detail","hash"],"additionalProperties":false}}},"required":["chain_verified","count","data"],"additionalProperties":false}}}}}}},"/v1/store/offers":{"get":{"summary":"The catalog: search by text and facets, a page at a time","tags":["store"],"description":"`q` is matched against title (strongest), slug, category and term names. Facet parameters take term slugs, repeated or comma-separated (at most 10 each): facets are AND-ed, slugs within one facet OR-ed. Ordered by relevance then id with `q`, else by id. Pass `next_cursor` back as `cursor`; a cursor from another filter is `CLD-E400`.","parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false},{"schema":{"anyOf":[{"type":"string","maxLength":700},{"maxItems":10,"type":"array","items":{"type":"string","maxLength":70}}]},"in":"query","name":"industry","required":false},{"schema":{"anyOf":[{"type":"string","maxLength":700},{"maxItems":10,"type":"array","items":{"type":"string","maxLength":70}}]},"in":"query","name":"function","required":false},{"schema":{"anyOf":[{"type":"string","maxLength":700},{"maxItems":10,"type":"array","items":{"type":"string","maxLength":70}}]},"in":"query","name":"jurisdiction","required":false},{"schema":{"anyOf":[{"type":"string","maxLength":700},{"maxItems":10,"type":"array","items":{"type":"string","maxLength":70}}]},"in":"query","name":"persona","required":false},{"schema":{"anyOf":[{"type":"string","maxLength":700},{"maxItems":10,"type":"array","items":{"type":"string","maxLength":70}}]},"in":"query","name":"channel","required":false},{"schema":{"type":"string","enum":["in","us","sg","any"]},"in":"query","name":"market","required":false},{"schema":{"type":"string","enum":["outcome","bundle","cell"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"orderable","required":false},{"schema":{"type":"string","maxLength":30},"in":"query","name":"shelf","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"default":24,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved"],"additionalProperties":false}},"promotions":{"type":"array","items":{"type":"object","properties":{"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents"],"additionalProperties":false}},"slug":{"type":"string"},"kind":{"type":"string","enum":["percent_off","amount_off","free_units","credit"]},"display_text":{"type":"string"},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"scope":{"type":"object","properties":{"offer_ids":{"type":"array","items":{"type":"string"}},"shelf":{"type":"string"},"market":{"type":"string"},"any":{"type":"boolean"}},"additionalProperties":false}},"required":["promoted","slug","kind","display_text","starts_at","ends_at","scope"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"},"generated_at":{"type":"string"}},"required":["data","promotions","next_cursor","has_more","generated_at"],"additionalProperties":false}}}}}}},"/v1/store/facets":{"get":{"summary":"How many listings carry each term","tags":["store"],"parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false},{"schema":{"type":"string","enum":["in","us","sg","any"]},"in":"query","name":"market","required":false},{"schema":{"type":"string","enum":["outcome","bundle","cell"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"orderable","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"facets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["slug","name","count"],"additionalProperties":false}}},"required":["id","terms"],"additionalProperties":false}}},"required":["facets"],"additionalProperties":false}}}}}}},"/v1/store/offers/by-slug/{slug}":{"get":{"summary":"Resolve an offer's current slug to the public offer","tags":["store"],"parameters":[{"schema":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"in":"query","name":"locale","required":false},{"schema":{"type":"string","maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]},"content":{"anyOf":[{"type":"object","properties":{"locale":{"type":"string"},"version":{"type":"number"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["locale","version","body"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved","content"],"additionalProperties":false}}}}}}},"/v1/store/offers/by-sku/{sku}":{"get":{"summary":"Resolve a permanent SKU to the current public offer and SEO slug","tags":["store"],"parameters":[{"schema":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"in":"query","name":"locale","required":false},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]},"content":{"anyOf":[{"type":"object","properties":{"locale":{"type":"string"},"version":{"type":"number"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["locale","version","body"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved","content"],"additionalProperties":false}}}}}}},"/v1/store/offers/{id}":{"get":{"summary":"One offer, with its price ladder and measured quality","tags":["store"],"parameters":[{"schema":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"in":"query","name":"locale","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tiers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"from_units":{"type":"number"},"amount_cents":{"type":"number"}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string"},"tax_code":{"type":["string","null"]},"taxable":{"type":"boolean"}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents","tiers","billing_cycle","tax_code","taxable"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]},"auto_credit_cents":{"type":["number","null"]},"auto_credit_pct":{"type":["number","null"]},"content":{"anyOf":[{"type":"object","properties":{"locale":{"type":"string"},"version":{"type":"number"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["locale","version","body"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved","content"],"additionalProperties":false}}}}}}},"/v1/store/store.json":{"get":{"summary":"The catalog as the site ships it (version 1, deprecated by version 2)","tags":["store"],"description":"Every listed and paused offer with its full view. Deprecated: answers `Deprecation: true`, a `Sunset` date and `Link: </v1/store/v2/store.json>; rel=\"successor-version\"`; read the version 2 index and load one offer by slug or SKU.","deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"generated_at":{"type":"string"},"base_url":{"type":"string"},"offers":{"type":"array","items":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved"],"additionalProperties":false}},"promotions":{"type":"array","items":{"type":"object","properties":{"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents"],"additionalProperties":false}},"slug":{"type":"string"},"kind":{"type":"string","enum":["percent_off","amount_off","free_units","credit"]},"display_text":{"type":"string"},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"scope":{"type":"object","properties":{"offer_ids":{"type":"array","items":{"type":"string"}},"shelf":{"type":"string"},"market":{"type":"string"},"any":{"type":"boolean"}},"additionalProperties":false}},"required":["promoted","slug","kind","display_text","starts_at","ends_at","scope"],"additionalProperties":false}}},"required":["version","generated_at","base_url","offers","promotions"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/store/v2/store.json":{"get":{"summary":"The catalogue index: one shard per market","tags":["store"],"description":"Names each market's shard with its `ETag` and row count. Its own `ETag` hashes the shards', so a conditional read answers `304` until any shard changes.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","enum":[2]},"generated_at":{"type":"string"},"base_url":{"type":"string"},"markets":{"type":"array","items":{"type":"string"}},"shards":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"url":{"type":"string"},"etag":{"type":"string"},"count":{"type":"number"}},"required":["market","url","etag","count"],"additionalProperties":false}}},"required":["version","generated_at","base_url","markets","shards"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/store/v2/shards/{file}":{"get":{"summary":"One market's catalogue index","tags":["store"],"description":"`<market>.json` for a sale market (in, us, sg): every listed and paused offer priced for that market or for `any`, as index rows. `ETag` over the rows, `Cache-Control: max-age=60`, `304` on a match.","parameters":[{"schema":{"type":"string","pattern":"^(in|us|sg)\\.json$"},"in":"path","name":"file","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","enum":[2]},"market":{"type":"string"},"generated_at":{"type":"string"},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"slug":{"type":["string","null"]},"kind":{"type":"string"},"market":{"type":"string"},"family_id":{"type":["string","null"]},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"string"}},"function":{"type":"array","items":{"type":"string"}},"jurisdiction":{"type":"array","items":{"type":"string"}},"persona":{"type":"array","items":{"type":"string"}},"channel":{"type":"array","items":{"type":"string"}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_state":{"type":"string"},"orderable":{"type":"boolean"},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"price_floor":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["id","sku","slug","kind","market","family_id","facets","lifecycle","sale_state","orderable","sold_in","waitlist","price_floor"],"additionalProperties":false}}},"required":["version","market","generated_at","offers"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/store/ask":{"post":{"summary":"Ask about Areev's products, as a visitor","tags":["store"],"description":"Public and limited by address (20 a minute and 30 a day, `CLD-E430` with `Retry-After`). Opens the question and starts its answer: a model that reads the public catalogue, under a gate that holds every price to the registry. Returns at once with the case, the thread (send `thread_id` back to follow up) and `stream`: the cell Gateway's public AG-UI stream (`GET {url}` with `Authorization: Bearer {token}`) and the verified answer envelope (`GET {answer_url}`, the same header), valid ten minutes. `CLD-E503` when the platform cannot answer here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":3,"maxLength":500},"market":{"type":"string","enum":["in","us","sg","any"]},"view":{"type":"string","maxLength":10,"pattern":"^[a-z0-9-]+$"},"thread_id":{"type":"string","minLength":1,"maxLength":100}},"required":["question"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case_id":{"type":"string"},"thread_id":{"type":"string"},"stream":{"type":"object","properties":{"url":{"type":"string"},"answer_url":{"type":"string"},"token":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","answer_url","token","expires_at"],"additionalProperties":false}},"required":["case_id","thread_id","stream"],"additionalProperties":false}}}}}}},"/v1/store/ask/offers":{"get":{"summary":"The listed offers that match a visitor's words, best first","tags":["store"],"description":"`q` is matched word by word against the title (strongest), slug and SKU, then category, shelf, facet terms, members and price rules; `market` narrows to its offers (a market the words name does when it is absent). At most `limit` (10), each with `store_path`, its page on the Store.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"query","name":"q","required":true},{"schema":{"type":"string","enum":["in","us","sg","any"]},"in":"query","name":"market","required":false},{"schema":{"default":10,"type":"integer","minimum":1,"maximum":20},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]},"store_path":{"type":"string"}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved","store_path"],"additionalProperties":{}}},"has_more":{"type":"boolean"}},"required":["data","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/purchase-entities":{"get":{"summary":"Active businesses this person may purchase for","tags":["store"],"description":"Each business with its `kind`: `self` is the organisation's own business (one per organisation), `managed` a business it runs for a client, so the Store can offer \"My organisation\" without guessing by name; `country` is where the business is (ISO 3166-1 alpha-2, upper case), or null when it was never said.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["self","managed"]},"country":{"type":["string","null"]}},"required":["id","label","kind","country"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/store/orders":{"post":{"summary":"Place an order","tags":["store"],"description":"Resolves the offer, finds or creates the buyer's organisation, takes payment as a plan unit or from the wallet, and creates the job. A paused offer is refused with CLD-E423; an existing plan keeps consuming (spec §18 item 9).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string","minLength":1,"maxLength":100},"status":{"default":"placed","type":"string","enum":["placed","draft"]},"org_id":{"type":"string","maxLength":100},"entity_id":{"type":"string","maxLength":100},"price_rule_id":{"type":"string","maxLength":100},"buyer":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":200}},"required":["email"]},"deployment_choice":{"default":"managed","type":"string","enum":["managed","customer_vpc","on_premise","self_hosted"]},"cell_id":{"type":"string","maxLength":100},"inputs":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":100}},"idempotency_key":{"type":"string","maxLength":200},"return_url":{"type":"string","maxLength":2000},"region":{"type":"string","maxLength":20},"milestones":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"default":"","type":"string","maxLength":2000},"due_at":{"type":"string","maxLength":40},"share_bp":{"type":"integer","minimum":1,"maximum":10000}},"required":["name","due_at","share_bp"]}},"promotion_code":{"type":"string","pattern":"^[A-Za-z0-9-]{3,40}$"}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion":{"type":"object","properties":{"slug":{"type":"string"},"display_text":{"type":"string"}},"required":["slug","display_text"],"additionalProperties":false},"status":{"type":"string"},"total_cents":{"type":"number"},"currency":{"type":"string"},"paid_with":{"type":"string"},"job_id":{"type":["string","null"]},"next":{"type":"string"},"id":{"type":"string"},"org_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}}},"required":["order_id","status","total_cents","currency","paid_with","job_id","next"],"additionalProperties":false}}}}}}},"/v1/store/orders/{id}/timeline":{"get":{"summary":"Everything the control plane knows about this order and its jobs, in order","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string"},"summary":{"type":"string"},"source":{"type":"object","properties":{"table":{"type":"string"},"id":{"type":"string"}},"required":["table","id"],"additionalProperties":false},"actor":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["at","kind","summary","source"],"additionalProperties":false}}},"required":["order_id","entries"],"additionalProperties":false}}}}}}},"/v1/store/orders/{id}":{"get":{"summary":"An order and what became of it","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"total_cents":{"type":"number"},"currency":{"type":"string"},"deployment_choice":{"type":"string"},"created_at":{"type":"string"},"memory_id":{"type":["string","null"]},"deployment_id":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}}},"required":["id","org_id","entity_id","status","status_reason","total_cents","currency","deployment_choice","created_at","memory_id","deployment_id","lines"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/entitlements":{"get":{"summary":"Plan units and credits this organisation still holds, where each is used and whether it is ready","tags":["store"],"description":"`where_used`: the deployments serving the purchase's offer or running its packs, each with its business (`entity_id`, `entity_label`) and the navigation entries it contributes. `overlaps`: other purchases here that run the same pack (`same_pack`) or produce the same record type (`same_capability`) — information, never a refusal. `readiness.state`: `setup_pending` (an order line waits on setup; `order_line_id` names it), `paused` (the offer, or every deployment using it), `route_missing` (a deployment whose pack requires a model has no model route) or `ready`. Each row names its plan (`subscription_id`, `next_renewal_at`), its window and units, its offer (`offer_sku`, `offer_name`, `offer_title`, `facets`) and its `state`; `?include=ended` adds used-up, expired and upcoming rows after the live ones (Desk gap 51).","parameters":[{"schema":{"type":"string","enum":["ended"]},"in":"query","name":"include","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"in":"query","name":"function","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"offer_id":{"type":["string","null"]},"remaining":{"type":"number"},"period_end":{"type":"string"},"period_start":{"type":"string"},"units_granted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"units_consumed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit":{"type":"string"},"state":{"type":"string","enum":["live","used_up","expired","upcoming"]},"subscription_id":{"type":["string","null"]},"subscription_status":{"type":["string","null"]},"next_renewal_at":{"type":["string","null"]},"bundle_offer_id":{"type":["string","null"]},"offer_sku":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"where_used":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"entity_label":{"type":["string","null"]},"entries":{"type":"array","items":{"type":"string"}}},"required":["deployment_id","entity_id","entity_label","entries"],"additionalProperties":false}},"overlaps":{"type":"array","items":{"type":"object","properties":{"entitlement_id":{"type":"string"},"offer_sku":{"type":["string","null"]},"reason":{"type":"string","enum":["same_capability","same_pack"]}},"required":["entitlement_id","offer_sku","reason"],"additionalProperties":false}},"readiness":{"type":"object","properties":{"state":{"type":"string","enum":["ready","setup_pending","route_missing","paused"]},"order_line_id":{"type":"string"}},"required":["state"],"additionalProperties":false},"shares_view_with":{"type":"array","items":{"type":"string"}},"shares_view":{"type":"boolean"}},"required":["id","kind","offer_id","remaining","period_end","period_start","units_granted","units_consumed","unit","state","subscription_id","subscription_status","next_renewal_at","bundle_offer_id","offer_sku","offer_title","offer_name","facets","where_used","overlaps","readiness","shares_view_with","shares_view"],"additionalProperties":false}},"counts":{"type":"object","properties":{"state":{"type":"object","properties":{"live":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"used_up":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["live","used_up","expired","upcoming"],"additionalProperties":false},"readiness":{"type":"object","properties":{"ready":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"setup_pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"route_missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["ready","setup_pending","paused","route_missing"],"additionalProperties":false}},"required":["state","readiness"],"additionalProperties":false},"functions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["slug","name","count"],"additionalProperties":false}},"shared_views":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["workspace","entry"]},"id":{"type":"string"},"label":{"type":"string"},"entitlement_ids":{"type":"array","items":{"type":"string"}}},"required":["kind","id","label","entitlement_ids"],"additionalProperties":false}},"filter":{"type":"object","properties":{"function":{"type":["string","null"]}},"required":["function"],"additionalProperties":false}},"required":["data","counts","functions","shared_views","filter"],"additionalProperties":false}}}}}},"post":{"summary":"Grant plan units or a credit (a billing reviewer or the founder)","tags":["store"],"description":"Units are money: each one runs an outcome the wallet is not charged for. So granting them is the platform's act, as a wallet credit is (`wallet.credit`: a billing reviewer or the founder, signed in), never an organisation's owner granting their own.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"units":{"type":"integer","minimum":1,"maximum":100000},"period_days":{"type":"integer","minimum":1,"maximum":1095},"kind":{"default":"plan","type":"string","enum":["plan","free_job","bundle"]},"offer_id":{"type":"string","maxLength":100},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["units","period_days"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/plans":{"get":{"summary":"Plans across cards this organisation holds, and what each has left this month","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"subscription_id":{"type":"string"},"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"price_rule_id":{"type":"string"},"status":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"next_renewal_at":{"type":["string","null"]},"grace_until":{"type":["string","null"]},"paid_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included":{"type":"number"},"used":{"type":"number"},"remaining":{"type":"number"},"window_end":{"type":["string","null"]},"overage_rule_id":{"type":["string","null"]},"included_unit":{"type":"string"}},"required":["offer_id","slug","title","name","included","used","remaining","window_end","overage_rule_id","included_unit"],"additionalProperties":false}},"monthly_cap_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"monthly_cap_currency":{"type":["string","null"]}},"required":["subscription_id","offer_id","slug","title","name","price_rule_id","status","period_start","period_end","next_renewal_at","grace_until","paid_cents","compare_at_cents","currency","members","monthly_cap_cents","monthly_cap_currency"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/plans/{id}":{"patch":{"summary":"Set a plan's monthly cap (an owner or administrator; never below the fee)","tags":["store"],"description":"The most this plan's work is charged in a calendar month (UTC), in the plan's currency (spec §14.2; issue #341). The buyer's to set (`orders.place`), never below the plan's fee (`CLD-E400`). Setting it lifts every trigger the cap paused on the plan's cards; the cells resume them on their next plan.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"monthly_cap_cents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["monthly_cap_cents"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"subscription_id":{"type":"string"},"monthly_cap_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_currency":{"type":"string"},"previous_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resumed":{"type":"array","items":{"type":"string"}}},"required":["subscription_id","monthly_cap_cents","monthly_cap_currency","previous_cents","resumed"],"additionalProperties":false}}}}}}},"/v1/admin/offers":{"post":{"summary":"Create or update an offer, or a family of variants, by permanent SKU or legacy slug (admin)","tags":["store"],"description":"A supplied `sku` identifies the offer through title and slug changes; otherwise upserts by `slug`. SKUs are immutable and a slug belonging to another SKU is a conflict. Makes the active price ladder equal to `price_rules`. `price_cents` is the `per_outcome` rule in the offer's currency, or 0. Rules absent from the body become inactive and are never deleted. Idempotent by content. `kind: family` applies `variants[]` as one offer each, with the family's ladder (ids suffixed `-<variant slug>`) overridden by `market_overrides[market]` and then the variant's own rules; a variant absent from the file is retired, never deleted; any refusal writes nothing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"title":{"type":"string","minLength":1,"maxLength":200},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"category":{"type":"string","minLength":1,"maxLength":60},"shelf":{"type":"string","enum":["pe","fund","finance","self_serve","rcm"]},"market":{"type":"string","enum":["in","us","sg","any"]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"publisher":{"default":"areev","type":"string","minLength":1,"maxLength":100},"certification":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"status":{"type":"string","enum":["proposed","concept","development","preview","ga","paused","deprecated","archived","draft","listed","retired"]},"status_reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"sale_markets":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["in","us","sg"]}},{"type":"null"}]},"pack_version_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":100}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"rebind":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"copy_version":{"type":"string","minLength":1,"maxLength":100}},"required":["reason","copy_version"],"additionalProperties":false},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quality_contract_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"succeeds":{"anyOf":[{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},{"type":"null"}]},"includes_free":{"anyOf":[{"maxItems":8,"type":"array","items":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},{"type":"null"}]},"price_rules":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","label","description"],"additionalProperties":false}},"economics":{"type":"object","properties":{"auto_credit_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"auto_credit_pct":{"type":"integer","minimum":0,"maximum":100}},"additionalProperties":false},"kind":{"default":"outcome","type":"string","enum":["outcome","bundle","cell"]},"cell_mode":{"anyOf":[{"type":"string","enum":["byoc","onprem","private"]},{"type":"null"}]},"members":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":100},"included_units":{"type":"integer","minimum":0,"maximum":100000},"overage_rule_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"member_rule_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":"integer","minimum":1,"maximum":10000},"included_unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]}},"required":["slug","included_units"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"function":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"jurisdiction":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"persona":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"channel":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}},"additionalProperties":false},"time_saved":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40},"minutes_per_outcome":{"type":"integer","minimum":1,"maximum":100000},"minutes_at_gate":{"type":"integer","minimum":0,"maximum":100000},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"study_n":{"type":"integer","minimum":20,"maximum":9007199254740991},"baseline":{"type":"string","minLength":1,"maxLength":200},"size_note":{"type":"string","minLength":1,"maxLength":80}},"required":["role","minutes_per_outcome","minutes_at_gate","basis"],"additionalProperties":false},{"type":"null"}]},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]}},"required":["slug","title","category","shelf","market","currency","status","price_rules"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["family"]},"family":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"title":{"type":"string","minLength":1,"maxLength":200},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"art_template":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["slug","title"],"additionalProperties":false},"price_rules":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}},"market_overrides":{"type":"object","properties":{"in":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}},"us":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}},"sg":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}},"any":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}}},"additionalProperties":false},"shared":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":60},"shelf":{"type":"string","enum":["pe","fund","finance","self_serve","rcm"]},"publisher":{"default":"areev","type":"string","minLength":1,"maxLength":100},"certification":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"facets":{"type":"object","properties":{"industry":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"function":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"jurisdiction":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"persona":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"channel":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}},"additionalProperties":false},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":100}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quality_contract_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"time_saved":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40},"minutes_per_outcome":{"type":"integer","minimum":1,"maximum":100000},"minutes_at_gate":{"type":"integer","minimum":0,"maximum":100000},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"study_n":{"type":"integer","minimum":20,"maximum":9007199254740991},"baseline":{"type":"string","minLength":1,"maxLength":200},"size_note":{"type":"string","minLength":1,"maxLength":80}},"required":["role","minutes_per_outcome","minutes_at_gate","basis"],"additionalProperties":false},{"type":"null"}]},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]}},"required":["category","shelf"],"additionalProperties":false},"variants":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"axes":{"type":"object","properties":{"market":{"type":"string","enum":["in","us","sg","any"]},"jurisdiction":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"tier":{"type":"string","minLength":1,"maxLength":30},"channel":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["market"],"additionalProperties":false},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"title":{"type":"string","minLength":1,"maxLength":200},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"status":{"type":"string","enum":["proposed","concept","development","preview","ga","paused","deprecated","archived","draft","listed","retired"]},"status_reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"sale_markets":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["in","us","sg"]}},{"type":"null"}]},"price_rules":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["per_outcome","per_result","plan","setup","care","bundle","value_share","usage","adhoc","retainer"]},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"units":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"period_days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"basis_points":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"label":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":2000},"sort_order":{"type":"integer","minimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"tiers":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"billing_cycle":{"type":"string","enum":["advance","arrears"]},"renews":{"type":"boolean"},"compare_at_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"tax_code":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"taxable":{"type":"boolean"},"max_units_per_submission":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000},{"type":"null"}]},"selection_group":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}]},"selection_label":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"max_records":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},{"type":"null"}]},"work_contract_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"unit_multiple":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]},"monthly_cap_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":1200},{"type":"null"}]},"release_cents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","label","description"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"function":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"jurisdiction":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"persona":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"channel":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}},"additionalProperties":false},"mark":{"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]}},"required":["axes","slug","title","currency","status"],"additionalProperties":false}}},"required":["kind","family","price_rules","shared","variants"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":"string"},"created":{"type":"boolean"},"kind":{"type":"string"},"members":{"type":"number"},"price_rules":{"type":"number"},"pack_version_id":{"type":["string","null"]},"orderable":{"type":"boolean"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]}},"required":["id","sku","slug","created","price_rules","pack_version_id","orderable","work_contract_id","quality_contract_id"],"additionalProperties":false},{"type":"object","properties":{"family_id":{"type":"string"},"slug":{"type":"string"},"created":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":"string"},"id":{"type":"string"},"created":{"type":"boolean"},"orderable":{"type":"boolean"},"price_rules":{"type":"number"}},"required":["sku","slug","id","created","orderable","price_rules"],"additionalProperties":false}},"retired":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"id":{"type":"string"}},"required":["sku","slug","id"],"additionalProperties":false}}},"required":["family_id","slug","created","variants","retired"],"additionalProperties":false}]}}}}}}},"/v1/store/families/{slug}":{"get":{"summary":"A family and the variants a product page may switch between","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"art_template":{"type":["string","null"]},"variants":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"market":{"type":"string"},"variant_axes":{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},"orderable":{"type":"boolean"}},"required":["sku","slug","market","variant_axes","orderable"],"additionalProperties":false}}},"required":["id","slug","title","art_template","variants"],"additionalProperties":false}}}}}}},"/v1/store/taxonomy":{"get":{"summary":"The catalogue's facets and their terms","tags":["store"],"description":"Public. Every facet with every term, retired terms included and marked. Answers an `ETag` over the body and `304` to a matching `If-None-Match`, as `store.json` does.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"facets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"terms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"parent":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","slug","name","parent","status"],"additionalProperties":false}}},"required":["id","label","terms"],"additionalProperties":false}}},"required":["facets"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/admin/taxonomy":{"post":{"summary":"Apply one facet's terms (admin)","tags":["store"],"description":"Makes the facet's active terms equal to `terms`: upserted by slug, parents resolved by slug within the body or the facet, and a term absent from the body retired, never deleted. Idempotent by content; send an `Idempotency-Key` to replay the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"facet":{"type":"string","minLength":1,"maxLength":40},"terms":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"name":{"type":"string","minLength":1,"maxLength":200},"parent":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},{"type":"null"}]},"sort_order":{"type":"integer","minimum":0,"maximum":1000000}},"required":["slug","name"],"additionalProperties":false}}},"required":["facet","terms"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"facet":{"type":"string"},"upserted":{"type":"number"},"retired":{"type":"number"},"changed":{"type":"number"}},"required":["facet","upserted","retired","changed"],"additionalProperties":false}}}}}}},"/v1/store/desk-workspaces":{"get":{"summary":"The Desk's workspaces: the ids a pack may group an entry under, their labels and order","tags":["store"],"description":"Public. Every workspace, retired ones included and marked, in order. Answers an `ETag` over the body and `304` to a matching `If-None-Match`, as the taxonomy does (ADR 0102).","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"sort_order":{"type":"number"},"status":{"type":"string","enum":["active","retired"]}},"required":["id","label","sort_order","status"],"additionalProperties":false}}},"required":["workspaces"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/admin/desk-workspaces":{"post":{"summary":"Apply the Desk's workspaces (admin)","tags":["store"],"description":"Makes the active workspaces exactly `workspaces`, in their order: upserted by id, and one absent from the body retired, never deleted — a certified pack may still group under it. Idempotent by content; send an `Idempotency-Key` to replay the answer. Applied from `catalogue/taxonomy/workspace.yaml` (ADR 0102).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["id","label"],"additionalProperties":false}}},"required":["workspaces"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"upserted":{"type":"number"},"retired":{"type":"number"},"changed":{"type":"number"}},"required":["upserted","retired","changed"],"additionalProperties":false}}}}}}},"/v1/store/marks":{"get":{"summary":"The icons and hues a product's mark may name","tags":["store"],"description":"Public. Both vocabularies, retired ids included and marked, in order. Answers an `ETag` and `304` as the taxonomy does (ADR 0070, ADR 0102). A name the Desk does not draw yet is drawn as its neutral mark.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"icons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sort_order":{"type":"number"},"status":{"type":"string","enum":["active","retired"]}},"required":["id","sort_order","status"],"additionalProperties":false}},"hues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sort_order":{"type":"number"},"status":{"type":"string","enum":["active","retired"]}},"required":["id","sort_order","status"],"additionalProperties":false}}},"required":["icons","hues"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/admin/marks":{"post":{"summary":"Apply the marks' vocabularies (admin)","tags":["store"],"description":"Makes the active icons and hues exactly the body's, each in its order; an id absent from the body is retired, never deleted — an applied offer may still carry it. Applied from `catalogue/marks.yaml` (ADR 0102). Send an `Idempotency-Key` to replay the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"icons":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"hues":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}},"required":["icons","hues"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"upserted":{"type":"number"},"retired":{"type":"number"},"changed":{"type":"number"}},"required":["upserted","retired","changed"],"additionalProperties":false}}}}}}},"/v1/store/markets":{"get":{"summary":"The markets an offer may be priced for and the currencies a price may be in","tags":["store"],"description":"Public. Every market (`any` is the pricing home, not a place to sell) and every currency with its minor units per major, retired rows included and marked. Answers an `ETag` and `304` as the taxonomy does (ADR 0102).","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"markets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"currency":{"type":["string","null"]},"zone":{"type":["string","null"]},"sellable":{"type":"boolean"},"sort_order":{"type":"number"},"status":{"type":"string","enum":["active","retired"]}},"required":["id","label","currency","zone","sellable","sort_order","status"],"additionalProperties":false}},"currencies":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"minor_per_major":{"type":"number"},"sort_order":{"type":"number"},"status":{"type":"string","enum":["active","retired"]}},"required":["code","minor_per_major","sort_order","status"],"additionalProperties":false}}},"required":["markets","currencies"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/admin/markets":{"post":{"summary":"Apply the markets and the currencies (admin)","tags":["store"],"description":"Makes the active markets and currencies exactly the body's; one absent is retired, never deleted. A market names a currency the body lists, and one that sells names its residency zone; a currency's minor units per major never change once it exists (`CLD-E409`). Applied from `catalogue/markets.yaml` (ADR 0102). A market the code's list does not hold yet is recorded and sells nothing until its constraint-swap migration ships. Send an `Idempotency-Key`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"markets":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,15}$"},"label":{"type":"string","minLength":1,"maxLength":100},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"zone":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,15}$"},{"type":"null"}]},"sellable":{"type":"boolean"}},"required":["id","label","sellable"],"additionalProperties":false}},"currencies":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{3}$"},"minor_per_major":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[10]},{"type":"number","enum":[100]},{"type":"number","enum":[1000]}]}},"required":["code","minor_per_major"],"additionalProperties":false}}},"required":["markets","currencies"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"upserted":{"type":"number"},"retired":{"type":"number"},"changed":{"type":"number"}},"required":["upserted","retired","changed"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/lifecycle":{"post":{"summary":"Move an offer through its lifecycle (admin)","tags":["store"],"description":"`proposed`, `concept`, `development`, `preview`, `ga`, `paused`, `deprecated` or `archived`: the same SKU throughout (ADR 0041). `paused`, `deprecated` and `archived` say why (`reason`); an archived SKU never returns; `development` is accepted only where the environment sells development offers. `sale_markets` says where a ga offer is on sale (null: every market it is priced for); `preview_orgs` names the organisations that may order a preview, each by id or slug. Readiness is recomputed with the change. Send an `Idempotency-Key` to replay the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["proposed","concept","development","preview","ga","paused","deprecated","archived"]},"reason":{"type":"string","minLength":1,"maxLength":500},"sale_markets":{"anyOf":[{"minItems":1,"type":"array","items":{"type":"string","enum":["in","us","sg"]}},{"type":"null"}]},"preview_orgs":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["state"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"lifecycle":{"type":"string","enum":["proposed","concept","development","preview","ga","paused","deprecated","archived"]},"status_reason":{"type":["string","null"]},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"preview_orgs":{"type":"array","items":{"type":"string"}},"ready":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false}},"required":["offer_id","sku","lifecycle","status_reason","sale_markets","preview_orgs","ready","orderable_in"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/sale-state":{"post":{"summary":"Deprecated: set an offer's sale state in one market (admin)","tags":["store"],"description":"Deprecated by `POST /v1/admin/offers/{sku}/lifecycle` (ADR 0041) and answering until the sunset date in its headers. `listed` puts the offer on sale (`ga`) in the market, `coming` makes it a `concept`, `by_invitation` a `preview`, `paused` pauses it; the old row is still written for the drift digest.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":"string","enum":["in","us","sg"]},"state":{"type":"string","enum":["coming","by_invitation","listed","paused"]},"opens_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"cohort":{"type":"string","minLength":1,"maxLength":60},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["market","state"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"sale_state":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["market","state","opens_at","cohort","reason"],"additionalProperties":false},"ready":{"type":"boolean"},"orderable_in_market":{"type":"boolean"}},"required":["offer_id","sku","sale_state","ready","orderable_in_market"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/readiness":{"get":{"summary":"Why an offer is or is not ready to sell, and its lifecycle (admin)","tags":["store"],"description":"Six checks — pack bound, economics row, golden set, measured quality, jurisdiction proof, provider readiness — as the `offer-readiness` sweep last computed them; `?recompute=true` measures the offer's jobs and computes them now. `detail` names what is missing in plain words; `records` is what the three checks selling earns read: the economics row measured from passed jobs, the job count on the busiest release tuple, and the jurisdiction evidence. `sale_states` is the deprecated 0123 vocabulary.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"recompute","required":false},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"lifecycle":{"type":"string"},"status_reason":{"type":["string","null"]},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"preview_orgs":{"type":"array","items":{"type":"string"}},"preview_org_slugs":{"type":"array","items":{"type":"string"}},"ready":{"type":"boolean"},"checks":{"anyOf":[{"type":"object","properties":{"pack_bound":{"type":"boolean"},"economics_row":{"type":"boolean"},"golden_set":{"type":"boolean"},"measured_quality":{"type":"boolean"},"jurisdiction_proof":{"type":"boolean"},"provider_readiness":{"type":"boolean"}},"required":["pack_bound","economics_row","golden_set","measured_quality","jurisdiction_proof","provider_readiness"],"additionalProperties":false},{"type":"null"}]},"detail":{"type":"array","items":{"type":"string"}},"computed_at":{"type":["string","null"]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["market","state","opens_at","cohort","reason"],"additionalProperties":false}},"records":{"type":"object","properties":{"economics":{"anyOf":[{"type":"object","properties":{"measured_jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"release_tuple":{"type":["string","null"]},"window_start":{"type":["string","null"]},"window_end":{"type":["string","null"]},"cost_per_outcome_usd_micros":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"model_usd_micros":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"eval_usd_micros":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fee_per_outcome_minor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fee_currency":{"type":["string","null"]},"measured_at":{"type":["string","null"]}},"required":["measured_jobs","release_tuple","window_start","window_end","cost_per_outcome_usd_micros","model_usd_micros","eval_usd_micros","fee_per_outcome_minor","fee_currency","measured_at"],"additionalProperties":false},{"type":"null"}]},"quality":{"type":"object","properties":{"jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minimum_jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"release_tuple":{"type":["string","null"]},"measured":{"type":"boolean"}},"required":["jobs","minimum_jobs","release_tuple","measured"],"additionalProperties":false},"jurisdiction_evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"market":{"type":"string"},"jurisdiction":{"type":"string"},"document_ref":{"type":"string"},"sha256":{"type":"string"},"note":{"type":["string","null"]},"created_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","market","jurisdiction","document_ref","sha256","note","created_by","created_at"],"additionalProperties":false}}},"required":["economics","quality","jurisdiction_evidence"],"additionalProperties":false}},"required":["offer_id","sku","lifecycle","status_reason","sale_markets","preview_orgs","preview_org_slugs","ready","checks","detail","computed_at","sale_states","records"],"additionalProperties":false}}}}}}},"/v1/store/interest":{"post":{"summary":"Join a concept's waitlist, ask for early access, or offer feedback","tags":["store"],"description":"What a visitor does on a concept or a preview card (ADR 0041): an email, a name, a few words and the intent. Never a purchase, never a charge; the same person asking twice keeps one row. Thirty a minute from one address; no credential.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"topic":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"intent":{"type":"string","enum":["waitlist","early_access","feedback"]},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":120},"company":{"type":"string","minLength":1,"maxLength":200},"note":{"type":"string","minLength":1,"maxLength":1000}},"required":["intent","email"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"topic":{"type":["string","null"]},"intent":{"type":"string"}},"required":["id","sku","topic","intent"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/interest":{"get":{"summary":"What visitors asked of an offer: the waitlist, early-access asks, feedback offers (admin)","tags":["store"],"parameters":[{"schema":{"default":100,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"interest":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"offer_id":{"type":"string"},"intent":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"org_id":{"type":["string","null"]},"note":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","offer_id","intent","email","name","org_id","note","created_at"],"additionalProperties":false}}},"required":["offer_id","sku","interest"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/jurisdiction-evidence":{"post":{"summary":"Attest that an offer's jurisdiction holds in a market (the founder)","tags":["store"],"description":"Records a reference to the document that proves it — an `https` link or an object key, never the document — with its sha256 and a note, for one jurisdiction term the offer carries and one market it is priced for. The founder only, signed in: no credential may attest. Append-only and audited (`offer.jurisdiction_evidence_attached`); readiness is recomputed with it and `catalog.changed` is sent when it flips. Send an `Idempotency-Key` to replay the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":"string","enum":["in","us","sg"]},"jurisdiction":{"type":"string","minLength":1,"maxLength":100},"document_ref":{"type":"string","minLength":1,"maxLength":500},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"note":{"type":"string","minLength":1,"maxLength":1000}},"required":["market","jurisdiction","document_ref","sha256"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"evidence":{"type":"object","properties":{"id":{"type":"string"},"market":{"type":"string"},"jurisdiction":{"type":"string"},"document_ref":{"type":"string"},"sha256":{"type":"string"},"note":{"type":["string","null"]},"created_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","market","jurisdiction","document_ref","sha256","note","created_by","created_at"],"additionalProperties":false},"ready":{"type":"boolean"},"jurisdiction_proof":{"type":"boolean"}},"required":["evidence","ready","jurisdiction_proof"],"additionalProperties":false}}}}}},"get":{"summary":"The jurisdiction evidence attested for an offer (admin)","tags":["store"],"description":"Every attestation, newest first: market, jurisdiction, the document's reference and sha256, who and when.","parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"market":{"type":"string"},"jurisdiction":{"type":"string"},"document_ref":{"type":"string"},"sha256":{"type":"string"},"note":{"type":["string","null"]},"created_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","market","jurisdiction","document_ref","sha256","note","created_by","created_at"],"additionalProperties":false}}},"required":["offer_id","sku","evidence"],"additionalProperties":false}}}}}}},"/v1/admin/offers/{sku}/content":{"post":{"summary":"Store an offer's copy in one locale as a new version (admin)","tags":["store"],"description":"Validated against the offer-content schema the Store publishes and Cloud pins, and refused when it says tokens, credits or compute. The same words again answer the version they already are (`created: false`); different words are the next version, and earlier versions stay. Send an `Idempotency-Key` to replay the answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["locale","body"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string"},"sku":{"type":"string"},"locale":{"type":"string"},"version":{"type":"number"},"sha256":{"type":"string"},"created":{"type":"boolean"}},"required":["offer_id","sku","locale","version","sha256","created"],"additionalProperties":false}}}}}}},"/v1/admin/offers/batch":{"post":{"summary":"Plan or apply the catalogue in one call, writing only rows whose digest changed (admin)","tags":["store"],"description":"`rows[]` (1 to 500) of `{kind: offer, digest, body}` (the body `POST /v1/admin/offers` takes, a family file included), `{kind: sale_state, digest, sku, body}` (the sale-state body) and `{kind: content, digest, sku, body: {locale, body}}`. `digest` is sha256 over the canonical JSON of `body` as sent (`catalogueDigest` in the SDK); a row whose digest is not the server's own hash of its body is refused `CLD-E400 digest-mismatch`. Each row is `new`, `changed`, `unchanged` (the stored digest is this one), `drift` (the stored digest is this one but the registry has changed since — a single route was used) or `refused` with its `CLD-Exxx`. `mode: plan` (default) writes nothing; `mode: apply` writes `new` and `changed` rows, each in its own transaction, four at a time, offers before bundles before sale states before content, then enqueues one `catalog.changed` naming every offer written. The answer is 200 even with refused rows; 400 only for an invalid envelope. Send an `Idempotency-Key` to replay the whole report.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"default":"plan","type":"string","enum":["plan","apply"]},"rows":{"minItems":1,"maxItems":500,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["offer"]},"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","digest","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["sale_state"]},"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","digest","sku","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["content"]},"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{8}$"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","digest","sku","body"],"additionalProperties":false}]}}},"required":["rows"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["plan","apply"]},"summary":{"type":"object","properties":{"new":{"type":"number"},"changed":{"type":"number"},"unchanged":{"type":"number"},"drift":{"type":"number"},"refused":{"type":"number"}},"required":["new","changed","unchanged","drift","refused"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"kind":{"type":"string","enum":["offer","family","sale_state","content"]},"sku":{"type":["string","null"]},"slug":{"type":["string","null"]},"outcome":{"type":"string","enum":["new","changed","unchanged","drift","refused"]},"code":{"type":"string"},"message":{"type":"string"},"digest":{"type":"string"}},"required":["index","kind","sku","slug","outcome","digest"],"additionalProperties":false}}},"required":["mode","summary","rows"],"additionalProperties":false}}}}}}},"/v1/admin/release-approvals":{"post":{"summary":"Record a signed production release (admin)","tags":["store"],"description":"One row of `catalogue/releases.yaml` as `areevc catalogue sign-release` wrote it (ADR 0100). The digest is recomputed over `sku`, the sorted `markets`, `date`, the lower-cased `approved_by` and `note`; a row whose digest differs is refused `CLD-E422` naming the field. Recording a digest already held answers `created: false` and writes nothing. Audited `release.approved`. On production a selling lifecycle (`preview`, `ga`) is refused for a SKU with no recorded release dated today or earlier for its market.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"markets":{"type":"array","items":{"type":"string","enum":["in","us","sg"]}},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"approved_by":{"type":"string","minLength":3,"maxLength":200},"note":{"type":"string","maxLength":500},"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["sku","date","approved_by","digest"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"release":{"type":"object","properties":{"digest":{"type":"string"},"sku":{"type":"string"},"markets":{"type":"array","items":{"type":"string"}},"date":{"type":"string"},"approved_by":{"type":"string"},"note":{"type":"string"},"applied_by":{"type":"string"},"applied_at":{"type":"string"}},"required":["digest","sku","markets","date","approved_by","note","applied_by","applied_at"],"additionalProperties":false}},"required":["created","release"],"additionalProperties":false}}}}}},"get":{"summary":"The production releases this control plane has recorded (admin)","tags":["store"],"parameters":[{"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"in":"query","name":"sku","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"digest":{"type":"string"},"sku":{"type":"string"},"markets":{"type":"array","items":{"type":"string"}},"date":{"type":"string"},"approved_by":{"type":"string"},"note":{"type":"string"},"applied_by":{"type":"string"},"applied_at":{"type":"string"}},"required":["digest","sku","markets","date","approved_by","note","applied_by","applied_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/release-approvers":{"get":{"summary":"Who may approve a production release now, as this control plane holds it (admin)","tags":["store"],"description":"The founders by configuration and every current `release_approver` platform role, by email, for `areevc catalogue drift` to compare with `catalogue/approvers.yaml` (ADR 0100).","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["founder","release_approver"]},"expires_at":{"type":["string","null"]}},"required":["email","role","expires_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/quality":{"get":{"summary":"How this agent has actually performed, per version","tags":["jobs"],"description":"Per release tuple, because a rate averaged across two versions of an agent describes neither. Below the minimum the figures are withheld: a rate over a handful of jobs is noise, and a number on a page is read as a fact however it is hedged.","parameters":[{"schema":{"default":90,"type":"integer","minimum":1,"maximum":365},"in":"query","name":"days","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"current_release":{"type":"string"},"minimum_jobs":{"type":"number"},"learning":{"anyOf":[{"type":"object","properties":{"corrections_per_100_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"corrections_per_100_after":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lessons_applied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"verify":{"type":"object","properties":{"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"regressed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held","regressed"],"additionalProperties":false},"learned_state_sha256":{"type":["string","null"]}},"required":["corrections_per_100_before","corrections_per_100_after","lessons_applied","verify","learned_state_sha256"],"additionalProperties":false},{"type":"null"}]},"versions":{"type":"array","items":{"type":"object","properties":{"release_tuple":{"type":"string"},"current":{"type":"boolean"},"jobs":{"type":"number"},"measured":{"type":"boolean"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"correction_rate":{"type":["number","null"]},"reversal_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"first_seen":{"type":["string","null"]},"last_seen":{"type":["string","null"]},"note":{"type":"string"},"evaluation":{"anyOf":[{"type":"object","properties":{"sampled":{"type":"number"},"scored":{"type":"number"},"mean_score":{"type":["number","null"]},"gate_loose":{"type":"number"}},"required":["sampled","scored","mean_score","gate_loose"],"additionalProperties":false},{"type":"null"}]},"health":{"anyOf":[{"type":"string","enum":["ok","watch","paused"]},{"type":"null"}]}},"required":["release_tuple","current","jobs","measured","pass_rate","abstain_rate","correction_rate","reversal_rate","median_wall_ms","first_seen","last_seen","note","evaluation","health"],"additionalProperties":false}}},"required":["deployment_id","current_release","minimum_jobs","learning","versions"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/receipt":{"get":{"summary":"A quality receipt: what was checked, what it cost, what to do if it is wrong","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string"},"release_tuple":{"type":"string"},"quality":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"charged_cents":{"type":"number"},"currency":{"type":"string"},"evidence_available":{"type":"boolean"},"corrections":{"type":"number"},"what_was_checked":{"type":"array","items":{"type":"string"}},"if_this_is_wrong":{"type":"string"},"time_saved":{"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"time_saved_line":{"type":["string","null"]}},"required":["job_id","status","release_tuple","quality","charged_cents","currency","evidence_available","corrections","what_was_checked","if_this_is_wrong","time_saved","time_saved_line"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/learning-ledger":{"get":{"summary":"What your agents have been taught, and by whom","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"deployment_id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["correction","lesson","recommendation"]},"id":{"type":"string"},"deployment_id":{"type":"string"},"summary":{"type":"string"},"by":{"type":"string"},"at":{"type":"string"},"status":{"type":"string"},"scope":{"type":["string","null"]},"reviewed_by":{"type":["string","null"]}},"required":["kind","id","deployment_id","summary","by","at","status","scope","reviewed_by"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/economics":{"get":{"summary":"Cost per verified outcome against price, per offer","tags":["ledger"],"parameters":[{"schema":{"default":30,"type":"integer","minimum":1,"maximum":365},"in":"query","name":"days","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"deployment_id":{"type":"string"},"jobs":{"type":"number"},"passed":{"type":"number"},"charged_cents":{"type":"number"},"internal_cost_usd_micros":{"type":"number"},"model_cost_usd_micros":{"type":"number"},"infra_cost_usd_micros":{"type":"number"},"decision_cost_usd_micros":{"type":"number"},"decision_calls":{"type":"number"},"wall_seconds":{"type":"number"},"cpu_seconds":{"type":"number"},"cost_per_outcome_usd_micros":{"type":["number","null"]},"margin_cents":{"type":"number"},"health":{"type":"string"}},"required":["deployment_id","jobs","passed","charged_cents","internal_cost_usd_micros","model_cost_usd_micros","infra_cost_usd_micros","decision_cost_usd_micros","decision_calls","wall_seconds","cpu_seconds","cost_per_outcome_usd_micros","margin_cents","health"],"additionalProperties":false}}},"required":["days","rows"],"additionalProperties":false}}}}}}},"/v1/golden-candidates":{"get":{"summary":"Golden candidates from opted-in organisations, newest first","tags":["quality"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"pack","required":false},{"schema":{"type":"string","enum":["pending_export","exported","reviewed","rejected"]},"in":"query","name":"status","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"pack_version_id":{"type":"string"},"cluster_key":{"type":"string"},"correction_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"job_id_hashes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending_export","exported","reviewed","rejected"]},"export_key":{"type":["string","null"]},"export_sha256":{"type":["string","null"]},"export_cases":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"export_policy":{"anyOf":[{"type":"string","enum":["declared","floor"]},{"type":"null"}]},"exported_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]},"review_decision":{"anyOf":[{"type":"string","enum":["accepted","rejected"]},{"type":"null"}]},"review_reason":{"type":["string","null"]},"reviewed_by":{"type":["string","null"]},"reviewed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","deployment_id","pack_name","pack_version_id","cluster_key","correction_count","job_id_hashes","status","export_key","export_sha256","export_cases","export_policy","exported_at","cell_error","review_decision","review_reason","reviewed_by","reviewed_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/golden-candidates/{id}":{"get":{"summary":"One golden candidate, and the cell Gateway its export is read from","tags":["quality"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"pack_version_id":{"type":"string"},"cluster_key":{"type":"string"},"correction_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"job_id_hashes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending_export","exported","reviewed","rejected"]},"export_key":{"type":["string","null"]},"export_sha256":{"type":["string","null"]},"export_cases":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"export_policy":{"anyOf":[{"type":"string","enum":["declared","floor"]},{"type":"null"}]},"exported_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]},"review_decision":{"anyOf":[{"type":"string","enum":["accepted","rejected"]},{"type":"null"}]},"review_reason":{"type":["string","null"]},"reviewed_by":{"type":["string","null"]},"reviewed_at":{"type":["string","null"]},"created_at":{"type":"string"},"cell_id":{"type":"string"},"gateway_url":{"type":["string","null"]}},"required":["id","org_id","deployment_id","pack_name","pack_version_id","cluster_key","correction_count","job_id_hashes","status","export_key","export_sha256","export_cases","export_policy","exported_at","cell_error","review_decision","review_reason","reviewed_by","reviewed_at","created_at","cell_id","gateway_url"],"additionalProperties":false}}}}}}},"/v1/golden-candidates/{id}/review":{"post":{"summary":"Record the pack owner's decision on a golden candidate","tags":["quality"],"description":"`accepted` on an exported candidate the reviewer appended to the pack's golden set (`areevc golden review --accept`); `rejected` on one pending or exported. A decided candidate is `CLD-E409`. Nothing is published: the case reaches other customers only as a new pack version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["accepted","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["decision","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":"string"},"pack_version_id":{"type":"string"},"cluster_key":{"type":"string"},"correction_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"job_id_hashes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending_export","exported","reviewed","rejected"]},"export_key":{"type":["string","null"]},"export_sha256":{"type":["string","null"]},"export_cases":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"export_policy":{"anyOf":[{"type":"string","enum":["declared","floor"]},{"type":"null"}]},"exported_at":{"type":["string","null"]},"cell_error":{"type":["string","null"]},"review_decision":{"anyOf":[{"type":"string","enum":["accepted","rejected"]},{"type":"null"}]},"review_reason":{"type":["string","null"]},"reviewed_by":{"type":["string","null"]},"reviewed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","deployment_id","pack_name","pack_version_id","cluster_key","correction_count","job_id_hashes","status","export_key","export_sha256","export_cases","export_policy","exported_at","cell_error","review_decision","review_reason","reviewed_by","reviewed_at","created_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/installations":{"post":{"summary":"Order an installation, priced on deliverables with dates","tags":["store"],"description":"The milestone shares are the refund schedule, so they must sum to the whole price. Half is charged at order and half at the final milestone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"description":"The offer whose `setup` rule prices the installation; required","type":"string","maxLength":100},"price_cents":{"description":"Optional confirmation: refused with CLD-E409 unless it equals the rule's amount","type":"integer","minimum":0,"maximum":100000000},"currency":{"description":"The wallet it is paid from; the organisation's first wallet's currency when omitted","type":"string","pattern":"^[A-Z]{3}$"},"milestones":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"default":"","type":"string","maxLength":2000},"due_at":{"type":"string","maxLength":40},"share_bp":{"type":"integer","minimum":1,"maximum":10000}},"required":["name","due_at","share_bp"]}}},"required":["milestones"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"price_cents":{"type":"number"},"currency":{"type":"string"},"waived":{"type":"boolean"},"waived_reason":{"type":"string"},"chargeable_now_cents":{"type":"number"},"charged_cents":{"type":"number"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"}},"required":["id","kind","amount_cents","currency"],"additionalProperties":false}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sequence":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"due_at":{"type":"string"},"share_bp":{"type":"number"},"status":{"type":"string"},"met_at":{"type":["string","null"]},"signed_off_by":{"type":["string","null"]}},"required":["id","sequence","name","description","due_at","share_bp","status","met_at","signed_off_by"],"additionalProperties":false}}},"required":["id","price_cents","currency","waived","waived_reason","chargeable_now_cents","charged_cents","entries","milestones"],"additionalProperties":false}}}}}},"get":{"summary":"Installations and their milestones","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"price_cents":{"type":"number"},"currency":{"type":"string"},"waived":{"type":"boolean"},"status":{"type":"string"},"created_at":{"type":"string"},"charged_cents":{"type":"number"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"}},"required":["id","kind","amount_cents","currency"],"additionalProperties":false}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sequence":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"due_at":{"type":"string"},"share_bp":{"type":"number"},"status":{"type":"string"},"met_at":{"type":["string","null"]},"signed_off_by":{"type":["string","null"]}},"required":["id","sequence","name","description","due_at","share_bp","status","met_at","signed_off_by"],"additionalProperties":false}}},"required":["id","price_cents","currency","waived","status","created_at","charged_cents","entries","milestones"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/installations/{id}/milestones/{milestone}/sign-off":{"post":{"summary":"Sign off a milestone, or record that it was missed","tags":["store"],"description":"A named person signs a milestone off. \"The system marked it complete\" is not sign-off, and a missed milestone refunds its share of the price. The organisation's admin signs a milestone off as `met`, which is what charges it; `missed` and `waived` credit or forgo part of the price and are a billing reviewer's, outside the organisation (`installations.settle`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["met","missed","waived"]},"note":{"type":"string","maxLength":1000}},"required":["outcome"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"milestone","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"installation_status":{"type":"string"},"chargeable_now_cents":{"type":"number"},"refund_cents":{"type":"number"},"refund_reason":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"}},"required":["id","kind","amount_cents","currency"],"additionalProperties":false}},"charged_cents":{"type":"number"},"credited_cents":{"type":"number"}},"required":["id","status","installation_status","chargeable_now_cents","refund_cents","refund_reason","entries","charged_cents","credited_cents"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/care":{"post":{"summary":"Start a care plan","tags":["store"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"default":"","type":"string","maxLength":2000},"fee_cents":{"description":"Optional confirmation: refused with CLD-E409 unless it equals the care rule's amount","type":"integer","minimum":0,"maximum":10000000},"period":{"description":"Optional confirmation: the care rule's period_days decides it","type":"string","enum":["monthly","annual"]},"offer_id":{"description":"The offer whose `care` rule prices the plan; required","type":"string","maxLength":100},"notice_days":{"default":30,"type":"integer","minimum":0,"maximum":120},"currency":{"description":"The wallet it is paid from; the organisation's first wallet's currency when omitted","type":"string","pattern":"^[A-Z]{3}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"period_end":{"type":"string"},"notice_days":{"type":"number"},"currency":{"type":"string"},"entry_id":{"type":["string","null"]}},"required":["id","period_end","notice_days","currency","entry_id"],"additionalProperties":false}}}}}},"get":{"summary":"Care plans, with what renews and when","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string"},"fee_cents":{"type":"number"},"period":{"type":"string"},"status":{"type":"string"},"period_end":{"type":"string"},"notice_days":{"type":"number"},"renewal_notice_due":{"type":"boolean"},"renewal_note":{"type":"string"}},"required":["id","scope","fee_cents","period","status","period_end","notice_days","renewal_notice_due","renewal_note"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/care/{id}":{"delete":{"summary":"Cancel a care plan. The unused part is refunded pro rata","tags":["store"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"default":"cancelled by the customer","type":"string","maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"refund_cents":{"type":"number"},"days_remaining":{"type":"number"},"entry_id":{"type":["string","null"]}},"required":["id","refund_cents","days_remaining","entry_id"],"additionalProperties":false}}}}}}},"/v1/pack-versions/{id}/help/{*}":{"get":{"summary":"A help file a pack version ships","tags":["packs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"org","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pack":{"type":"string"},"version":{"type":"string"},"path":{"type":"string"},"media_type":{"type":"string","enum":["text/yaml","text/markdown"]},"content":{"type":"string"}},"required":["pack","version","path","media_type","content"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/packs":{"post":{"summary":"Publish a pack version","tags":["packs"],"description":"Validates the manifest, computes an executor pin per code-carrying tool from the exact bytes in the archive, and runs the certification checklist. A published version is immutable.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"manifest":{},"files":{"default":[],"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":500},"content_base64":{"type":"string"}},"required":["path","content_base64"]}},"first_party":{"default":false,"type":"boolean"},"pin":{"default":false,"type":"boolean"}},"required":["manifest"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"string"},"manifest_sha256":{"type":"string"},"executor_pins":{"type":"array","items":{"type":"string"}},"plan_hashes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"certification":{"type":"object","properties":{"certified":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"message":{"type":"string"}},"required":["check","message"],"additionalProperties":false}}},"required":["certified","findings"],"additionalProperties":false},"version_rule":{"default":null,"anyOf":[{"type":"object","properties":{"previous":{"type":"string"},"declared":{"type":"string"},"required":{"type":"string","enum":["patch","minor","major"]},"changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}}},"required":["previous","declared","required","changes"],"additionalProperties":false},{"type":"null"}]},"upgrades_opened":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","version","manifest_sha256","executor_pins","plan_hashes","certification","version_rule","upgrades_opened"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"detail":{}},"required":["code","message","detail"],"additionalProperties":false}}}}}},"get":{"summary":"Packs visible to an organisation, plus the public registry","tags":["packs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string"},"versions":{"type":"number"}},"required":["id","name","visibility","versions"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/deployments":{"post":{"summary":"Install a pack version into a memory","tags":["packs"],"description":"Returns 202: a worker inside the cell seeds the grains, pins the tool blobs and writes the grants. The control plane records the release tuple, which is what every job stamps.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_name":{"type":"string","minLength":1},"pack_version":{"type":"string","minLength":1},"memory_id":{"type":"string","minLength":1},"overlay":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"model_route_id":{"type":"string"}},"required":["pack_name","pack_version","memory_id"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"principal":{"type":"string"},"release_tuple_sha256":{"type":"string"},"executor_pins":{"type":"array","items":{"type":"string"}}},"required":["id","status","principal","release_tuple_sha256","executor_pins"],"additionalProperties":false}}}}}},"get":{"summary":"Deployments in an organisation","tags":["packs"],"parameters":[{"schema":{"type":"string","enum":["system"]},"in":"query","name":"include","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"data_domains":{"default":[],"type":"array","items":{"type":"string"}},"pack_version_id":{"type":"string"},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"offer":{"default":null,"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"slug":{"type":["string","null"]},"name":{"type":["string","null"]},"title":{"type":"string"},"price":{"default":null,"anyOf":[{"type":"object","properties":{"rule_id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"unit":{"type":["string","null"]},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rule_id","kind","amount_cents","currency","label","description","unit","unit_multiple"],"additionalProperties":false},{"type":"null"}]}},"required":["id","sku","slug","name","title","price"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"principal":{"type":"string"},"release_tuple_sha256":{"type":"string"},"cloned_from":{"default":null,"type":["string","null"]}},"required":["id","memory_id","data_domains","pack_version_id","pack","offer","status","status_reason","principal","release_tuple_sha256","cloned_from"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}":{"get":{"summary":"One deployment","tags":["packs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"data_domains":{"default":[],"type":"array","items":{"type":"string"}},"pack_version_id":{"type":"string"},"offer":{"default":null,"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"slug":{"type":["string","null"]},"name":{"type":["string","null"]},"title":{"type":"string"},"price":{"default":null,"anyOf":[{"type":"object","properties":{"rule_id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"unit":{"type":["string","null"]},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rule_id","kind","amount_cents","currency","label","description","unit","unit_multiple"],"additionalProperties":false},{"type":"null"}]}},"required":["id","sku","slug","name","title","price"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"paused_reason":{"default":null,"type":["string","null"]},"trigger_daily_cap":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"principal":{"type":"string"},"release_tuple_sha256":{"type":"string"},"executor_pins":{"type":"array","items":{"type":"string"}},"overlay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"upgrade_policy":{"default":"auto","type":"string"},"cloned_from":{"default":null,"type":["string","null"]},"clone_reason":{"default":null,"type":["string","null"]},"overlay_version":{"default":1,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"overlay_change":{"default":null,"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"release_tuple_sha256":{"type":"string"}},"required":["id","status","release_tuple_sha256"],"additionalProperties":false},{"type":"null"}]},"learned_state_sha256":{"default":null,"type":["string","null"]},"settings_fields":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","integer","boolean","upload","upload[]","object","string[]","enum"]},"required":{"type":"boolean"},"description":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"max_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_length":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","label","type","required"],"additionalProperties":false}}},"required":["id","org_id","memory_id","data_domains","pack_version_id","offer","status","status_reason","paused_reason","trigger_daily_cap","principal","release_tuple_sha256","executor_pins","overlay","upgrade_policy","cloned_from","clone_reason","overlay_version","overlay_change","learned_state_sha256","settings_fields"],"additionalProperties":false}}}}}}},"/v1/packs/{id}/deprecate":{"post":{"summary":"Deprecate a pack version","tags":["packs"],"description":"A deprecated version installs nowhere new. With `sunset_at`, a deployment still on it takes no new job after that instant (`CLD-E425`, naming the upgrade that lifts it); runs in flight finish and past evidence stays verifiable (ADR 0031 item 4).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"sunset_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deprecated":{"type":"boolean"},"sunset_at":{"default":null,"type":["string","null"]}},"required":["deprecated","sunset_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deployments/{deployment}/firings":{"post":{"summary":"Turn trigger firings into jobs (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firings":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","minLength":1,"maxLength":128},"trigger":{"type":"string","minLength":1,"maxLength":200},"connector":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"fired_at":{"type":"string","maxLength":64},"workflow":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"input":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9:._-]{0,199}$"}}},"required":["run_id","trigger","fired_at"]}}},"required":["firings"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"deployment","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":0,"maximum":9007199254740991},"refused":{"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}},"required":["run_id","code","reason"],"additionalProperties":false}},"pause":{"type":["string","null"]}},"required":["created","duplicates","refused","pause"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deployments/{deployment}/report":{"post":{"summary":"A cell reports the outcome of installing one deployment","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["active"]},"workflow_hashes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"tool_hashes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"trigger_ids":{"default":[],"type":"array","items":{"type":"string"}}},"required":["status","workflow_hashes","tool_hashes"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"deployment","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/deployments/{id}/overlay":{"patch":{"summary":"Change a deployment's settings (its overlay); the cell re-seeds them under a new release tuple","tags":["packs"],"description":"Validated against the version's overlay.schema.json (`CLD-E400` naming each path). The deployment takes a new release tuple at once and jobs not yet started are re-stamped with it; the cell re-seeds the settings as facts and the change moves from `requested` to `applied`. Refused `CLD-E425` while the deployment is paused and `CLD-E409` while an upgrade or another change is open.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"overlay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expected_version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["overlay"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"null"},"deployment_id":{"type":"string"},"release_tuple_sha256":{"type":"string"},"status":{"type":"string","enum":["unchanged"]},"overlay_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","deployment_id","release_tuple_sha256","status","overlay_version"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"release_tuple_sha256":{"type":"string"},"previous_release_tuple_sha256":{"type":"string"},"status":{"type":"string","enum":["requested"]},"overlay_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"keys_changed":{"type":"array","items":{"type":"string"}},"jobs_restamped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","deployment_id","release_tuple_sha256","previous_release_tuple_sha256","status","overlay_version","keys_changed","jobs_restamped"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/overlay-changes/{id}/report":{"post":{"summary":"A cell reports an overlay change it re-seeded (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["applied"]},"added":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"superseded":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"unchanged":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/clone":{"post":{"summary":"Install a trial copy of a deployment on another version of its pack","tags":["packs"],"description":"The source's settings, model route and learning policy, on the named published version of the same pack, in a memory of the same profile and business — the source's own when the two versions keep different namespaces, else `memory_id` when it can hold it, else another memory of that business or a new one on the same cell. The clone's triggers install paused, no order lands on it, it is never offered an upgrade and its policy is `manual`; jobs submitted to it are real jobs, held at queued and charged only when they pass. Settings the version refuses are `CLD-E400`; a missing connection `CLD-E427`; residency `CLD-E451`; the organisation's memory envelope `CLD-E429`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_version_id":{"type":"string","minLength":1,"maxLength":100},"reason":{"type":"string","minLength":3,"maxLength":500},"memory_id":{"type":"string","minLength":1,"maxLength":100}},"required":["pack_version_id","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"cloned_from":{"type":"string"},"clone_reason":{"type":"string"},"memory_id":{"type":"string"},"memory_created":{"type":"boolean"},"pack_version_id":{"type":"string"},"pack_version":{"type":"string"},"upgrade_policy":{"type":"string"},"release_tuple_sha256":{"type":"string"}},"required":["id","status","cloned_from","clone_reason","memory_id","memory_created","pack_version_id","pack_version","upgrade_policy","release_tuple_sha256"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/retire":{"post":{"summary":"Retire a deployment","tags":["packs"],"description":"The deployment takes no new work and its surfaces go; its memory, its evidence and every past job stay, and the next plan simply omits it. A trial copy (a clone) retires under `deployments.write`; any other deployment needs the organisation's owner or admin, or a credential with the admin scope. Refused `CLD-E409` for a deployment already retired, the platform's own, one with work still queued or in flight, and — for one that is not a clone — an upgrade in flight or an order waiting on it. Retiring never cancels a plan: when the organisation still holds an active plan on the deployment's offer and no other live deployment of that offer remains, the answer names it (`plan_still_active`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["retired"]},"plan_still_active":{"type":"object","properties":{"subscription_id":{"type":"string"},"next_renewal_at":{"type":["string","null"]}},"required":["subscription_id","next_renewal_at"],"additionalProperties":false}},"required":["id","status"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/reinstall":{"post":{"summary":"Install a failed deployment again","tags":["packs"],"description":"Returns 202: the deployment moves from `failed` back to `installing`, its cell installs it on its next plan, and every order waiting on it is looked at again (`orders_reset`). Requires Idempotency-Key; owner or admin, a credential with the admin scope, or the platform's operator. Refused `CLD-E409` unless the deployment is `failed` and its memory is `active` with no move under way and no legal hold.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["installing"]},"orders_reset":{"type":"array","items":{"type":"string"}}},"required":["id","status","orders_reset"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/deployments/{id}/credentials":{"post":{"summary":"Supply a credential the deployment's pack declares; its cell places it","tags":["packs"],"description":"`label` is one of the manifest's `credentials_declared` that no connection answers (`CLD-E400` otherwise). The value is sealed at once to the deployment's cell and never stored, logged or echoed in the clear; the cell collects it, places it in its own secret store and the control plane clears the envelope. A second call re-stages (a rotation). `CLD-E503` while the cell has not published the key credentials are sealed to.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,100}$"},"value":{"type":"string","minLength":1,"maxLength":8192}},"required":["label","value"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"staged":{"type":"boolean"},"placed_cells":{"type":"array","items":{"type":"string"}},"cells":{"type":"array","items":{"type":"string"}},"updated_at":{"type":["string","null"]}},"required":["label","staged","placed_cells","cells","updated_at"],"additionalProperties":false}}}}}},"get":{"summary":"The credentials a deployment declares, and where each is placed (never a value)","tags":["packs"],"description":"One row per typed credential the pack declares. `staged: false` with the deployment's cell missing from `placed_cells` means the value must be supplied (again): never supplied, or the memory moved to a cell that has not received it.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"staged":{"type":"boolean"},"placed_cells":{"type":"array","items":{"type":"string"}},"cells":{"type":"array","items":{"type":"string"}},"updated_at":{"type":["string","null"]}},"required":["label","staged","placed_cells","cells","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/staging-key":{"put":{"summary":"Publish the public half of the key this cell's staged credentials are sealed to","tags":["cells"],"description":"The cell mints an X25519 key pair once, keeps the private half in its own secret store and publishes the public half here (A10). The control plane holds nothing that opens an envelope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"public_key":{"type":"string","minLength":40,"maxLength":200}},"required":["public_key"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"boolean"}},"required":["changed"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/credentials/collect":{"post":{"summary":"Collect the deployment credentials sealed to this cell, and report the ones placed","tags":["cells"],"description":"Envelopes only, sealed to this cell's staging key; `collected` names what was placed since the last call, so the clear and the hand-out are one round trip (as connector tokens are, migration 0087).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collected":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":100}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"label":{"type":"string"},"secret_ref":{"type":"string"},"sealed":{"type":"string"}},"required":["id","org_id","deployment_id","label","secret_ref","sealed"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/voice-numbers":{"get":{"summary":"The numbers of the organisation's telephony accounts Areev may use, and what each is bound to","tags":["connectors"],"description":"Ticked from what the cell's voice service discovered (`GET {gateway}/v1/voice/numbers`). Each carries its series and the purposes the series permits; `entity` narrows to one business.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"provider":{"type":"string","enum":["plivo","vobiz"]},"series":{"type":"string","enum":["140","160","landline","mobile","tollfree","other"]},"purposes":{"type":"array","items":{"type":"string","enum":["service","transactional","promotional","bfsi_service"]}},"connector_id":{"type":"string"},"deployment_id":{"type":["string","null"]},"state":{"type":"string","enum":["available","enabled","retired"]},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string"}},"required":["number","org_id","entity_id","provider","series","purposes","connector_id","deployment_id","state","health","revision","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/voice-numbers/{number}":{"put":{"summary":"Tick a number Areev may use, bind it to a deployment, or retire it","tags":["connectors"],"description":"`number` is E.164 (`+91…`, URL-encoded). The purposes must be ones the number's series permits (a landline or a mobile series carries service and transactional calls, `140` promotional only, `160` BFSI service only), else `CLD-E400`. The connection must be this organisation's `plivo` or `vobiz` connection and the deployment this organisation's, in the same business. A change names the `expected_revision` it read (`CLD-E409` when stale); a new number names none. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["plivo","vobiz"]},"connector_id":{"type":"string","pattern":"^con_[0-9A-HJKMNP-TV-Z]{26}$"},"series":{"type":"string","enum":["140","160","landline","mobile","tollfree","other"]},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"purposes":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["service","transactional","promotional","bfsi_service"]}},"deployment_id":{"anyOf":[{"type":"string","pattern":"^dep_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"state":{"default":"enabled","type":"string","enum":["enabled","retired"]},"expected_revision":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","connector_id","series","entity_id","purposes","deployment_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"in":"path","name":"number","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"provider":{"type":"string","enum":["plivo","vobiz"]},"series":{"type":"string","enum":["140","160","landline","mobile","tollfree","other"]},"purposes":{"type":"array","items":{"type":"string","enum":["service","transactional","promotional","bfsi_service"]}},"connector_id":{"type":"string"},"deployment_id":{"type":["string","null"]},"state":{"type":"string","enum":["available","enabled","retired"]},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string"}},"required":["number","org_id","entity_id","provider","series","purposes","connector_id","deployment_id","state","health","revision","updated_at"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"org_id":{"type":"string"},"entity_id":{"type":["string","null"]},"provider":{"type":"string","enum":["plivo","vobiz"]},"series":{"type":"string","enum":["140","160","landline","mobile","tollfree","other"]},"purposes":{"type":"array","items":{"type":"string","enum":["service","transactional","promotional","bfsi_service"]}},"connector_id":{"type":"string"},"deployment_id":{"type":["string","null"]},"state":{"type":"string","enum":["available","enabled","retired"]},"health":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated_at":{"type":"string"}},"required":["number","org_id","entity_id","provider","series","purposes","connector_id","deployment_id","state","health","revision","updated_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/voice-bindings":{"get":{"summary":"The numbers this cell's voice service answers, each bound to a deployment (cell token)","tags":["cells"],"description":"Polled like webhook secrets. Number to deployment, organisation, business, provider, connection and purposes, with the deployment's call settings from its overlay. Only enabled numbers bound to an active deployment whose memory is in this cell; never a token.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"bindings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"deployment_id":{"type":"string","pattern":"^dep_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string","pattern":"^org_[0-9A-HJKMNP-TV-Z]{26}$"},"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"provider":{"type":"string","enum":["plivo","vobiz"]},"connector_id":{"type":"string","pattern":"^con_[0-9A-HJKMNP-TV-Z]{26}$"},"purposes":{"type":"array","items":{"type":"string","enum":["service","transactional","promotional","bfsi_service"]}},"settings":{"type":"object","properties":{"disclosures":{"type":"object","properties":{"ai":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["en","ta","hi"]},"additionalProperties":{"type":"string","minLength":1,"maxLength":400}}},"required":["enabled","text"],"additionalProperties":false},"recording":{"type":"object","properties":{"enabled":{"type":"boolean"},"text":{"default":{},"type":"object","propertyNames":{"type":"string","enum":["en","ta","hi"]},"additionalProperties":{"type":"string","minLength":1,"maxLength":400}}},"required":["enabled","text"],"additionalProperties":false}},"required":["ai","recording"],"additionalProperties":false},"voice":{"type":"string","enum":["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"]},"language_order":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["en","ta","hi"]}},"max_minutes":{"type":"integer","minimum":1,"maximum":30},"max_concurrent_calls":{"type":"integer","minimum":1,"maximum":20},"business_name":{"type":"string","minLength":1,"maxLength":120},"transfer_to":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"topics":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"instructions":{"type":"string","maxLength":4000}},"required":["disclosures","voice","language_order","max_minutes","max_concurrent_calls","topics"],"additionalProperties":false}},"required":["number","deployment_id","org_id","entity_id","provider","connector_id","purposes","settings"],"additionalProperties":false}},"generated_at":{"type":"string"}},"required":["cell_id","bindings","generated_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deployments/{id}/calls":{"post":{"summary":"Admit an inbound call as a job at ring time (cell token)","tags":["cells"],"description":"The cell's voice service, on a bound number's answer callback: a job of the deployment's `answer` workflow is submitted (source `voice`) with the call's ids and numbers and nothing of its words, the wallet hold taken before the conversation (ADR 0020). Idempotent on the provider's call id: the same call admitted twice is one job. A refusal is typed so the service plays its short line and charges nothing: `CLD-E402` the wallet cannot hold it, `CLD-E425` the deployment is paused, `CLD-E429` it is carrying its `max_concurrent_calls`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["plivo","vobiz"]},"provider_call_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{4,100}$"},"from":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"to":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"}},"required":["provider","provider_call_id","from","to","number"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string"},"replayed":{"type":"boolean"}},"required":["job_id","status","replayed"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string"},"replayed":{"type":"boolean"}},"required":["job_id","status","replayed"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/deployments/{id}/missed-calls":{"post":{"summary":"A missed call to a bound number, due a callback (cell token)","tags":["cells"],"description":"The cell's voice service, when a ring to a bound number ended with no conversation: the deployment was carrying its `max_concurrent_calls` (`busy`), the service could not take it (`unavailable`), the caller ended the ring before the disclosures played (`hung_up`), or the overflow dial to the business's own number went unanswered (`no_answer`). Recorded once per provider call; a caller with a missed call still due is not promised twice. The callback — a `callback` job of this deployment, source `voice`, from the business's own number — is submitted now when a line is free (`queued`), else left `due` for the scheduler's `voice-callbacks` sweep; a paused agent or a wallet that cannot hold a call drops it with the reason. Two numbers, a reason and a time: never a word of the call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["plivo","vobiz"]},"provider_call_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{4,100}$"},"from":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"reason":{"type":"string","enum":["busy","unavailable","hung_up","no_answer"]},"missed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["provider","provider_call_id","from","number","reason","missed_at"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"missed_call_id":{"type":"string","pattern":"^vmc_[0-9A-HJKMNP-TV-Z]{26}$"},"state":{"type":"string","enum":["due","queued","dropped","expired"]},"job_id":{"anyOf":[{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["missed_call_id","state","job_id","replayed"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"missed_call_id":{"type":"string","pattern":"^vmc_[0-9A-HJKMNP-TV-Z]{26}$"},"state":{"type":"string","enum":["due","queued","dropped","expired"]},"job_id":{"anyOf":[{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["missed_call_id","state","job_id","replayed"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/jobs/{job}/voice-result":{"post":{"summary":"A call's content-free summary, answering the job's parked `voice` ask (cell token)","tags":["cells"],"description":"Posted by the cell's voice service when the call ends, with `Idempotency-Key: voice-result-<provider call id>`. `404` until the job has parked on its `voice` ask (the service retries); the summary is then recorded as the ask's answer and the worker resumes the run. The same key and summary again answers the same; another summary for an answered ask is `CLD-E409`. Ids, an outcome, seconds and minutes, two booleans, a language and the model's usage: never a word of the call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","pattern":"^job_[0-9A-HJKMNP-TV-Z]{26}$"},"call_id":{"type":"string","pattern":"^vcl_[0-9A-HJKMNP-TV-Z]{26}$"},"provider_call_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,100}$"},"outcome":{"type":"string","enum":["connected","voicemail","no_answer","busy","failed","lost"]},"connected_seconds":{"type":"integer","minimum":0,"maximum":14400},"minutes":{"type":"integer","minimum":0,"maximum":240},"disclosure_played":{"type":"boolean"},"language_used":{"type":"string","enum":["en","ta","hi"]},"recorded":{"type":"boolean"},"model_usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"output_tokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"est_usd_micros":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["input_tokens","output_tokens","est_usd_micros"],"additionalProperties":false},"ended_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["job_id","call_id","provider_call_id","outcome","connected_seconds","minutes","disclosure_played","language_used","recorded","model_usage","ended_at"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"job","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"approval_id":{"type":"string"},"job_id":{"type":"string"},"recorded":{"type":"boolean"},"replayed":{"type":"boolean"}},"required":["approval_id","job_id","recorded","replayed"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/areev-numbers":{"post":{"summary":"Ask for an Areev number in the business's name (a named person)","tags":["connectors"],"description":"Opens a Vobiz customer account for the business under Areev's partner master, seals its credential to the organisation's cells as a `vobiz` connection (never stored or returned), and opens the hosted KYC session; the answer carries `kyc_url`, which the buyer opens. `return_url` is the Desk page Vobiz returns the buyer to (it must start with the console's address); `?areev_number=<id>` is appended. `CLD-E409` when Areev Numbers is not priced in this environment or the agent already has an open request, `CLD-E404` when the deployment is not this organisation's AI Receptionist, `CLD-E503` when it is not configured here. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"deployment_id":{"type":"string","pattern":"^dep_[0-9A-HJKMNP-TV-Z]{26}$"},"series":{"default":"local","type":"string","enum":["local"]},"circle":{"type":"string","minLength":1,"maxLength":40},"legal_name":{"type":"string","minLength":1,"maxLength":140},"kyc_email":{"type":"string","maxLength":200,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"return_url":{"type":"string","maxLength":500,"format":"uri"}},"required":["entity_id","deployment_id","circle","legal_name","kyc_email","phone"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at"],"additionalProperties":false}}}}}},"get":{"summary":"The organisation's Areev number requests, newest first","tags":["connectors"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"deployment_id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at"],"additionalProperties":false}}},"required":["requests"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/areev-numbers/{id}":{"get":{"summary":"One Areev number request, its KYC re-read from Vobiz when the last read is older than a minute","tags":["connectors"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/areev-numbers/{id}/kyc/resend":{"post":{"summary":"Send the KYC link again: a new session for the same account, the old one superseded","tags":["connectors"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/webhooks/vobiz-kyc":{"post":{"summary":"Vobiz's KYC webhook (unverified: the session is re-read before anything is believed)","tags":["connectors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","maxLength":100},"type":{"type":"string","maxLength":100},"session_id":{"type":"string","maxLength":200},"kyc_session_id":{"type":"string","maxLength":200},"id":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":{}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}}}}},"/v1/admin/areev-numbers":{"get":{"summary":"Every Areev number request, for staff","tags":["connectors"],"parameters":[{"schema":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"in":"query","name":"state","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"},"vobiz_account_auth_id":{"type":["string","null"]},"kyc_session_id":{"type":["string","null"]},"subscription_id":{"type":["string","null"]}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at","vobiz_account_auth_id","kyc_session_id","subscription_id"],"additionalProperties":false}}},"required":["requests"],"additionalProperties":false}}}}}}},"/v1/admin/areev-numbers/{id}/provision":{"post":{"summary":"Record the number staff bought in Vobiz's console and charge its retainer","tags":["connectors"],"description":"Vobiz's Partner API cannot buy a number: staff buy a local number on the customer's account in the Partner Console, then post it here. The number must be listed on that account (`CLD-E409` otherwise). The first period and the setup are charged from the wallet at once; when it is short the request is `awaiting_funds`, nothing is charged, the buyer is told, and the answer is `CLD-E402`. On success the number is `ready_to_attach`. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9][0-9]{7,14}$"},"series":{"type":"string","enum":["local"]}},"required":["number"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"},"vobiz_account_auth_id":{"type":["string","null"]},"kyc_session_id":{"type":["string","null"]},"subscription_id":{"type":["string","null"]}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at","vobiz_account_auth_id","kyc_session_id","subscription_id"],"additionalProperties":false}}}}}}},"/v1/admin/areev-numbers/{id}/release":{"post":{"summary":"Release an Areev number: the retainer ends, the number is unbound (staff release it in Vobiz's console too)","tags":["connectors"],"description":"Ends the retainer (the early-release fee inside the term is passed through by the billing machinery) and marks the request `released`. Staff give the number up in Vobiz's Partner Console; the Partner API cannot. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^anr_[0-9A-HJKMNP-TV-Z]{26}$"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"deployment_id":{"type":"string"},"state":{"type":"string","enum":["kyc_pending","kyc_in_progress","kyc_completed","kyc_failed","awaiting_funds","ready_to_attach","attached","suspended","released","refused"]},"series":{"type":"string","enum":["local"]},"circle":{"type":"string"},"legal_name":{"type":"string"},"kyc_email":{"type":"string"},"phone":{"type":"string"},"connector_id":{"type":["string","null"]},"kyc_url":{"type":["string","null"]},"kyc_status":{"type":["string","null"]},"kyc_expires_at":{"type":["string","null"]},"number":{"type":["string","null"]},"shortfall_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"reason":{"type":["string","null"]},"requested_at":{"type":"string"},"updated_at":{"type":"string"},"vobiz_account_auth_id":{"type":["string","null"]},"kyc_session_id":{"type":["string","null"]},"subscription_id":{"type":["string","null"]}},"required":["id","org_id","entity_id","deployment_id","state","series","circle","legal_name","kyc_email","phone","connector_id","kyc_url","kyc_status","kyc_expires_at","number","shortfall_cents","currency","reason","requested_at","updated_at","vobiz_account_auth_id","kyc_session_id","subscription_id"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/upgrades":{"get":{"summary":"A deployment's upgrades: the one waiting, and every move it has made","tags":["packs"],"description":"Newest first. The open one — `replaying`, `awaiting_decision` or `approved` — is what a Desk renders under the version the deployment runs: what changes in the buyer's words, the replay's verdict, and whether it waits for a click.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"upgrade_policy":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}},"required":["deployment_id","upgrade_policy","data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/upgrades":{"get":{"summary":"Every upgrade waiting on an organisation's agents","tags":["packs"],"description":"The open ones — `replaying`, `awaiting_decision` or `approved` — across every deployment the organisation runs, newest first, so a screen of many agents asks once rather than once per agent.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}},"required":["org_id","data"],"additionalProperties":false}}}}}}},"/v1/upgrades/{id}":{"get":{"summary":"One upgrade","tags":["packs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/upgrades/{id}/apply":{"post":{"summary":"Apply an upgrade that waits for a decision","tags":["packs"],"description":"The one click (ADR 0031, N1): a major, a replay that was not clean, or a policy that asks. The deployment moves once its cell has re-installed; a major waits until nothing is in flight. A note may be written and is recorded with the decision; the click alone is enough (N1).","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/upgrades/{id}/dismiss":{"post":{"summary":"Dismiss an upgrade","tags":["packs"],"description":"The deployment keeps the version it runs, and this version is not offered to it again; a newer one is.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/upgrades/{id}/rollback":{"post":{"summary":"Roll an applied upgrade back to the version it replaced","tags":["packs"],"description":"Within thirty days of the apply, and only while the previous version has no passed sunset (`CLD-E425`). Opens a new upgrade of class `rollback`, approved with no replay; the cell undoes the upgrade's data migration from its recorded inverse and re-installs the previous version, and the upgrade rolled back reads `rolled_back`. Refused `CLD-E409` for an upgrade that is not applied or not the deployment's latest move, after the window, while another upgrade is open, or when its migration declared itself irreversible. Jobs already passed on the newer version stay charged under their own contract.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"org_id":{"type":"string"},"pack":{"type":"string"},"from_version":{"type":"string"},"to_version":{"type":"string"},"class":{"type":"string","enum":["patch","minor","major","rollback"]},"policy":{"type":"string"},"status":{"type":"string"},"what_changes":{"type":"array","items":{"type":"object","properties":{"class":{"type":"string"},"area":{"type":"string"},"path":{"type":"string"},"words":{"type":"string"}},"required":["class","area","path","words"],"additionalProperties":false}},"replay_clean":{"type":["boolean","null"]},"replay":{"anyOf":[{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","job_id","workflow","incumbent_outcome","candidate_outcome","verdict","effects_replayed","out_of_support","note"],"additionalProperties":false}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"],"additionalProperties":false},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"verdict":{"type":"string"}},"required":["runs","totals","candidate_plans","rehearsed","effect_dispatches"],"additionalProperties":false},{"type":"null"}]},"replayed_at":{"type":["string","null"]},"decision":{"type":["string","null"]},"automatic":{"type":"boolean"},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_reason":{"type":["string","null"]},"applied_at":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"learned_grains_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"learned_grains_kept":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","overlay_valid","overlay_faults"],"additionalProperties":false},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","overlay_keys_changed","record_keys_changed","inverse_event_hash","reversible"],"additionalProperties":false},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools","dry_run","applied","error"],"additionalProperties":false},{"type":"null"}]},"migration_receipt_sha256":{"type":["string","null"]},"migration_receipt_key":{"type":["string","null"]},"rollback_of":{"type":["string","null"]},"rollback_until":{"type":["string","null"]},"rolled_back_by":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","deployment_id","org_id","pack","from_version","to_version","class","policy","status","what_changes","replay_clean","replay","replayed_at","decision","automatic","decided_by","decided_at","decision_reason","applied_at","failure_reason","learned_grains_before","learned_grains_kept","migration","migration_receipt_sha256","migration_receipt_key","rollback_of","rollback_until","rolled_back_by","rolled_back_at","created_at","updated_at"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/upgrade-policy":{"put":{"summary":"Choose whether newer versions apply by themselves","tags":["packs"],"description":"`auto` (the default): a patch or a minor applies after a clean replay and a major asks once. `auto_patch`: only a patch applies by itself. `manual`: every upgrade waits for a click. `pinned`: nothing moves until you decide — a newer version is announced and not even replayed until you ask for it. Applies to upgrades opened from now on.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"string","enum":["auto","auto_patch","manual","pinned"]},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["policy","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"upgrade_policy":{"type":"string"}},"required":["deployment_id","upgrade_policy"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/upgrades/{id}/replay":{"post":{"summary":"A cell reports an upgrade's replay (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["replayed"]},"replay":{"type":"object","properties":{"runs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"run_id":{"type":"string","maxLength":200},"job_id":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"workflow":{"default":null,"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"incumbent_outcome":{"type":"string","maxLength":40},"candidate_outcome":{"type":"string","maxLength":40},"verdict":{"type":"string","enum":["same","better","worse","out_of_support","unavailable"]},"effects_replayed":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["run_id","incumbent_outcome","candidate_outcome","verdict"]}},"totals":{"type":"object","properties":{"runs":{"type":"integer","minimum":0,"maximum":9007199254740991},"same":{"type":"integer","minimum":0,"maximum":9007199254740991},"better":{"type":"integer","minimum":0,"maximum":9007199254740991},"worse":{"type":"integer","minimum":0,"maximum":9007199254740991},"out_of_support":{"type":"integer","minimum":0,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["runs","same","better","worse","out_of_support","unavailable"]},"candidate_plans":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"rehearsed":{"default":"plan","type":"string","enum":["plan"]},"effect_dispatches":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_valid"]},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","inverse_event_hash","reversible"]},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools"]},{"type":"null"}]}},"required":["runs","totals"]}},"required":["status","replay"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","maxLength":500}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"}},"required":["recorded","status"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/upgrades/{id}/report":{"post":{"summary":"A cell reports an upgrade's re-install (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["applied"]},"workflow_hashes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"tool_hashes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"trigger_ids":{"default":[],"type":"array","items":{"type":"string"}},"learned_grains_before":{"type":"integer","minimum":0,"maximum":9007199254740991},"learned_grains_kept":{"type":"integer","minimum":0,"maximum":9007199254740991},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_valid"]},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","inverse_event_hash","reversible"]},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools"]},{"type":"null"}]},"migration_receipt_sha256":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"migration_receipt_key":{"anyOf":[{"type":"string","pattern":"^evidence\\/upgrades\\/[A-Za-z0-9_]+\\/migration\\.json$"},{"type":"null"}]},"overlay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["status","workflow_hashes"]},{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"reason":{"type":"string","maxLength":500},"migration":{"anyOf":[{"type":"object","properties":{"tools":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"dry_run":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"overlay_valid":{"type":"boolean"},"overlay_faults":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["records_read","adds","supersedes","overlay_valid"]},{"type":"null"}]},"applied":{"default":null,"anyOf":[{"type":"object","properties":{"records_read":{"type":"integer","minimum":0,"maximum":9007199254740991},"adds":{"type":"integer","minimum":0,"maximum":9007199254740991},"supersedes":{"type":"integer","minimum":0,"maximum":9007199254740991},"overlay_keys_changed":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},"record_keys_changed":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":300}},"inverse_event_hash":{"type":"string","maxLength":100},"reversible":{"type":"boolean"}},"required":["records_read","adds","supersedes","inverse_event_hash","reversible"]},{"type":"null"}]},"error":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["tools"]},{"type":"null"}]}},"required":["status","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"status":{"type":"string"}},"required":["recorded","status"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/jobs":{"post":{"summary":"Submit a job. Idempotent by Idempotency-Key","tags":["jobs"],"description":"Returns 202: the job is queued for the cell that holds its memory. Execution state is authoritative in the cell's queue; this returns the control plane's projection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"order_line_id":{"type":"string","minLength":1,"maxLength":100},"idempotency_key":{"type":"string","maxLength":255},"max_usd_micros":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"max_wall_ms":{"type":"integer","exclusiveMinimum":0,"maximum":3600000},"max_tokens":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"max_retries":{"type":"integer","minimum":0,"maximum":3}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}":{"get":{"summary":"One job","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/timeline":{"get":{"summary":"Everything the control plane knows about this job, in order","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string"},"summary":{"type":"string"},"source":{"type":"object","properties":{"table":{"type":"string"},"id":{"type":"string"}},"required":["table","id"],"additionalProperties":false},"actor":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["at","kind","summary","source"],"additionalProperties":false}}},"required":["job_id","entries"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/jobs":{"get":{"summary":"Jobs in an organisation","tags":["jobs"],"parameters":[{"schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]}},{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]}]},"in":"query","name":"status","required":false},{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["platform"]},"in":"query","name":"include","required":false},{"schema":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},{"type":"string","minLength":1,"maxLength":100}]},"in":"query","name":"id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/cancel":{"post":{"summary":"Cancel a job. Nothing is charged","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/fork":{"post":{"summary":"Continue an exhausted run under a raised ceiling","tags":["jobs"],"description":"A job that ended `BudgetExhausted` keeps its checkpoint. Forking it creates a new job whose run is seeded from that checkpoint, under the budget named here. The exhausted job is never touched: it charged nothing and stays as the record of what the first ceiling bought (spec §10.2).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300},"max_usd_micros":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"max_wall_ms":{"type":"integer","exclusiveMinimum":0,"maximum":3600000},"max_tokens":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"at_superstep":{"type":"integer","minimum":0,"maximum":9007199254740991},"idempotency_key":{"type":"string","maxLength":255}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"pack_name":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"source":{"type":"string"},"quality":{"default":null,"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"},"reason":{"type":"string"}},"required":["id","kind","ok","reason"],"additionalProperties":false}},"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_ids":{"type":"array","items":{"type":"string"}},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"paid_with":{"default":null,"anyOf":[{"type":"string","enum":["wallet","included","overage","licence","none","invoice"]},{"type":"null"}]},"evidence_key":{"type":["string","null"]},"release_tuple_sha256":{"type":"string"},"parent_job_id":{"default":null,"type":["string","null"]},"fork_base_run_id":{"default":null,"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"started_at":{"type":["string","null"]},"run_started_at":{"default":null,"type":["string","null"]},"finished_at":{"type":["string","null"]},"evidence_sha256":{"type":["string","null"]},"order_id":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"usage":{"default":[],"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rated":{"type":"boolean"},"rated_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tier_from_units":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","quantity","rated","rated_cents","tier_from_units","included"],"additionalProperties":false}},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["minutes","minutes_at_gate","role","basis","study_date"],"additionalProperties":false},{"type":"null"}]},"estimate_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"estimate_currency":{"default":null,"type":["string","null"]},"batch_id":{"default":null,"type":["string","null"]},"case_ref":{"default":null,"type":["string","null"]},"period":{"default":null,"type":["string","null"]},"internal_cost":{"default":null,"anyOf":[{"type":"object","properties":{"model_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decision_calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"infra_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_usd_micros":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wall_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cpu_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_in":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens_out":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_calls":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_tokens":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"model_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cost_wait_ms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["model_usd_micros","decision_usd_micros","decision_calls","infra_usd_micros","total_usd_micros","wall_ms","cpu_ms","tokens_in","tokens_out","tool_calls","model_calls","cached_tokens","model_ms","cost_wait_ms"],"additionalProperties":false},{"type":"null"}]}},"required":["id","deployment_id","source","quality","checks","status","status_reason","error_code","attempt","run_ids","charge_cents","currency","paid_with","evidence_key","release_tuple_sha256","parent_job_id","fork_base_run_id","created_at","updated_at","started_at","run_started_at","finished_at","evidence_sha256","order_id","dispute_id","usage","time_saved","estimate_cents","estimate_currency","batch_id","case_ref","period","internal_cost"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/approvals":{"get":{"summary":"Asks waiting for a person","tags":["jobs"],"description":"Ordered for the caller by their business's review route (ADR 0074): the asks routed to them first, by step, then everything else by when it was asked. Routing orders; it never hides an ask.","parameters":[{"schema":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"job","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":"string"},"run_id":{"type":"string"},"tool_call_id":{"type":"string"},"ask":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"asked_at":{"type":"string"},"ttl_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"initiator":{"type":"string"},"responder":{"type":["string","null"]},"decision":{"type":["string","null"]},"kind":{"type":"string","enum":["approval","confirmation","posting","voice"]},"entity_id":{"type":["string","null"]},"route":{"anyOf":[{"type":"object","properties":{"route_id":{"type":"string"},"your_step":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"to_you":{"type":"boolean"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["team","person"]},"team_id":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["kind","team_id","name"],"additionalProperties":false},{"type":"null"}]},"told_step":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"steps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["route_id","your_step","to_you","via","told_step","steps"],"additionalProperties":false},{"type":"null"}]}},"required":["id","job_id","deployment_id","run_id","tool_call_id","ask","asked_at","ttl_sec","initiator","responder","decision","entity_id","route"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/approvals/{id}/respond":{"post":{"summary":"Answer an ask. A named person only, with a written reason","tags":["jobs"],"description":"Separation of duties: the principal that started the run may never answer its own ask, and outside the `standard` profile the session must be OIDC-backed (spec §12).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject","cancel"]},"reason":{"type":"string","minLength":3,"maxLength":1000},"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["decision","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":["string","null"]},"deployment_id":{"type":"string"},"run_id":{"type":"string"},"tool_call_id":{"type":"string"},"ask":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"asked_at":{"type":"string"},"ttl_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"initiator":{"type":"string"},"responder":{"type":["string","null"]},"decision":{"type":["string","null"]},"kind":{"type":"string","enum":["approval","confirmation","posting","voice"]}},"required":["id","job_id","deployment_id","run_id","tool_call_id","ask","asked_at","ttl_sec","initiator","responder","decision"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/jobs/{job}/report":{"post":{"summary":"A cell reports a job's outcome (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["received","preflight_failed","queued","running","parked","gated","passed","retry","abstained","failed","canceled","reclassified"]},"reason":{"type":"string","maxLength":500},"error_code":{"type":"string","maxLength":20},"run_ids":{"type":"array","items":{"type":"string"}},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"quality":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"evidence_key":{"type":"string"},"evidence_sha256":{"type":"string"},"cost":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"charge_cents":{"type":"integer","minimum":0,"maximum":9007199254740991},"ask":{"type":"object","properties":{"tool_call_id":{"type":"string"},"run_id":{"type":"string"},"summary":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["tool_call_id","run_id"]},"finding":{"type":"object","properties":{"verdict_code":{"type":"string","minLength":1,"maxLength":64},"recommendation":{"type":"string","enum":["credit","partial","uphold"]},"recommended_cents":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"confidence":{"type":"number","minimum":0,"maximum":1},"checks":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"ok":{"type":"boolean"}},"required":["label","ok"]}}},"required":["verdict_code","recommendation","confidence","checks"]},"usage":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"unit":{"type":"string","enum":["outcome","message","minute","page","record","document","gigabyte"]},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unit","quantity"],"additionalProperties":false}}},"required":["status"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"job","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"changed":{"type":"boolean"}},"required":["recorded","changed"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/evidence":{"get":{"summary":"A presigned link to the job's evidence bundle","tags":["jobs"],"description":"The bundle lives in the CELL's bucket. The control plane records its key and its hash and has never read its body, which is what §17's residency argument rests on. `url` points at that cell's Gateway, which signs a link to the object itself: follow it with the same credential and the bytes come from the cell, never from here. The key and the hash are returned alongside so a bundle can be verified without following anything.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":["string","null"]},"key":{"type":["string","null"]},"sha256":{"type":["string","null"]},"bucket":{"type":["string","null"]}},"required":["url","key","sha256","bucket"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/quote":{"post":{"summary":"Quote N outcomes on this deployment before submitting them","tags":["jobs"],"description":"Rates one outcome as a submission here would be held — the offer's rule, the promotion the organisation is eligible for, an included outcome first — and multiplies it. Exactly one of `quantity` or `record_refs` (then the quantity is the list's length; the records are not read). The quote holds its price for `QUOTE_TTL_MIN` minutes; `POST /v1/deployments/{id}/jobs/batch` confirms it. Over the rule's cap on units per submission is `CLD-E429`. Idempotent by content within its window: the same ask answers the same open quote.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer","exclusiveMinimum":0,"maximum":10000},"workflow":{"type":"string","minLength":1,"maxLength":120},"record_refs":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"entity_id":{"type":"string","minLength":1,"maxLength":100}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"quote_id":{"type":"string"},"workflow":{"type":["string","null"]},"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"offer_id":{"type":["string","null"]},"sku":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"unit_label":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered_by_entitlement":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserve_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shortfall_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["open","used","expired","superseded"]},"expires_at":{"type":"string"},"terms":{"type":"object","properties":{"charged_on":{"type":"string","enum":["passed"]},"failed_release":{"type":"string","enum":["no_charge"]}},"required":["charged_on","failed_release"],"additionalProperties":false}},"required":["quote_id","deployment_id","entity_id","offer_id","sku","price_rule_id","promotion_id","unit_cents","list_cents","currency","unit_label","quantity","covered_by_entitlement","reserve_cents","available_cents","shortfall_cents","min_topup_cents","status","expires_at","terms"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"quote_id":{"type":"string"},"workflow":{"type":["string","null"]},"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"offer_id":{"type":["string","null"]},"sku":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"unit_label":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered_by_entitlement":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserve_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shortfall_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["open","used","expired","superseded"]},"expires_at":{"type":"string"},"terms":{"type":"object","properties":{"charged_on":{"type":"string","enum":["passed"]},"failed_release":{"type":"string","enum":["no_charge"]}},"required":["charged_on","failed_release"],"additionalProperties":false}},"required":["quote_id","deployment_id","entity_id","offer_id","sku","price_rule_id","promotion_id","unit_cents","list_cents","currency","unit_label","quantity","covered_by_entitlement","reserve_cents","available_cents","shortfall_cents","min_topup_cents","status","expires_at","terms"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/quotes/{quote}":{"get":{"summary":"One quote; an open one past its window reads `expired`","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"quote","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"quote_id":{"type":"string"},"workflow":{"type":["string","null"]},"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"offer_id":{"type":["string","null"]},"sku":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"unit_label":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered_by_entitlement":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserve_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shortfall_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["open","used","expired","superseded"]},"expires_at":{"type":"string"},"terms":{"type":"object","properties":{"charged_on":{"type":"string","enum":["passed"]},"failed_release":{"type":"string","enum":["no_charge"]}},"required":["charged_on","failed_release"],"additionalProperties":false}},"required":["quote_id","deployment_id","entity_id","offer_id","sku","price_rule_id","promotion_id","unit_cents","list_cents","currency","unit_label","quantity","covered_by_entitlement","reserve_cents","available_cents","shortfall_cents","min_topup_cents","status","expires_at","terms"],"additionalProperties":false}}}}}}},"/v1/deployments/{id}/jobs/batch":{"post":{"summary":"Submit N jobs against a quote, all or nothing. Idempotent by Idempotency-Key and per item","tags":["jobs"],"description":"Every item becomes one job with its own hold at `queued`, exactly as a single submission, in one transaction: any refusal holds nothing. The quote must be open, this deployment's and for this many items (`CLD-E409`, `detail.reason`); a price that moved since answers `CLD-E409` with `detail.requote`, a fresh quote to confirm; a wallet short of the whole reservation answers `CLD-E402` with the shortfall and the minimum top-up. Items whose keys already name one batch's jobs answer that batch (200); a mix of new and existing keys is `CLD-E409`. An item naming `parent_job_id` RUNS AGAIN a job of this deployment that ended failed, abstained, canceled or preflight_failed (ADR 0088): a passed parent is `parent_passed`, an open one `parent_open`, one already run again `parent_taken` (`CLD-E409`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quote_id":{"type":"string","minLength":1,"maxLength":100},"items":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"object","properties":{"cell_record_ref":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"idempotency_key":{"type":"string","minLength":1,"maxLength":255},"parent_job_id":{"type":"string","minLength":1,"maxLength":100}},"required":["idempotency_key"],"additionalProperties":false}},"entity_id":{"type":"string","minLength":1,"maxLength":100}},"required":["quote_id","items"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"batch_id":{"type":"string"},"quote_id":{"type":"string"},"jobs":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"idempotency_key":{"type":["string","null"]},"status":{"type":"string"}},"required":["job_id","idempotency_key","status"],"additionalProperties":false}},"reserved_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["batch_id","quote_id","jobs","reserved_cents","currency"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"batch_id":{"type":"string"},"quote_id":{"type":"string"},"jobs":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"idempotency_key":{"type":["string","null"]},"status":{"type":"string"}},"required":["job_id","idempotency_key","status"],"additionalProperties":false}},"reserved_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["batch_id","quote_id","jobs","reserved_cents","currency"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/batches/{id}":{"get":{"summary":"One batch: its counts by state and its money, derived from its jobs and the ledger","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"quote_id":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"reserved_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"running":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"other":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["queued","running","parked","passed","failed","other"],"additionalProperties":false},"money":{"type":"object","properties":{"held_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charged_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"released_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held_cents","charged_cents","released_cents"],"additionalProperties":false},"status":{"type":"string","enum":["queued","running","settled"]},"created_at":{"type":"string"},"settled_at":{"type":["string","null"]}},"required":["id","deployment_id","entity_id","quote_id","quantity","unit_cents","currency","reserved_cents","counts","money","status","created_at","settled_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/batches":{"get":{"summary":"An organisation's batches, newest first","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"deployment","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"entity","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deployment_id":{"type":"string"},"entity_id":{"type":["string","null"]},"quote_id":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"reserved_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"running":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"passed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"other":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["queued","running","parked","passed","failed","other"],"additionalProperties":false},"money":{"type":"object","properties":{"held_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charged_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"released_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held_cents","charged_cents","released_cents"],"additionalProperties":false},"status":{"type":"string","enum":["queued","running","settled"]},"created_at":{"type":"string"},"settled_at":{"type":["string","null"]}},"required":["id","deployment_id","entity_id","quote_id","quantity","unit_cents","currency","reserved_cents","counts","money","status","created_at","settled_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/disputes":{"post":{"summary":"Question the charge on this job","tags":["jobs"],"description":"Opens a dispute and its support case. The job must have been charged; one open dispute per job. The charge stops finalising until the dispute is decided. Told to the organisation's and the Store's webhooks as `dispute.opened`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason_code":{"type":"string","enum":["duplicate","not_done","wrong_result","not_verified","out_of_scope","other"]},"words":{"default":"","type":"string","maxLength":2000}},"required":["reason_code"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}}}}}}},"/v1/disputes/{id}":{"get":{"summary":"One dispute and where it has got to","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/disputes":{"get":{"summary":"An organisation's disputes, newest first","tags":["jobs"],"description":"`job_id` narrows the list to the questions raised on one job — at most one open, and any closed before it — so a receipt finds its own dispute. Pages by `cursor`.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"job_id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/admin/disputes":{"get":{"summary":"Every open dispute, oldest first (the platform's queue)","tags":["jobs"],"parameters":[{"schema":{"default":100,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/disputes/{id}/receipt":{"get":{"summary":"The disputed job's receipt for the platform's reviewer (no evidence body)","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dispute_id":{"type":"string"},"job":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"deployment_id":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"paid_with":{"type":["string","null"]},"charge_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"release_tuple_sha256":{"type":"string"},"evidence_recorded":{"type":"boolean"},"created_at":{"type":"string"},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]}},"required":["id","org_id","deployment_id","status","status_reason","error_code","paid_with","charge_cents","currency","release_tuple_sha256","evidence_recorded","created_at","started_at","finished_at"],"additionalProperties":false},"quality":{"type":"object","properties":{"verdict":{"type":["string","null"]},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["field","pattern","grounding","citations","evaluator","other"]},"ok":{"type":"boolean"}},"required":["id","kind","ok"],"additionalProperties":false}}},"required":["verdict","checks"],"additionalProperties":false},"ledger":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"parent_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","kind","state","amount_cents","currency","parent_id","created_at"],"additionalProperties":false}},"timeline":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"kind":{"type":"string"},"summary":{"type":"string"},"source":{"type":"object","properties":{"table":{"type":"string"},"id":{"type":"string"}},"required":["table","id"],"additionalProperties":false},"actor":{"type":"string"}},"required":["at","kind","summary","source"],"additionalProperties":false}}},"required":["dispute_id","job","quality","ledger","timeline"],"additionalProperties":false}}}}}}},"/v1/disputes/{id}/decide":{"post":{"summary":"Decide a dispute with a written rationale (a billing reviewer or the founder)","tags":["jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["credited","partially_credited","upheld"]},"amount_cents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rationale":{"type":"string","minLength":12,"maxLength":4000}},"required":["decision","rationale"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}}}}}}},"/v1/disputes/{id}/withdraw":{"post":{"summary":"Withdraw a dispute you raised","tags":["jobs"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"case_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"ledger_entry_id":{"type":["string","null"]},"reason_code":{"type":"string"},"words":{"type":"string"},"status":{"type":"string"},"investigation_job_id":{"type":["string","null"]},"verdict_code":{"type":["string","null"]},"recommendation":{"type":["string","null"]},"recommended_cents":{"type":["number","null"]},"confidence":{"type":["number","null"]},"held_by":{"type":["string","null"]},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":false}},{"type":"null"}]},"finding_sha256":{"type":["string","null"]},"decision":{"type":["string","null"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"rationale":{"type":["string","null"]},"settlement_entry_id":{"type":["string","null"]},"settled_cents":{"type":["number","null"]},"currency":{"type":"string"},"window_ok":{"type":"boolean"},"sla_due_at":{"type":["string","null"]},"opened_by":{"type":"string"},"created_at":{"type":"string"}},"required":["id","org_id","job_id","case_id","order_line_id","ledger_entry_id","reason_code","words","status","investigation_job_id","verdict_code","recommendation","recommended_cents","confidence","held_by","checks","finding_sha256","decision","decided_by","decided_at","rationale","settlement_entry_id","settled_cents","currency","window_ok","sla_due_at","opened_by","created_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/support/questions":{"post":{"summary":"Areev: one turn of a conversation","tags":["support"],"description":"Opens a support case and submits one turn of the conversation: a job of the platform's answering pack in the business's memory, whose model answers from tools that read what you may read. The answer is that job's evidence bundle, read through the cell. A follow-up names the first answer's `thread_id`, which must be a conversation you opened, and keeps that conversation's context: only `context.destination` is taken from it, and a different `context.entity` is `CLD-E409` (start a new conversation). `form` answers a form an earlier turn drew. `subject.evidence_of` names a job whose evidence bundle the answer must read in the cell.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"job_id":{"type":"string","minLength":1,"maxLength":100},"order_id":{"type":"string","minLength":1,"maxLength":100},"thread_id":{"type":"string","minLength":1,"maxLength":100},"context":{"type":"object","properties":{"entity":{"type":"string","pattern":"^ent_[0-9A-HJKMNP-TV-Z]{26}$"},"deployments":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},"records":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","maxLength":100,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"},"record_id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string","enum":["home","work","records","reports","products","money","setup"]},"entry":{"type":"string","maxLength":120,"pattern":"^[a-z][a-z0-9_.:-]*$"}},"required":["id"],"additionalProperties":false},"tools":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}}},"additionalProperties":false},"subject":{"type":"object","properties":{"evidence_of":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$"}},"required":["evidence_of"],"additionalProperties":false},"form":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_.-]*$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}}]}},"class":{"type":"string","enum":["escalate"]}},"required":["question"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["question","dispute","alert","operator"]},"status":{"type":"string","enum":["open","waiting_on_areev","waiting_on_buyer","closed"]},"order_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"assignee":{"type":["string","null"]},"opened_by":{"type":"string"},"summary":{"type":"string"},"question":{"type":"string"},"answer_job_id":{"type":["string","null"]},"answer_status":{"type":["string","null"]},"answer_reason":{"type":["string","null"]},"answer_evidence":{"type":["string","null"]},"answered_at":{"type":["string","null"]},"thread_id":{"type":["string","null"]},"context":{"type":"object","properties":{"entity":{"type":"string"},"deployments":{"type":"array","items":{"type":"string"}},"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"record_id":{"type":"string"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string"},"entry":{"type":"string"}},"required":["id"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"form":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"},"answer_problem":{"type":["string","null"]}},"required":["id","org_id","kind","status","order_id","job_id","assignee","opened_by","summary","question","answer_job_id","answer_status","answer_reason","answer_evidence","answered_at","thread_id","context","form","closed_at","created_at","answer_problem"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/support/answer":{"get":{"summary":"Areev's fast lane: a no-content question answered in the request","tags":["support"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":2000},"in":"query","name":"q","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"thread_id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"class":{"anyOf":[{"type":"string","enum":["escalate","refund_status","order_status","plan_usage","charge_explanation","how_to","find"]},{"type":"null"}]},"verdict_code":{"type":"string","enum":["answered","needs_job"]},"envelope":{"anyOf":[{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"case_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"job_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"thread_id":{"type":"string","minLength":1,"maxLength":200},"parts":{"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["text"]},"markdown":{"type":"string","minLength":1,"maxLength":20000}},"required":["kind","markdown"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["a2ui"]},"version":{"type":"string","enum":["v0.9"]},"role":{"type":"string","enum":["answer","working"]},"messages":{"minItems":1,"maxItems":200,"type":"array","items":{"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v0.9"]},"createSurface":{"type":"object","properties":{"surfaceId":{"type":"string","minLength":1,"maxLength":120},"catalogId":{"type":"string","minLength":1,"maxLength":300},"theme":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendDataModel":{"type":"boolean"}},"required":["surfaceId","catalogId"],"additionalProperties":false}},"required":["version","createSurface"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v0.9"]},"updateComponents":{"type":"object","properties":{"surfaceId":{"type":"string","minLength":1,"maxLength":120},"components":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"component":{"type":"string","minLength":1,"maxLength":60},"children":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},{"type":"object","properties":{"componentId":{"type":"string","minLength":1,"maxLength":120},"path":{"type":"string","maxLength":300,"pattern":"^\\/"}},"required":["componentId","path"],"additionalProperties":false}]}},"required":["id","component"],"additionalProperties":{}}}},"required":["surfaceId","components"],"additionalProperties":false}},"required":["version","updateComponents"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v0.9"]},"updateDataModel":{"type":"object","properties":{"surfaceId":{"type":"string","minLength":1,"maxLength":120},"path":{"type":"string","maxLength":300,"pattern":"^\\/"},"value":{}},"required":["surfaceId","path"],"additionalProperties":false}},"required":["version","updateDataModel"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v0.9"]},"deleteSurface":{"type":"object","properties":{"surfaceId":{"type":"string","minLength":1,"maxLength":120}},"required":["surfaceId"],"additionalProperties":false}},"required":["version","deleteSurface"],"additionalProperties":false}]}}},"required":["kind","version","messages"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["citations"]},"items":{"maxItems":100,"type":"array","items":{"oneOf":[{"type":"object","properties":{"ref":{"type":"string","enum":["timeline"]},"source":{"type":"object","properties":{"table":{"type":"string","minLength":1,"maxLength":80},"id":{"type":"string","minLength":1,"maxLength":200}},"required":["table","id"],"additionalProperties":false},"kind":{"type":"string","minLength":1,"maxLength":80},"at":{"type":"string","minLength":1,"maxLength":40}},"required":["ref","source","kind","at"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","enum":["evidence"]},"job_id":{"type":"string","minLength":1,"maxLength":200},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"member":{"type":"string","minLength":1,"maxLength":300}},"required":["ref","job_id","sha256","member"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","enum":["offer"]},"sku":{"type":"string","minLength":1,"maxLength":200},"price_rule_id":{"type":"string","minLength":1,"maxLength":200}},"required":["ref","sku","price_rule_id"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","enum":["query"]},"deployment_id":{"type":"string","minLength":1,"maxLength":200},"query":{"type":"string","minLength":1,"maxLength":64},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rows":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["ref","deployment_id","query","params","rows"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","enum":["help"]},"pack":{"type":"string","minLength":1,"maxLength":100},"version":{"type":"string","minLength":1,"maxLength":40},"path":{"type":"string","minLength":1,"maxLength":300}},"required":["ref","pack","version","path"],"additionalProperties":false},{"type":"object","properties":{"ref":{"type":"string","enum":["tool"]},"name":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"type":"string","minLength":1,"maxLength":200},"deployment_id":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":120}},"required":["ref","name","tool_call_id"],"additionalProperties":false}]}}},"required":["kind","items"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["actions"]},"items":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"label":{"type":"string","minLength":1,"maxLength":80},"permission":{"type":"string","enum":["org.read","offers.read","org.administer","memories.read","memories.move","memories.credentials","packs.publish","packs.publish_first_party","deployments.write","deployments.retire","deployments.reinstall","deployments.upgrade","jobs.read","jobs.submit","approvals.read","approvals.respond","approvals.sign","orders.read","orders.place","wallet.topup","ledger.read","disputes.raise","disputes.read","support.ask","support.read","support.close","support.inspect","desk.read","desk.preferences","audit.export","teams.manage","review_routes.manage","recommendations.decide","connectors.read","connectors.consent","areev_numbers.request","areev_numbers.provision","connectors.write","sources.read","sources.pair","sources.write","cells.enrol","cells.activate","cells.rotate","cells.drain","cells.retire","org.zones","intake.read","intake.assign","intake.rotate","org.brand","desk.home_mode","catalog.write","catalog.read","catalog.attest","catalog.release","record_types.read","golden_candidates.review","record_types.write","cells.read_registry","cells.register","disputes.decide","disputes.queue","postings.reconcile_queue","postings.reconcile","wallet.credit","billing.charge","installations.settle","billing.configure","billing.mode","billing.confirm_payment","billing.true_up","private.administer","cells.usage_reports","billing.usage_report_senders","private.read_reports","platform.members"]},"href":{"type":"string","maxLength":500,"pattern":"^\\/[^/\\\\\\s][^\\\\\\s]*$"},"mcp_action":{"type":"string","minLength":1,"maxLength":120},"context":{"type":"object","propertyNames":{"type":"string","maxLength":100},"additionalProperties":{}}},"required":["id","label","permission"],"additionalProperties":false}}},"required":["kind","items"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["next"]},"questions":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["kind","questions"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":60}},"required":["kind"],"additionalProperties":{}}]}},"verdict_code":{"type":"string","minLength":1,"maxLength":60},"refused":{"type":"boolean"},"confidence":{"type":"number","minimum":0,"maximum":1},"checks":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"ok":{"type":"boolean"}},"required":["label","ok"],"additionalProperties":{}}}},"required":["schema_version","case_id","job_id","parts","verdict_code","confidence","checks"],"additionalProperties":false},{"type":"null"}]},"next":{"type":"array","items":{"type":"string"}}},"required":["class","verdict_code","envelope","next"],"additionalProperties":false}}}}}}},"/v1/support/cases/{id}":{"get":{"summary":"A support case, and where its answer is","tags":["support"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["question","dispute","alert","operator"]},"status":{"type":"string","enum":["open","waiting_on_areev","waiting_on_buyer","closed"]},"order_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"assignee":{"type":["string","null"]},"opened_by":{"type":"string"},"summary":{"type":"string"},"question":{"type":"string"},"answer_job_id":{"type":["string","null"]},"answer_status":{"type":["string","null"]},"answer_reason":{"type":["string","null"]},"answer_evidence":{"type":["string","null"]},"answered_at":{"type":["string","null"]},"thread_id":{"type":["string","null"]},"context":{"type":"object","properties":{"entity":{"type":"string"},"deployments":{"type":"array","items":{"type":"string"}},"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"record_id":{"type":"string"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string"},"entry":{"type":"string"}},"required":["id"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"form":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","kind","status","order_id","job_id","assignee","opened_by","summary","question","answer_job_id","answer_status","answer_reason","answer_evidence","answered_at","thread_id","context","form","closed_at","created_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/support/threads/{thread}":{"get":{"summary":"An Areev conversation: its questions, oldest first, and where each answer is","tags":["support"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"thread","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["question","dispute","alert","operator"]},"status":{"type":"string","enum":["open","waiting_on_areev","waiting_on_buyer","closed"]},"order_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"assignee":{"type":["string","null"]},"opened_by":{"type":"string"},"summary":{"type":"string"},"question":{"type":"string"},"answer_job_id":{"type":["string","null"]},"answer_status":{"type":["string","null"]},"answer_reason":{"type":["string","null"]},"answer_evidence":{"type":["string","null"]},"answered_at":{"type":["string","null"]},"thread_id":{"type":["string","null"]},"context":{"type":"object","properties":{"entity":{"type":"string"},"deployments":{"type":"array","items":{"type":"string"}},"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"record_id":{"type":"string"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string"},"entry":{"type":"string"}},"required":["id"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"form":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","kind","status","order_id","job_id","assignee","opened_by","summary","question","answer_job_id","answer_status","answer_reason","answer_evidence","answered_at","thread_id","context","form","closed_at","created_at"],"additionalProperties":false}}},"required":["id","data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/support/cases":{"get":{"summary":"An organisation's support cases, newest first: yours, or every one for an owner, an administrator or Areev","tags":["support"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["question","dispute","alert","operator"]},"status":{"type":"string","enum":["open","waiting_on_areev","waiting_on_buyer","closed"]},"order_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"assignee":{"type":["string","null"]},"opened_by":{"type":"string"},"summary":{"type":"string"},"question":{"type":"string"},"answer_job_id":{"type":["string","null"]},"answer_status":{"type":["string","null"]},"answer_reason":{"type":["string","null"]},"answer_evidence":{"type":["string","null"]},"answered_at":{"type":["string","null"]},"thread_id":{"type":["string","null"]},"context":{"type":"object","properties":{"entity":{"type":"string"},"deployments":{"type":"array","items":{"type":"string"}},"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"record_id":{"type":"string"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string"},"entry":{"type":"string"}},"required":["id"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"form":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","kind","status","order_id","job_id","assignee","opened_by","summary","question","answer_job_id","answer_status","answer_reason","answer_evidence","answered_at","thread_id","context","form","closed_at","created_at"],"additionalProperties":false}},"support_cost_usd_micros":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["data","support_cost_usd_micros"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/help":{"get":{"summary":"The help the organisation's products ship: each FAQ and how-to, with its words","tags":["support"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"pack","required":false},{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"query","name":"version","required":false},{"schema":{"type":"string","minLength":1,"maxLength":300},"in":"query","name":"path","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"pack":{"type":"string"},"version":{"type":"string"},"path":{"type":"string"},"title":{"type":"string"},"deployment_ids":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"truncated":{"type":"boolean"}},"required":["pack","version","path","title","deployment_ids","body","truncated"],"additionalProperties":false}},"max_body_bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["data","max_body_bytes"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/account-summary":{"get":{"summary":"The organisation at a glance: its balance, its plans and what is waiting","tags":["support"],"description":"Control-plane rows only: the organisation's id, name, market and currency, its wallets, the plans and entitlements in their period, how many orders, running jobs, waiting asks, setups to finish and open disputes it has, and the setups waiting on the person with the Desk path that finishes each. A wallet's `min_topup_cents` is the wallet read's: the larger of its own and the configured minimum.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"billing_rule":{"type":"string"},"org":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"market":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["id","name","market","currency"],"additionalProperties":false},"wallets":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"balance_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_cents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","balance_cents","min_topup_cents"],"additionalProperties":false}},"plans":{"type":"array","items":{"type":"object","properties":{"subscription_id":{"type":["string","null"]},"offer_id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"included_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"used_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_end":{"type":"string"}},"required":["subscription_id","offer_id","sku","name","included_units","used_units","period_end"],"additionalProperties":false}},"counts":{"type":"object","properties":{"orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"running_jobs":{"type":"integer","minimum":0,"maximum":9007199254740991},"in_progress_jobs":{"type":"integer","minimum":0,"maximum":9007199254740991},"waiting_approvals":{"type":"integer","minimum":0,"maximum":9007199254740991},"waiting_setups":{"type":"integer","minimum":0,"maximum":9007199254740991},"open_disputes":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["orders","running_jobs","in_progress_jobs","waiting_approvals","waiting_setups","open_disputes"],"additionalProperties":false},"setups":{"type":"array","items":{"type":"object","properties":{"product":{"type":"string"},"state":{"type":"string"},"sections_done":{"type":"integer","minimum":0,"maximum":9007199254740991},"sections_required":{"type":"integer","minimum":0,"maximum":9007199254740991},"desk_path":{"type":"string"}},"required":["product","state","sections_done","sections_required","desk_path"],"additionalProperties":false}}},"required":["billing_rule","org","wallets","plans","counts","setups"],"additionalProperties":false}}}}}}},"/v1/support/cases/{id}/close":{"post":{"summary":"Close a support case","tags":["support"],"description":"Closes a question or a support case: its opener, an owner, an administrator or a platform support member. A case whose answer is still being written is `CLD-E409` until it has answered; a closed case answers the same closed case again.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"kind":{"type":"string","enum":["question","dispute","alert","operator"]},"status":{"type":"string","enum":["open","waiting_on_areev","waiting_on_buyer","closed"]},"order_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"assignee":{"type":["string","null"]},"opened_by":{"type":"string"},"summary":{"type":"string"},"question":{"type":"string"},"answer_job_id":{"type":["string","null"]},"answer_status":{"type":["string","null"]},"answer_reason":{"type":["string","null"]},"answer_evidence":{"type":["string","null"]},"answered_at":{"type":["string","null"]},"thread_id":{"type":["string","null"]},"context":{"type":"object","properties":{"entity":{"type":"string"},"deployments":{"type":"array","items":{"type":"string"}},"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"record_id":{"type":"string"}},"required":["domain","record_id"],"additionalProperties":false}},"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false},"destination":{"type":"object","properties":{"id":{"type":"string"},"entry":{"type":"string"}},"required":["id"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"form":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}]},"closed_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","kind","status","order_id","job_id","assignee","opened_by","summary","question","answer_job_id","answer_status","answer_reason","answer_evidence","answered_at","thread_id","context","form","closed_at","created_at"],"additionalProperties":false}}}}}}},"/v1/store/orders/{id}/lines":{"post":{"summary":"Add a line to a draft order (the cart)","tags":["store"],"description":"An offer at a rule, with the line's own uploads. The first line sets the draft's currency; a line in another currency is refused with CLD-E426, because nothing converts. The price shown is copied again at placement.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offer_id":{"type":"string","minLength":1,"maxLength":100},"price_rule_id":{"type":"string","maxLength":100},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":100},"inputs":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":100}},"milestones":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"default":"","type":"string","maxLength":2000},"due_at":{"type":"string","maxLength":40},"share_bp":{"type":"integer","minimum":1,"maximum":10000}},"required":["name","due_at","share_bp"]}},"kind":{"type":"string","enum":["activation"]}},"required":["offer_id"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"currency":{"type":"string"},"total_cents":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}}},"required":["id","org_id","entity_id","status","status_reason","currency","total_cents","lines"],"additionalProperties":false}}}}}}},"/v1/store/orders/{id}/lines/{line}":{"delete":{"summary":"Remove a line from a draft order","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"line","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"currency":{"type":"string"},"total_cents":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}}},"required":["id","org_id","entity_id","status","status_reason","currency","total_cents","lines"],"additionalProperties":false}}}}}}},"/v1/store/orders/{id}/place":{"post":{"summary":"Place a draft order","tags":["store"],"description":"Every line's offer and rule re-read from the registry and its price copied; one currency for the order; the wallet checked for everything the lines cost and plan lines granted; then each outcome line becomes its own job. An `activation` line enables its product for `entity_id` at no charge (owner or administrator only): the order is `awaiting_funding` until the organisation has a balance, is on invoice terms or the business already runs, and then the business's agent is installed. Placing an order already placed answers with it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"entity_id":{"type":"string","maxLength":100},"promotion_code":{"type":"string","pattern":"^[A-Za-z0-9-]{3,40}$"}}},{"type":"null"}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"currency":{"type":"string"},"total_cents":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}},"paid_with":{"type":"string"},"job_ids":{"type":"array","items":{"type":"string"}},"next":{"type":"string"}},"required":["id","org_id","entity_id","status","status_reason","currency","total_cents","lines","paid_with","job_ids","next"],"additionalProperties":false}}}}}}},"/v1/store/orders/draft":{"get":{"summary":"Your open cart in an organisation, if you have one","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"org_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":["string","null"]},"entity_id":{"type":["string","null"]},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"currency":{"type":"string"},"total_cents":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"pack_version_id":{"type":["string","null"]},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"type":"string","enum":["sections","steps"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission"],"additionalProperties":false},{"type":"null"}]},"setup_pending":{"type":"boolean"},"id":{"type":"string"},"offer_id":{"type":"string"},"offer_name":{"type":["string","null"]},"offer_title":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"quantity":{"type":"number"},"currency":{"type":"string"},"kind":{"type":"string"},"job_id":{"type":["string","null"]},"inputs":{"type":"array","items":{"type":"string"}},"deployment_id":{"type":["string","null"]},"status_reason":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"activation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name"],"additionalProperties":false},{"type":"null"}]}},"required":["pack_version_id","setup","setup_pending","id","offer_id","price_rule_id","unit_cents","quantity","currency","kind","job_id","inputs","deployment_id","status_reason"],"additionalProperties":false}}},"required":["id","org_id","entity_id","status","status_reason","currency","total_cents","lines"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/activations":{"get":{"summary":"The products enabled for this organisation's businesses, and where each stands","tags":["store"],"description":"One row per (business, product) enabled at checkout (ADR 0042): `state` is `awaiting_funding`, `provisioning`, `setup_pending`, `ready` or `paused`, with `state_reason`; `sections[]` are the pack's setup sections, each with what the pack declared (`description`, `surface`, `connector`, `fields`, `summary_mode`) and its completion (`done_by` beside `done_by_name`); `completed_by_name` names who made it ready; `unit_cents` and `currency` are the rate shown at checkout, for display. `offer` is an offer's SKU or id; `entity` a business id. The Store's product page reads it to choose between Get started, Continue setup and Open in Desk.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"offer","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"entity","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]},"work_contract_id":{"type":["string","null"]},"workflows":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"name":{"type":["string","null"]},"title":{"type":"string"},"offer_id":{"type":"string"},"setup_layout":{"type":"string","enum":["sections","steps"]},"entity_label":{"type":"string"},"order_id":{"type":["string","null"]},"unit_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"promotion_id":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name","sku","name","title","offer_id","setup_layout","entity_label","order_id","unit_cents","list_cents","promotion_id","currency"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/offers/{sku}/orderable":{"get":{"summary":"Whether this organisation may order an offer, by the rule the cart and the order apply","tags":["store"],"description":"The signed-in product page and checkout ask it for each of the person's organisations (ADR 0041; `docs/store-boundary.md` surface 15): a `preview` card sells only to the organisations named for it, which the public view cannot say. `orderable` is the verdict the cart line and the order take (`cp.offer_orderable_in` with this organisation as the viewer), never a copy; `reason` says why not: `not_on_sale` (concept, deprecated), `paused`, `not_ready` (nothing to run, or a ga card not ready), `preview_not_named`, `development_not_sold` or `not_in_market`. `sku` is a SKU, a slug or an offer id; `market` is the buyer's view for a card priced for `any` (the order's `region`), ignored otherwise; the answer's `market` is the one checked, null for any market the card sells in. Nothing is written.","parameters":[{"schema":{"type":"string","enum":["in","us","sg"]},"in":"query","name":"market","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"sku","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"org_id":{"type":"string"},"orderable":{"type":"boolean"},"lifecycle":{"type":"string"},"reason":{"type":"string","enum":["not_on_sale","paused","not_ready","preview_not_named","development_not_sold","not_in_market"]},"market":{"type":["string","null"]}},"required":["sku","org_id","orderable","lifecycle","market"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/activations/{id}":{"get":{"summary":"One product enabled for one business, and where it stands","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]},"work_contract_id":{"type":["string","null"]},"workflows":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"name":{"type":["string","null"]},"title":{"type":"string"},"offer_id":{"type":"string"},"setup_layout":{"type":"string","enum":["sections","steps"]},"entity_label":{"type":"string"},"order_id":{"type":["string","null"]},"unit_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"promotion_id":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name","sku","name","title","offer_id","setup_layout","entity_label","order_id","unit_cents","list_cents","promotion_id","currency"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/activations/{id}/sections/{section}/complete":{"post":{"summary":"Record a setup section of an enabled product as done","tags":["store"],"description":"For a `record` or `choice` section: the Desk asserts it with the cell's revision reference (`evidence_ref`). `summary` is accepted only where the pack declares `summary: masked`, at most 80 characters and never a full identifier. `overlay`, `connection` and `first_review` sections are derived and refused with CLD-E409. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evidence_ref":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_.:@/#-]+$"},"summary":{"type":"string","minLength":1,"maxLength":80}},"required":["evidence_ref"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^act_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"section","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]},"work_contract_id":{"type":["string","null"]},"workflows":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"name":{"type":["string","null"]},"title":{"type":"string"},"offer_id":{"type":"string"},"setup_layout":{"type":"string","enum":["sections","steps"]},"entity_label":{"type":"string"},"order_id":{"type":["string","null"]},"unit_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"promotion_id":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name","sku","name","title","offer_id","setup_layout","entity_label","order_id","unit_cents","list_cents","promotion_id","currency"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/activations/{id}/sections/{section}/reopen":{"post":{"summary":"Reopen a setup section of an enabled product","tags":["store"],"description":"The section is no longer done, its reference and summary are cleared, and a product that was ready goes back to `setup_pending`. Needs an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{},"additionalProperties":false},{"type":"null"}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^act_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"section","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["awaiting_funding","provisioning","setup_pending","ready","paused"]},"state_reason":{"type":["string","null"]},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"required":{"type":"boolean"},"description":{"type":["string","null"]},"title":{"type":["string","null"]},"hint":{"type":["string","null"]},"surface":{"type":["string","null"]},"connector":{"type":["string","null"]},"provider":{"type":["string","null"]},"datasets":{"type":"array","items":{"type":"string"}},"ledgers":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"availability":{"type":"string","enum":["available","coming_soon"]},"request_url":{"type":["string","null"]},"connector":{"type":["string","null"]}},"required":["id","label","description","availability","request_url","connector"],"additionalProperties":false}},"summary_mode":{"type":"string","enum":["masked","none"]},"done":{"type":"boolean"},"done_at":{"type":["string","null"]},"done_by":{"type":["string","null"]},"done_by_name":{"type":["string","null"]},"evidence_ref":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","label","kind","required","description","title","hint","surface","connector","provider","datasets","ledgers","fields","options","summary_mode","done","done_at","done_by","done_by_name","evidence_ref","summary"],"additionalProperties":false}},"deployment_id":{"type":["string","null"]},"memory_id":{"type":["string","null"]},"entity_id":{"type":"string"},"order_line_id":{"type":["string","null"]},"carried_from":{"type":["string","null"]},"included_by":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"completed_by":{"type":["string","null"]},"completed_by_name":{"type":["string","null"]},"work_contract_id":{"type":["string","null"]},"workflows":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"name":{"type":["string","null"]},"title":{"type":"string"},"offer_id":{"type":"string"},"setup_layout":{"type":"string","enum":["sections","steps"]},"entity_label":{"type":"string"},"order_id":{"type":["string","null"]},"unit_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"promotion_id":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["id","state","state_reason","sections","deployment_id","memory_id","entity_id","order_line_id","carried_from","included_by","completed_at","completed_by","completed_by_name","sku","name","title","offer_id","setup_layout","entity_label","order_id","unit_cents","list_cents","promotion_id","currency"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/enrolments":{"post":{"summary":"Open an enrolment for a customer's own cell (a platform operator)","tags":["cells"],"description":"A `cell` purchase opens one for its buyer; this is the platform's way for a cell sold on invoice. The owner then mints its token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["byoc","onprem"]},"residency":{"type":"string","minLength":1,"maxLength":20}},"required":["mode","residency"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"mode":{"type":"string","enum":["byoc","onprem"]},"residency":{"type":"string"},"status":{"type":"string","enum":["open","enrolled","canceled"]},"expires_at":{"type":["string","null"]},"cell_id":{"type":["string","null"]},"order_id":{"type":["string","null"]},"enrolled_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","mode","residency","status","expires_at","cell_id","order_id","enrolled_at","created_at"],"additionalProperties":false}}}}}},"get":{"summary":"This organisation's cell enrolments","tags":["cells"],"description":"Once a cell enrolled with a `gateway_target`, its row names the Gateway's host under `cells.areev.ai` and the records Areev writes in its zone for it, with each one's state (Desk gap 48): what the Add-a-cell wizard shows the customer to point their load balancer at.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"mode":{"type":"string","enum":["byoc","onprem"]},"residency":{"type":"string"},"status":{"type":"string","enum":["open","enrolled","canceled"]},"expires_at":{"type":["string","null"]},"cell_id":{"type":["string","null"]},"order_id":{"type":["string","null"]},"enrolled_at":{"type":["string","null"]},"created_at":{"type":"string"},"gateway_host":{"type":["string","null"]},"dns_records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"content":{"type":"string"},"status":{"type":"string","enum":["written","pending","failed"]},"purpose":{"type":"string","enum":["gateway","validation"]}},"required":["type","name","content","status","purpose"],"additionalProperties":false}}},"required":["id","org_id","mode","residency","status","expires_at","cell_id","order_id","enrolled_at","created_at","gateway_host","dns_records"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/enrolments/{id}/token":{"post":{"summary":"Mint the one-time token a cell enrols with (the owner, signed in)","tags":["cells"],"description":"Shown once. Valid for 24 hours; minting again replaces it. Give it to the kit's first start, never to a chat or a ticket.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enrolment_id":{"type":"string"},"token":{"type":"string"},"expires_at":{"type":"string"},"enrol_url":{"type":"string"}},"required":["enrolment_id","token","expires_at","enrol_url"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/enrolments/{id}/cancel":{"post":{"summary":"Cancel an open enrolment that never enrolled a cell (the owner, signed in)","tags":["cells"],"description":"Answers the enrolment with status `canceled`. A token minted for it stops working: the kit's enrol with it is refused `CLD-E401`. Refused `CLD-E409` when the enrolment already enrolled a cell (retire that cell instead) or is already canceled.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"mode":{"type":"string","enum":["byoc","onprem"]},"residency":{"type":"string"},"status":{"type":"string","enum":["open","enrolled","canceled"]},"expires_at":{"type":["string","null"]},"cell_id":{"type":["string","null"]},"order_id":{"type":["string","null"]},"enrolled_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","org_id","mode","residency","status","expires_at","cell_id","order_id","enrolled_at","created_at"],"additionalProperties":false}}}}}}},"/v1/cells/enrol":{"post":{"summary":"A cell enrols itself with a one-time token and its public facts","tags":["cells"],"description":"`Authorization: Bearer <enrolment token>`. The body carries only public facts: where the cell's Gateway answers, which Core it runs, where its database and bucket are and which secret store it declares — never a credential. The response carries the cell's own token, once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"gateway_url":{"type":"string","maxLength":500,"format":"uri"},"core_version":{"type":"string","minLength":1,"maxLength":20},"provider":{"type":"string","minLength":1,"maxLength":40},"region":{"type":"string","minLength":1,"maxLength":60},"secrets_backend":{"type":"string","enum":["vault","gcp-sm","aws-sm","azure-kv","file-sealed"]},"object_bucket":{"default":"","type":"string","maxLength":200},"pg_host":{"type":"string","minLength":1,"maxLength":255},"pg_port":{"default":5432,"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"pg_db":{"type":"string","minLength":1,"maxLength":63},"pg_ca_ref":{"default":"","type":"string","maxLength":500},"model_routes_allowed":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":60}},"gateway_target":{"anyOf":[{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}\\.?$"},{"type":"null"}]},"dns_validation":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string","minLength":1,"maxLength":253},"content":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","name","content"],"additionalProperties":false}}},"required":["gateway_url","core_version","provider","region","secrets_backend","pg_host","pg_db"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"gateway_host":{"type":"string"},"dns_records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"content":{"type":"string"},"status":{"type":"string","enum":["written","pending","failed"]}},"required":["type","name","content","status"],"additionalProperties":false}},"cell_id":{"type":"string"},"org_id":{"type":"string"},"mode":{"type":"string"},"residency":{"type":"string"},"status":{"type":"string","enum":["provisioning"]},"cell_token":{"type":"string"},"control_plane_url":{"type":"string"},"checks":{"type":"array","items":{"type":"string"}}},"required":["cell_id","org_id","mode","residency","status","cell_token","control_plane_url","checks"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/activate":{"post":{"summary":"Activate your own cell once it has passed its checks (the owner, signed in)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"status":{"type":"string"},"activated_at":{"type":"string"}},"required":["cell_id","status","activated_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/drain":{"post":{"summary":"Drain your own cell: new work is refused, running work finishes (the owner, signed in)","tags":["cells"],"description":"From `active`. Draining a draining cell answers the same and changes nothing. New jobs against deployments on the cell are refused `CLD-E503`; parked runs finish.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"status":{"type":"string"},"at":{"type":"string"}},"required":["cell_id","status","at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/retire":{"post":{"summary":"Retire your own drained cell once no memory remains on it (the owner, signed in)","tags":["cells"],"description":"From `draining` (or `provisioning`, a cell that never served). Refused `CLD-E409` while any memory that is not erased remains on the cell, naming each, or while a memory move names it; move or retire each memory first. The cell's tokens are revoked, so its next plan poll is refused; its row stays.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":300}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"status":{"type":"string"},"at":{"type":"string"}},"required":["cell_id","status","at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/credentials/rotate":{"post":{"summary":"Ask your own cell to rotate its token, with an overlap window (the owner, signed in)","tags":["cells"],"description":"The cell takes the request from its next plan, exchanges its token for a new one and rewrites its enrolment entry; the old token keeps opening the cell for `overlap_sec` (default an hour) and is then refused. A second request while one is waiting is `CLD-E409`. If the cell never took the new token, ask again before the overlap ends: the old one still exchanges.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"overlap_sec":{"type":"integer","minimum":300,"maximum":86400}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"requested_at":{"type":"string"},"overlap_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cell_id","requested_at","overlap_sec"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/credentials/rotate":{"post":{"summary":"A cell exchanges its current token for a new one (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cell_id":{"type":"string"},"cell_token":{"type":"string"},"previous_expires_at":{"type":"string"}},"required":["cell_id","cell_token","previous_expires_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells":{"get":{"summary":"The cells this organisation runs in or owns, with their checks and demand","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"residency":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"status":{"type":"string"},"owned":{"type":"boolean"},"gateway_url":{"type":"string"},"gateway_host":{"type":["string","null"]},"core_version":{"type":"string"},"last_heartbeat_at":{"type":["string","null"]},"activated_at":{"type":["string","null"]},"token_rotation_requested_at":{"type":["string","null"]},"drained_at":{"type":["string","null"]},"retired_at":{"type":["string","null"]},"retire_blockers":{"type":"array","items":{"type":"object","properties":{"memory_id":{"type":"string"},"status":{"type":"string"}},"required":["memory_id","status"],"additionalProperties":false}},"checks":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"checks_owed":{"type":"array","items":{"type":"string"}},"memories":{"type":"number"},"memory_capacity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"demand":{"type":"number"}},"required":["id","mode","residency","provider","region","status","owned","gateway_url","gateway_host","core_version","last_heartbeat_at","activated_at","token_rotation_requested_at","drained_at","retired_at","retire_blockers","checks","checks_owed","memories","memory_capacity","demand"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/sources/pair":{"post":{"summary":"Pair a machine to a business's books with a one-time code (the plugin, no credential)","tags":["sources"],"description":"The code is shown once in the Desk and works once, for 24 hours. The answer carries the source's own credential, once; it answers only the `/v1/sources/{id}/…` routes of this source. A retry of the same attempt (the same `Idempotency-Key`) within 15 minutes, before the credential was ever used, is answered with the same source and a fresh credential; every other reuse of a code is `CLD-E401`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":256},"agent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"version":{"type":"string","minLength":1,"maxLength":40},"os":{"type":"string","minLength":1,"maxLength":40},"machine":{"type":"string","minLength":1,"maxLength":100}},"required":["name","version","os","machine"]},"company":{"type":"string","minLength":1,"maxLength":200}},"required":["code","agent","company"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"type":"string"},"org":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"client":{"type":"object","properties":{"memory_id":{"type":"string"},"label":{"type":"string"}},"required":["memory_id","label"],"additionalProperties":false},"credential":{"type":"string"},"api_url":{"type":"string"}},"required":["source_id","org","client","credential","api_url"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/manifest":{"get":{"summary":"What this source is asked to read (the source's credential)","tags":["sources"],"description":"One collection per dataset the business's products need, each with the words a person on the machine approves. `postings` appears only when a product in the business posts through this kind of source and names its ledger: each entry is a fixed template with typed fields Cloud fills with values, never XML, approved on the machine by its `fingerprint`, and the masters a post needs come as a collection beside it. `hosts` names the origin of the cell Gateway that holds the business's memory: the plugin sends uploads and reads a posting's values only there or at this API, and a memory that moves cell changes the manifest. Answers `ETag` and `304` on a matching `If-None-Match`. A paused source is asked for nothing.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source_id":{"type":"string"},"poll_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hosts":{"type":"array","items":{"type":"string"}},"collections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"reads":{"type":"string"},"why":{"type":"string"},"collector":{"type":"string"},"request":{"type":"object","properties":{"template":{"type":"string"},"encoding":{"type":"string"}},"required":["template","encoding"],"additionalProperties":false},"window":{"type":"object","properties":{"chunk":{"type":"string"},"from":{"type":"string"},"to":{"type":["string","null"]}},"required":["chunk","from","to"],"additionalProperties":false},"refresh":{"type":"object","properties":{"recent_chunks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"full_every_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested_at":{"type":"string"}},"required":["recent_chunks","full_every_days"],"additionalProperties":false}},"required":["id","dataset","dataset_version","title","reads","why","collector","request","window","refresh"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"collector":{"type":"string"},"voucher_type":{"type":"string"},"template":{"type":"string"},"lookup":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["text","ledger","gstin","date","amount","yesno","identity"]},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"optional":{"type":"boolean"},"block":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"encoding":{"type":"string"},"fingerprint":{"type":"string"}},"required":["id","kind","collector","voucher_type","template","lookup","fields","encoding","fingerprint"],"additionalProperties":false}}},"required":["manifest_version","source_id","poll_seconds","hosts","collections"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/sources/{id}/uploads":{"post":{"summary":"A ticket to send one window of one collection to the business's cell (the source's credential)","tags":["sources"],"description":"`200 {unchanged: true}` when the source already sent this window with this content hash. Otherwise a one-time `upload_secret` and the cell Gateway's `upload_url`; the bytes go there with `PUT`, and the Gateway refuses bytes whose sha256 is not `content_sha256`. The same `Idempotency-Key` while its ticket is pending answers the same id with a new secret; after it expired, a new ticket.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collection_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"dataset":{"type":"string","minLength":1,"maxLength":200},"window":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"]},"content_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"encoding":{"type":"string","enum":["utf-16le","utf-16be","utf-8"]},"filename":{"type":"string","minLength":1,"maxLength":255},"mime":{"type":"string","minLength":1,"maxLength":255}},"required":["collection_id","dataset","window","content_sha256","bytes","encoding","filename","mime"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"unchanged":{"type":"boolean","enum":[true]}},"required":["unchanged"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"upload_url":{"type":"string"},"upload_secret":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","upload_url","upload_secret","expires_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/file":{"post":{"summary":"Reach a business's books by file: its exports are uploaded and its posts imported by a person (ADR 0095)","tags":["sources"],"description":"For a business that installs no plugin. Holds no credential and is asked for nothing; a person uploads the ledger's exports with `POST /v1/orgs/{org}/sources/{id}/uploads`. `CLD-E409` while a plugin is paired for the business; pairing a plugin later ends the file source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["tally_plugin"]},"company":{"type":"string","minLength":1,"maxLength":200}},"required":["entity_id","kind","company"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}/collections":{"get":{"summary":"What a source is asked to send, each with how a person exports it by hand","tags":["sources"],"description":"The collections the source's manifest names today, with their words and `export_hint`: where the ledger's own menus export it, for a source reached by file (ADR 0095). Templates are never answered.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"dataset":{"type":"string"},"title":{"type":"string"},"reads":{"type":"string"},"why":{"type":"string"},"export_hint":{"type":"string"},"window":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":["string","null"]}},"required":["from","to"],"additionalProperties":false}},"required":["id","dataset","title","reads","why","export_hint","window"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}/uploads":{"post":{"summary":"A ticket for a person to send one export into a file source (ADR 0095)","tags":["sources"],"description":"The same ticket a plugin is given, for a source reached by file only: the bytes go to the business's cell with `PUT` and land beside a plugin's, so every reader of a source reads them alike.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collection_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"dataset":{"type":"string","minLength":1,"maxLength":200},"window":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"]},"content_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"encoding":{"type":"string","enum":["utf-16le","utf-16be","utf-8"]},"filename":{"type":"string","minLength":1,"maxLength":255},"mime":{"type":"string","minLength":1,"maxLength":255}},"required":["collection_id","dataset","window","content_sha256","bytes","encoding","filename","mime"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"unchanged":{"type":"boolean","enum":[true]}},"required":["unchanged"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"upload_url":{"type":"string"},"upload_secret":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","upload_url","upload_secret","expires_at"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/syncs":{"post":{"summary":"What one run on the machine did (the source's credential)","tags":["sources"],"description":"Counts and states only: which collections are approved, held or refused on the machine, and which windows were uploaded, unchanged, failed or held. The same `Idempotency-Key` is recorded once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"finished_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"agent_version":{"type":"string","minLength":1,"maxLength":40},"collections":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"fingerprint":{"type":"string","maxLength":128},"state":{"type":"string","enum":["approved","held","refused"]},"error":{"type":"string","maxLength":2000},"windows":{"maxItems":1200,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["uploaded","unchanged","failed","held"]},"upload_id":{"type":"string","maxLength":100},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"records":{"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"type":"string","maxLength":2000}},"required":["from","to","status"]}}},"required":["id","fingerprint","state","windows"]}},"postings":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$"},"fingerprint":{"type":"string","pattern":"^[0-9a-f]{64}$"},"state":{"type":"string","enum":["approved","held","refused"]}},"required":["entry_id","fingerprint","state"]}}},"required":["started_at","finished_at","agent_version","collections"],"additionalProperties":{}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"next_poll_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["next_poll_seconds"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/pairing-codes":{"post":{"summary":"Show a one-time code that pairs a machine to one business's books (an administrator, signed in)","tags":["sources"],"description":"Shown once and never stored: only its hash is kept. Valid for 24 hours and once; minting again for the same business and kind replaces the open code. Give it to the plugin's `pair` prompt.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entity_id":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["tally_plugin"]},"first_period":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["entity_id","kind"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"kind":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","code","kind","entity_id","memory_id","expires_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources":{"get":{"summary":"The machines paired to the organisation's businesses, and what each sent","tags":["sources"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"entity_id","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}":{"get":{"summary":"One paired source, its datasets and its last run","tags":["sources"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}/pause":{"post":{"summary":"Pause a source: it is asked for nothing and may send nothing","tags":["sources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"last_period":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}/resume":{"post":{"summary":"Resume a paused source","tags":["sources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"last_period":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/sources/{id}/end":{"post":{"summary":"End a source: its credential stops working at once and its company may be paired again","tags":["sources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"last_period":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"reach":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"subject_label":{"type":"string"},"status":{"type":"string","enum":["active","paused","ended"]},"credential_prefix":{"type":["string","null"]},"agent":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"first_period":{"type":["string","null"]},"last_period":{"type":["string","null"]},"manifest_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_seen_at":{"type":["string","null"]},"last_sync_at":{"type":["string","null"]},"last_upload_at":{"type":["string","null"]},"paused_at":{"type":["string","null"]},"ended_at":{"type":["string","null"]},"created_at":{"type":"string"},"datasets":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string"},"dataset":{"type":"string"},"dataset_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fingerprint":{"type":"string"},"state":{"type":"string"},"last_arrival_at":{"type":["string","null"]},"watermark":{"type":["string","null"]},"last_error":{"type":["string","null"]}},"required":["collection_id","dataset","dataset_version","fingerprint","state","last_arrival_at","watermark","last_error"],"additionalProperties":false}},"postings":{"type":"array","items":{"type":"object","properties":{"entry_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"}},"required":["entry_id","kind","state"],"additionalProperties":false}},"last_sync":{"anyOf":[{"type":"object","properties":{"finished_at":{"type":"string"},"agent_version":{"type":"string"},"system_reachable":{"type":"boolean"},"subject_loaded":{"type":"boolean"},"uploaded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["finished_at","agent_version","system_reachable","subject_loaded","uploaded","unchanged","failed","held"],"additionalProperties":false},{"type":"null"}]}},"required":["id","kind","reach","entity_id","memory_id","subject_label","status","credential_prefix","agent","first_period","last_period","manifest_version","last_seen_at","last_sync_at","last_upload_at","paused_at","ended_at","created_at","datasets","postings","last_sync"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/postings":{"get":{"summary":"The approved records waiting for this source to post them (the source's credential)","tags":["sources"],"description":"Metadata only: the posting, its entry, where its values are read in the business's cell, their sha256, and when it lapses. At most twenty, oldest first; a posting whose lease lapsed is listed again. A paused source is asked for nothing.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"entry_id":{"type":"string"},"values_url":{"type":"string"},"values_sha256":{"type":"string"},"state":{"type":"string"},"lease_until":{"type":["string","null"]},"expires_at":{"type":"string"}},"required":["id","entry_id","values_url","values_sha256","state","lease_until","expires_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/postings/{posting}/claim":{"post":{"summary":"Lease one posting before posting it, or renew the lease held (the source's credential)","tags":["sources"],"description":"Only the holder of a live lease may read the values and post. A lease lasts ten minutes and never past two minutes before the posting expires; sending the `lease_id` held renews it. `CLD-E409` when the posting is final or expired, another lease is live, it expires within five minutes, its entry is not approved on the machine, or the source may not answer in the business's memory yet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"lease_id":{"type":"string","pattern":"^spl_[0-9A-HJKMNP-TV-Z]{26}$"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"posting","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"lease_id":{"type":"string"},"lease_until":{"type":"string"},"values_url":{"type":"string"}},"required":["lease_id","lease_until","values_url"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/postings/{posting}/result":{"post":{"summary":"What posting one record did, with the ledger's ids only (the source's credential)","tags":["sources"],"description":"Recorded as the answer of the run's deliver ask under `source:<id>`, never as a person's approval. `posted` and `already_present` carry the ledger's verified id, which must have the shape the ledger's adapter declares. `failed` with `retry: true` frees the lease and answers nothing. The same report again answers the same state. A record reported after its job stopped waiting is charged to nobody and opens a reconciliation for a billing reviewer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lease_id":{"type":"string","pattern":"^spl_[0-9A-HJKMNP-TV-Z]{26}$"},"status":{"type":"string","enum":["posted","already_present","refused","failed"]},"ledger_ref":{"type":"string","minLength":1,"maxLength":100},"ledger_version":{"type":"string","minLength":1,"maxLength":40},"verified_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"error_code":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},"error_field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"},"retry":{"type":"boolean"}},"required":["lease_id","status"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"posting","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"posting_id":{"type":"string"},"state":{"type":"string"},"replayed":{"type":"boolean"},"reconciliation_id":{"type":["string","null"]}},"required":["posting_id","state","replayed","reconciliation_id"],"additionalProperties":false}}}}}}},"/v1/sources/{id}/postings/{posting}/access":{"get":{"summary":"Where a leased posting's values are, for the cell Gateway (the source's credential and its lease)","tags":["sources"],"description":"Asked by the business's cell Gateway with the source's credential forwarded and the lease in `Areev-Lease`. Answers only while that lease is live, and only ids: never the values.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"posting","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"type":"string"},"org_id":{"type":"string"},"entity_id":{"type":"string"},"memory_id":{"type":"string"},"cell_id":{"type":"string"},"deployment_id":{"type":"string"},"run_id":{"type":"string"},"tool_call_id":{"type":"string"},"entry_id":{"type":"string"},"values_sha256":{"type":"string"},"lease_until":{"type":"string"}},"required":["source_id","org_id","entity_id","memory_id","cell_id","deployment_id","run_id","tool_call_id","entry_id","values_sha256","lease_until"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/source-postings/{posting}/confirm":{"post":{"summary":"A person confirms a bill's import file was imported into the books, or was not (ADR 0095)","tags":["sources"],"description":"For a business reached by file only. `imported: true` with the `values_sha256` the import file carried settles the posting `posted` as `file-<values_sha256>`, confirmed by a person; `imported: false` settles it `refused` and nothing is charged. `CLD-E409` for a plugin's posting, for values that are not the approved ones, and once the ask has lapsed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"imported":{"type":"boolean"},"values_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"reason_code":{"type":"string","enum":["tally_refused","not_imported"]}},"required":["imported","values_sha256"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"posting","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"posting_id":{"type":"string"},"state":{"type":"string"},"replayed":{"type":"boolean"},"reconciliation_id":{"type":["string","null"]}},"required":["posting_id","state","replayed","reconciliation_id"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/jobs/{job}/source-postings":{"get":{"summary":"What a job asked its ledger's source to post, and where each stands (ids and states only)","tags":["sources"],"description":"The Desk reads it to show an approved bill's import file and its confirmation when the business is reached by file (ADR 0095), and where a paired plugin's post stands. Never the values.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"job","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"reach":{"type":"string"},"entry_id":{"type":"string"},"values_sha256":{"type":"string"},"approval_id":{"type":"string"},"expires_at":{"type":"string"},"ledger_ref":{"type":["string","null"]},"error_code":{"type":["string","null"]},"import_hint":{"type":["string","null"]}},"required":["id","state","reach","entry_id","values_sha256","approval_id","expires_at","ledger_ref","error_code","import_hint"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/source-postings/{posting}":{"get":{"summary":"Where a file posting's values are, for the cell Gateway to render its import file (cell-authenticated)","tags":["cells"],"description":"Ids only, never the values; a posting on another cell, or reached by a plugin, is `CLD-E404`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"posting","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"posting_id":{"type":"string"},"deployment_id":{"type":"string"},"memory_id":{"type":"string"},"run_id":{"type":"string"},"tool_call_id":{"type":"string"},"entry_id":{"type":"string"},"source_kind":{"type":"string"},"company":{"type":"string"},"values_sha256":{"type":"string"},"state":{"type":"string"}},"required":["posting_id","deployment_id","memory_id","run_id","tool_call_id","entry_id","source_kind","company","values_sha256","state"],"additionalProperties":false}}}}}}},"/v1/admin/source-postings/reconciliations":{"get":{"summary":"Records a paired machine posted that nobody was charged for (the platform's queue)","tags":["sources"],"parameters":[{"schema":{"default":"open","type":"string","enum":["open","resolved"]},"in":"query","name":"state","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"posting_id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"reason":{"type":"string"},"assignee":{"type":"string"},"state":{"type":"string"},"resolution":{"type":["string","null"]},"resolved_by":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"created_at":{"type":"string"},"source_id":{"type":"string"},"ledger":{"type":"string"},"entry_id":{"type":"string"},"ledger_ref":{"type":["string","null"]},"posting_state":{"type":"string"},"job_status":{"type":"string"}},"required":["id","posting_id","org_id","job_id","reason","assignee","state","resolution","resolved_by","resolved_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/source-postings/reconciliations/{id}/resolve":{"post":{"summary":"Resolve a posting reconciliation (a billing reviewer outside the organisation, signed in)","tags":["sources"],"description":"`charged_by_hand` records that this bill is charged, once: if a later attempt already charged it, `CLD-E409` and nothing is resolved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resolution":{"type":"string","enum":["reversed_in_books","charged_by_hand","no_action"]}},"required":["resolution"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":255},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"posting_id":{"type":"string"},"org_id":{"type":"string"},"job_id":{"type":"string"},"reason":{"type":"string"},"assignee":{"type":"string"},"state":{"type":"string"},"resolution":{"type":["string","null"]},"resolved_by":{"type":["string","null"]},"resolved_at":{"type":["string","null"]},"created_at":{"type":"string"},"source_id":{"type":"string"},"ledger":{"type":"string"},"entry_id":{"type":"string"},"ledger_ref":{"type":["string","null"]},"posting_state":{"type":"string"},"job_status":{"type":"string"}},"required":["id","posting_id","org_id","job_id","reason","assignee","state","resolution","resolved_by","resolved_at","created_at"],"additionalProperties":false}}}}}}},"/v1/admin/orgs/{org}/true-up":{"get":{"summary":"What a quarter owes past a customer-operated cell's licence, at the tag (a billing reviewer)","tags":["ledger"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"in":"query","name":"quarter","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"quarter":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"licence_offer_id":{"type":"string"},"subscription_id":{"type":["string","null"]},"member_offer_id":{"type":"string"},"slug":{"type":["string","null"]},"overage_outcomes":{"type":"number"},"rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"ledger_entry_id":{"type":["string","null"]}},"required":["licence_offer_id","subscription_id","member_offer_id","slug","overage_outcomes","rule_id","unit_cents","amount_cents","currency","ledger_entry_id"],"additionalProperties":false}},"cell_reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cell_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"pack":{"type":"string"},"version":{"type":"string"},"passed":{"type":"number"}},"required":["pack","version","passed"],"additionalProperties":false}},"signature":{"type":"string"},"public_key":{"type":"string"}},"required":["id","cell_id","period_start","period_end","outcomes","signature","public_key"],"additionalProperties":false}}},"required":["org_id","quarter","lines","cell_reports"],"additionalProperties":false}}}}}},"post":{"summary":"Record a quarter's true-up in the ledger for the invoice, once (a billing reviewer)","tags":["ledger"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"in":"query","name":"quarter","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"quarter":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"licence_offer_id":{"type":"string"},"subscription_id":{"type":["string","null"]},"member_offer_id":{"type":"string"},"slug":{"type":["string","null"]},"overage_outcomes":{"type":"number"},"rule_id":{"type":["string","null"]},"unit_cents":{"type":"number"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"ledger_entry_id":{"type":["string","null"]}},"required":["licence_offer_id","subscription_id","member_offer_id","slug","overage_outcomes","rule_id","unit_cents","amount_cents","currency","ledger_entry_id"],"additionalProperties":false}}},"required":["org_id","quarter","lines"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/usage-reports":{"get":{"summary":"A cell of the organisation's own: its signed quarterly usage reports, newest first","tags":["cells"],"description":"One report per closed calendar quarter for a `byoc` or `onprem` cell: passed outcomes per pack and version, the cell's Core version and the audit chain's head, with the signature and the public key to verify it offline (Ed25519 over `areev:usage-report:v1\\n` + canonical JSON). Evidence of use, never a charge.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cell_id":{"type":"string"},"org_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string"}},"required":["id","cell_id","org_id","period_start","period_end","report","signature","public_key","created_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/cells/{cell}/usage-reports/{id}":{"get":{"summary":"One signed quarterly usage report of a cell of the organisation's own","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"cell_id":{"type":"string"},"org_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string"}},"required":["id","cell_id","org_id","period_start","period_end","report","signature","public_key","created_at"],"additionalProperties":false}}}}}}},"/v1/admin/cells/{cell}/usage-reports":{"get":{"summary":"Any connected customer cell's signed quarterly usage reports (a billing reviewer)","tags":["cells"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cell_id":{"type":"string"},"org_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string"}},"required":["id","cell_id","org_id","period_start","period_end","report","signature","public_key","created_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/admin/usage-report-senders":{"post":{"summary":"Register a Private Edition's usage-report key, so the reports it posts are filed (the founder)","tags":["private"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"public_key":{"type":"string","minLength":1,"maxLength":1000},"licence_id":{"type":"string","minLength":1,"maxLength":100},"org_label":{"type":"string","minLength":1,"maxLength":200}},"required":["public_key","licence_id","org_label"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"fingerprint":{"type":"string"},"licence_id":{"type":"string"},"org_label":{"type":"string"},"created_at":{"type":"string"}},"required":["fingerprint","licence_id","org_label","created_at"],"additionalProperties":false}}}}}}},"/v1/usage-reports":{"post":{"summary":"File a Private Edition's signed usage report (reports.areev.ai; public, no credential)","tags":["private"],"description":"What a Private Edition's scheduler posts to `PRIVATE_REPORT_URL`: `{report, signature, public_key}`. Filed when the key is registered for the report's licence (`CLD-E401` otherwise) and the Ed25519 signature verifies (`CLD-E400` otherwise). A replay of the same period from the same key answers the first id with `replayed: true`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string","minLength":1,"maxLength":200},"public_key":{"type":"string","minLength":1,"maxLength":1000}},"required":["report","signature","public_key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"replayed":{"type":"boolean"}},"required":["id","replayed"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"replayed":{"type":"boolean"}},"required":["id","replayed"],"additionalProperties":false}}}}}}},"/v1/notifications/unsubscribe":{"get":{"summary":"The page a notice's unsubscribe link opens; changes nothing","tags":["notifications"],"parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Turn one kind of notice off for the person the token names","tags":["notifications"],"parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/licence":{"put":{"summary":"Install the licence file (the Private Edition's founder)","tags":["private"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["licence","release"]},"key_id":{"type":"string","minLength":1,"maxLength":100},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","key_id","payload","signature"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"licence_id":{"type":"string"},"organisation":{"type":"string"},"expires_at":{"type":"string"},"state":{"type":"string"}},"required":["licence_id","organisation","expires_at","state"],"additionalProperties":false}}}}}}},"/v1/licence":{"get":{"summary":"The installed licence and this period's use per pack","tags":["private"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"licence_id":{"type":"string"},"organisation":{"type":"string"},"state":{"type":"string","enum":["valid","grace","expired"]},"expires_at":{"type":"string"},"grace_days":{"type":"number"},"period_start":{"type":"string"},"period_end":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"packs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"versions":{"type":"string"},"included_per_period":{"type":"number"},"used":{"type":"number"},"ceiling":{"type":"number"}},"required":["name","versions","included_per_period","used","ceiling"],"additionalProperties":false}}},"required":["licence_id","organisation","state","expires_at","grace_days","period_start","period_end","features","packs"],"additionalProperties":false}}}}}}},"/v1/admin/releases":{"post":{"summary":"Install a signed release manifest (the Private Edition's founder)","tags":["private"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["licence","release"]},"key_id":{"type":"string","minLength":1,"maxLength":100},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","key_id","payload","signature"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"release":{"type":"string"},"packs":{"type":"number"}},"required":["release","packs"],"additionalProperties":false}}}}}},"get":{"summary":"The installed release manifests","tags":["private"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"release":{"type":"string"},"packs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"manifest_sha256":{"type":"string"}},"required":["name","version","manifest_sha256"],"additionalProperties":false}}},"required":["release","packs"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/usage-reports":{"get":{"summary":"The signed usage reports this installation has written, newest period first","tags":["private"],"description":"One report per closed licence period, so an installation that has run for years has as many as it has had periods. Pages by `cursor`, like every other list.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"licence_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string"},"public_key":{"type":"string"},"posted_at":{"type":["string","null"]},"post_error":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","licence_id","period_start","period_end","report","signature","public_key","posted_at","post_error","created_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/admin/usage-reports/{id}":{"get":{"summary":"One signed usage report, to export for invoicing","tags":["private"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"licence_id":{"type":"string"},"period_start":{"type":"string"},"period_end":{"type":"string"},"report":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signature":{"type":"string"},"public_key":{"type":"string"},"posted_at":{"type":["string","null"]},"post_error":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","licence_id","period_start","period_end","report","signature","public_key","posted_at","post_error","created_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/orders":{"get":{"summary":"An organisation's orders, newest first, with their lines summarised","tags":["store"],"description":"Placed orders only: a cart is read by its owner through `GET /v1/store/orders/draft`. Each line carries the offer, the price copied at sale and the job it became with that job's state; `GET /v1/store/orders/{id}` has the rest. `status` may be repeated.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["placed","pending_provisioning","preflight_failed","running","parked","passed","failed","refunded","canceled"]}},{"type":"string","enum":["placed","pending_provisioning","preflight_failed","running","parked","passed","failed","refunded","canceled"]}]},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"status_reason":{"type":["string","null"]},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"source":{"type":"string"},"deployment_choice":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"line_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"offer_id":{"type":"string"},"offer_title":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"price_rule_id":{"type":["string","null"]},"kind":{"type":"string"},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"job_id":{"type":["string","null"]},"job_status":{"type":["string","null"]},"activation_state":{"type":["string","null"]}},"required":["id","offer_id","offer_title","offer_name","price_rule_id","kind","unit_cents","quantity","currency","job_id","job_status","activation_state"],"additionalProperties":false}}},"required":["id","status","status_reason","total_cents","currency","source","deployment_choice","created_at","updated_at","line_count","lines"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/memories/{id}/moves":{"post":{"summary":"Move a memory to another cell (the owner, signed in)","tags":["memories"],"description":"Returns 202 with the move. The preflight refuses a target that is not active, outside the organisation's zones, on another Core major.minor, or where a deployment's regulated rules or model route would not hold. The memory keeps working until the target is ready, then takes no new work until the cut-over. `dry_run` answers the preflight and moves nothing. Connections that must be set again in the target are listed in `reconsent`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_cell_id":{"type":"string","minLength":1,"maxLength":100},"reason":{"type":"string","minLength":3,"maxLength":1000},"dry_run":{"default":false,"type":"boolean"}},"required":["target_cell_id","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean","enum":[true]},"preflight":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reconsent":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","webhook"]},"id":{"type":"string"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false}}},"required":["dry_run","preflight","reconsent"],"additionalProperties":false}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"source_cell_id":{"type":"string"},"target_cell_id":{"type":"string"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"requested_by":{"type":"string"},"reason":{"type":"string"},"preflight":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reconsent":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","webhook"]},"id":{"type":"string"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false}},"exported":{"anyOf":[{"type":"object","properties":{"bundle_sha256":{"type":"string"},"bundle_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"evidence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bundle_sha256","bundle_bytes","cursor","log_sha256","head_hash","counts","evidence","uploads"],"additionalProperties":false},{"type":"null"}]},"imported":{"anyOf":[{"type":"object","properties":{"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"verify_ok":{"type":"boolean"},"isolation_ok":{"type":"boolean"},"evidence_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cursor","log_sha256","head_hash","counts","verify_ok","isolation_ok","evidence_copied","uploads_copied"],"additionalProperties":false},{"type":"null"}]},"failed_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"hold_until":{"type":["string","null"]},"source_resumed_at":{"type":["string","null"]},"target_discarded_at":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"created_at":{"type":"string"},"draining_at":{"type":["string","null"]},"exported_at":{"type":["string","null"]},"transferring_at":{"type":["string","null"]},"imported_at":{"type":["string","null"]},"verified_at":{"type":["string","null"]},"cut_over_at":{"type":["string","null"]},"source_retired_at":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"failed_at":{"type":["string","null"]}},"required":["id","org_id","memory_id","source_cell_id","target_cell_id","stage","requested_by","reason","preflight","reconsent","exported","imported","failed_stage","failure_reason","hold_until","source_resumed_at","target_discarded_at","receipt_id","created_at","draining_at","exported_at","transferring_at","imported_at","verified_at","cut_over_at","source_retired_at","rolled_back_at","failed_at"],"additionalProperties":false}}}}}},"get":{"summary":"A memory's moves, newest first","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"source_cell_id":{"type":"string"},"target_cell_id":{"type":"string"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"requested_by":{"type":"string"},"reason":{"type":"string"},"preflight":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reconsent":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","webhook"]},"id":{"type":"string"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false}},"exported":{"anyOf":[{"type":"object","properties":{"bundle_sha256":{"type":"string"},"bundle_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"evidence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bundle_sha256","bundle_bytes","cursor","log_sha256","head_hash","counts","evidence","uploads"],"additionalProperties":false},{"type":"null"}]},"imported":{"anyOf":[{"type":"object","properties":{"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"verify_ok":{"type":"boolean"},"isolation_ok":{"type":"boolean"},"evidence_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cursor","log_sha256","head_hash","counts","verify_ok","isolation_ok","evidence_copied","uploads_copied"],"additionalProperties":false},{"type":"null"}]},"failed_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"hold_until":{"type":["string","null"]},"source_resumed_at":{"type":["string","null"]},"target_discarded_at":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"created_at":{"type":"string"},"draining_at":{"type":["string","null"]},"exported_at":{"type":["string","null"]},"transferring_at":{"type":["string","null"]},"imported_at":{"type":["string","null"]},"verified_at":{"type":["string","null"]},"cut_over_at":{"type":["string","null"]},"source_retired_at":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"failed_at":{"type":["string","null"]}},"required":["id","org_id","memory_id","source_cell_id","target_cell_id","stage","requested_by","reason","preflight","reconsent","exported","imported","failed_stage","failure_reason","hold_until","source_resumed_at","target_discarded_at","receipt_id","created_at","draining_at","exported_at","transferring_at","imported_at","verified_at","cut_over_at","source_retired_at","rolled_back_at","failed_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/moves/{id}":{"get":{"summary":"One memory move: its stage, what each cell measured, what must be connected again","tags":["memories"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"source_cell_id":{"type":"string"},"target_cell_id":{"type":"string"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"requested_by":{"type":"string"},"reason":{"type":"string"},"preflight":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reconsent":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","webhook"]},"id":{"type":"string"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false}},"exported":{"anyOf":[{"type":"object","properties":{"bundle_sha256":{"type":"string"},"bundle_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"evidence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bundle_sha256","bundle_bytes","cursor","log_sha256","head_hash","counts","evidence","uploads"],"additionalProperties":false},{"type":"null"}]},"imported":{"anyOf":[{"type":"object","properties":{"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"verify_ok":{"type":"boolean"},"isolation_ok":{"type":"boolean"},"evidence_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cursor","log_sha256","head_hash","counts","verify_ok","isolation_ok","evidence_copied","uploads_copied"],"additionalProperties":false},{"type":"null"}]},"failed_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"hold_until":{"type":["string","null"]},"source_resumed_at":{"type":["string","null"]},"target_discarded_at":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"created_at":{"type":"string"},"draining_at":{"type":["string","null"]},"exported_at":{"type":["string","null"]},"transferring_at":{"type":["string","null"]},"imported_at":{"type":["string","null"]},"verified_at":{"type":["string","null"]},"cut_over_at":{"type":["string","null"]},"source_retired_at":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"failed_at":{"type":["string","null"]}},"required":["id","org_id","memory_id","source_cell_id","target_cell_id","stage","requested_by","reason","preflight","reconsent","exported","imported","failed_stage","failure_reason","hold_until","source_resumed_at","target_discarded_at","receipt_id","created_at","draining_at","exported_at","transferring_at","imported_at","verified_at","cut_over_at","source_retired_at","rolled_back_at","failed_at"],"additionalProperties":false}}}}}}},"/v1/moves/{id}/rollback":{"post":{"summary":"Roll a memory move back (the owner, signed in)","tags":["memories"],"description":"Before the cut-over the move ends and the memory takes work where it always was. During the hold it points back to the old copy, unless work has run or a credential was minted in the new cell since.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"memory_id":{"type":"string"},"source_cell_id":{"type":"string"},"target_cell_id":{"type":"string"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"requested_by":{"type":"string"},"reason":{"type":"string"},"preflight":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reconsent":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","webhook"]},"id":{"type":"string"},"label":{"type":"string"}},"required":["kind","id","label"],"additionalProperties":false}},"exported":{"anyOf":[{"type":"object","properties":{"bundle_sha256":{"type":"string"},"bundle_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"evidence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["bundle_sha256","bundle_bytes","cursor","log_sha256","head_hash","counts","evidence","uploads"],"additionalProperties":false},{"type":"null"}]},"imported":{"anyOf":[{"type":"object","properties":{"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"log_sha256":{"type":"string"},"head_hash":{"type":["string","null"]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"],"additionalProperties":false},"verify_ok":{"type":"boolean"},"isolation_ok":{"type":"boolean"},"evidence_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uploads_copied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cursor","log_sha256","head_hash","counts","verify_ok","isolation_ok","evidence_copied","uploads_copied"],"additionalProperties":false},{"type":"null"}]},"failed_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"hold_until":{"type":["string","null"]},"source_resumed_at":{"type":["string","null"]},"target_discarded_at":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"created_at":{"type":"string"},"draining_at":{"type":["string","null"]},"exported_at":{"type":["string","null"]},"transferring_at":{"type":["string","null"]},"imported_at":{"type":["string","null"]},"verified_at":{"type":["string","null"]},"cut_over_at":{"type":["string","null"]},"source_retired_at":{"type":["string","null"]},"rolled_back_at":{"type":["string","null"]},"failed_at":{"type":["string","null"]}},"required":["id","org_id","memory_id","source_cell_id","target_cell_id","stage","requested_by","reason","preflight","reconsent","exported","imported","failed_stage","failure_reason","hold_until","source_resumed_at","target_discarded_at","receipt_id","created_at","draining_at","exported_at","transferring_at","imported_at","verified_at","cut_over_at","source_retired_at","rolled_back_at","failed_at"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/moves/{move}/report":{"post":{"summary":"A cell reports a step of a memory move (cell-authenticated)","tags":["cells"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"step":{"type":"string","enum":["prepared"]},"public_key":{"type":"string","minLength":40,"maxLength":200}},"required":["step","public_key"]},{"type":"object","properties":{"bundle_key":{"type":"string","maxLength":300},"bundle_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"bundle_bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"envelope_key":{"type":"string","maxLength":300},"envelope_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"log_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"head_hash":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"]},"credentials_suspended":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"step":{"type":"string","enum":["exported"]}},"required":["bundle_key","bundle_sha256","bundle_bytes","envelope_key","envelope_sha256","cursor","log_sha256","head_hash","counts","step"]},{"type":"object","properties":{"rw_role":{"type":"string"},"ro_role":{"type":"string"},"rw_secret_ref":{"type":"string"},"ro_secret_ref":{"type":"string"},"anon_key_ref":{"type":"string"},"step":{"type":"string","enum":["imported"]},"core_version":{"type":"string","maxLength":20},"cursor":{"type":"integer","minimum":0,"maximum":9007199254740991},"log_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"head_hash":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"counts":{"type":"object","properties":{"grain_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"op_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"trigger_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["grain_count","op_count","run_count","trigger_count"]},"verify_ok":{"type":"boolean"},"verify_detail":{"type":"string","maxLength":500},"isolation_ok":{"type":"boolean"},"isolation_detail":{"type":"string","maxLength":500},"evidence_copied":{"type":"integer","minimum":0,"maximum":9007199254740991},"uploads_copied":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["rw_role","ro_role","rw_secret_ref","ro_secret_ref","anon_key_ref","step","core_version","cursor","log_sha256","head_hash","counts","verify_ok","verify_detail","isolation_ok","isolation_detail","evidence_copied","uploads_copied"]},{"type":"object","properties":{"step":{"type":"string","enum":["retired"]},"counts_before":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"credentials_dropped":{"type":"integer","minimum":0,"maximum":9007199254740991},"secrets_removed":{"type":"integer","minimum":0,"maximum":9007199254740991},"objects_removed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["step","counts_before","credentials_dropped","secrets_removed","objects_removed"]},{"type":"object","properties":{"step":{"type":"string","enum":["resumed"]},"credentials_restored":{"type":"integer","minimum":0,"maximum":9007199254740991},"objects_removed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["step","credentials_restored","objects_removed"]},{"type":"object","properties":{"step":{"type":"string","enum":["discarded"]},"secrets_removed":{"type":"integer","minimum":0,"maximum":9007199254740991},"objects_removed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["step","secrets_removed","objects_removed"]},{"type":"object","properties":{"step":{"type":"string","enum":["failed"]},"during":{"type":"string","enum":["prepare","export","import","retire","resume","discard"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["step","during","reason"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"move","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]},"applied":{"type":"boolean"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"reason":{"type":["string","null"]}},"required":["recorded","applied","stage","reason"],"additionalProperties":false}}}}}}},"/v1/cells/{cell}/moves/{move}/objects":{"get":{"summary":"The object keys a move's source Gateway may serve (cell-authenticated)","tags":["cells"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"cell","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"move","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"move_id":{"type":"string"},"memory_id":{"type":"string"},"org_id":{"type":"string"},"target_cell_id":{"type":"string"},"stage":{"type":"string","enum":["requested","draining","exported","transferring","imported","verified","cut_over","source_retired","rolled_back","failed"]},"keys":{"type":"array","items":{"type":"string"}}},"required":["move_id","memory_id","org_id","target_cell_id","stage","keys"],"additionalProperties":false}}}}}}},"/v1/admin/wallets/{org}/{currency}/credit":{"post":{"summary":"Credit an organisation's wallet with a reason (a billing reviewer or the founder)","tags":["ledger"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":1,"maximum":100000000},"reason":{"type":"string","minLength":8,"maxLength":500}},"required":["amount_cents","reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^[A-Z]{3}$"},"in":"path","name":"currency","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entry_id":{"type":"string"},"org_id":{"type":"string"},"currency":{"type":"string"},"amount_cents":{"type":"number"},"balance_cents":{"type":"number"},"replayed":{"type":"boolean"}},"required":["entry_id","org_id","currency","amount_cents","balance_cents","replayed"],"additionalProperties":false}}}}}}},"/v1/admin/orgs/{org}/charges":{"post":{"summary":"Charge an organisation an ad-hoc amount with a reason (a billing reviewer)","tags":["ledger"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"reason":{"type":"string","minLength":12,"maxLength":1000},"rule_id":{"type":"string","maxLength":100}},"required":["amount_cents","currency","reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entry_id":{"type":"string"},"balance_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"replayed":{"type":"boolean"}},"required":["entry_id","balance_cents","currency","replayed"],"additionalProperties":false}}}}}}},"/v1/admin/invoices/{id}/paid":{"post":{"summary":"Confirm a bank transfer with the bank's reference: a top-up, or a statement (a billing reviewer)","tags":["ledger"],"description":"An `inv_` reference is a bank-transfer top-up: its entry is confirmed and the wallet credited (I4). A `tinv_` id is an invoice-mode organisation's statement (I13): it is marked paid and no wallet moves.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"utr":{"type":"string","minLength":6,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$"}},"required":["utr"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^t?inv_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"entry_id":{"type":"string"},"org_id":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"balance_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replayed":{"type":"boolean"}},"required":["entry_id","org_id","amount_cents","currency","balance_cents","replayed"],"additionalProperties":false},{"type":"object","properties":{"invoice_id":{"type":"string"},"org_id":{"type":"string"},"status":{"type":"string","enum":["paid"]},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"replayed":{"type":"boolean"}},"required":["invoice_id","org_id","status","total_cents","currency","replayed"],"additionalProperties":false}]}}}}}}},"/v1/orgs/{org}/wallet":{"get":{"summary":"Every wallet this organisation holds, and what is spendable after holds","tags":["ledger"],"description":"An organisation holds one wallet per currency (B13b). `wallets` is all of them; the top-level figures are the one named by `?currency=`, else the organisation's home currency's (its billing country's: INR for IN, SGD for SG, else USD), listed first.","parameters":[{"schema":{"type":"string","pattern":"^[A-Z]{3}$"},"in":"query","name":"currency","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"org_id":{"type":"string"},"balance_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"min_topup_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suggested_topup_cents":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"wallets":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"balance_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"held_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_topup_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suggested_topup_cents":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["currency","balance_cents","available_cents","held_cents","min_topup_cents","suggested_topup_cents"],"additionalProperties":false}}},"required":["org_id","balance_cents","available_cents","held_cents","currency","min_topup_cents","suggested_topup_cents","wallets"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/wallet/topup":{"post":{"summary":"Start a top-up. Returns what a browser needs to open the rail's checkout","tags":["ledger"],"description":"The wallet is credited only when the rail's webhook confirms the payment, never when the order is created: an abandoned checkout must leave no balance behind. Writes a payment record in `created` (`payment_id`; `GET /v1/orgs/{org}/payments/{id}` follows it). `store_order_id` in the body names the Store order this money is for, and `return_to` where the Store sends the browser after capture — a path, or a URL on an origin this control plane serves. The least amount is the wallet's `min_topup_cents` (`GET /v1/orgs/{org}/wallet`). `Idempotency-Key` makes a repeated click answer the same payment, and after capture its `status: captured`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":100,"maximum":10000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"store_order_id":{"type":"string","minLength":1,"maxLength":100},"return_to":{"type":"string","minLength":1,"maxLength":2000}},"required":["amount_cents"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"payment_id":{"type":"string"},"status":{"type":"string","enum":["created","captured","failed","abandoned"]},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"order_id":{"type":"string"},"rail_order_id":{"type":"string"},"store_order_id":{"type":["string","null"]},"return_to":{"type":["string","null"]},"credit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credit_currency":{"type":"string"},"charge_amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charge_currency":{"type":"string"},"rate_micros":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"rated":{"type":"boolean"},"rail":{"type":"string","enum":["razorpay","stripe","invoice","fake"]},"rail_label":{"type":"string"},"checkout":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"prefill":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"contact":{"type":"string"}},"additionalProperties":false}},"required":["key","order_id","amount","currency"],"additionalProperties":false,"description":"razorpay: Razorpay Checkout's key, order_id, amount and currency, and who is paying (`prefill`)"},{"type":"object","properties":{"payment_intent":{"type":"string"},"client_secret":{"type":["string","null"]},"publishable_key":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["payment_intent","client_secret","publishable_key","amount","currency"],"additionalProperties":false,"description":"stripe: the PaymentIntent to confirm with its client secret"},{"type":"object","properties":{"reference":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["reference","amount","currency"],"additionalProperties":false,"description":"none, invoice rail: the reference a bank transfer quotes"},{"type":"object","properties":{"prefill":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"contact":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false,"description":"none, fake rail: no payment page, credited only on its signed webhook; `prefill` as Razorpay's"}]},"checkout_kind":{"type":"string","enum":["razorpay","stripe","none"]},"instructions":{"type":["string","null"]},"tax_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pays":{"type":"object","properties":{"amount_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["amount_minor","currency"],"additionalProperties":false},"breakdown":{"anyOf":[{"type":"object","properties":{"taxable_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cgst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sgst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"igst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_code":{"type":"string"},"place_of_supply_state":{"type":"string"}},"required":["taxable_cents","cgst_cents","sgst_cents","igst_cents","rate_bp","tax_code","place_of_supply_state"],"additionalProperties":false},{"type":"null"}]}},"required":["payment_id","status","amount_cents","currency","order_id","rail_order_id","store_order_id","return_to","credit_cents","credit_currency","charge_amount_minor","charge_currency","rate_micros","rated","rail","rail_label","checkout","checkout_kind","instructions","tax_cents","total_minor","pays","breakdown"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/ledger":{"get":{"summary":"The ledger, newest first","tags":["ledger"],"description":"`job_id` narrows the list to one job's lines — its hold, its charge and any release, reversal or credit — which is a receipt. Pages by `cursor` like every other list (docs/api/api-conventions.md §4). The platform's cost records (`fee`, `acquisition`) are never listed; a promoted `charge` carries `promotion_id` and its unit's `list_cents`.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"job_id","required":false},{"schema":{"type":"string","maxLength":200,"pattern":"^[a-z_]+(,[a-z_]+)*$"},"in":"query","name":"kind","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":["string","null"]},"kind":{"type":"string"},"state":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"note":{"type":["string","null"]},"created_at":{"type":"string"},"parent_id":{"type":["string","null"]},"batch_id":{"type":["string","null"]},"deployment_id":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"promotion_id":{"type":["string","null"]},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minutes_saved":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"usage_detail":{"anyOf":[{"type":"object","properties":{"unit":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tier_from_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_price_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"}},"required":["unit","quantity","included","billable","tier_from_units","unit_price_cents","unit_multiple","label"],"additionalProperties":false},{"type":"null"}]}},"required":["id","job_id","kind","state","amount_cents","currency","note","created_at","parent_id","batch_id","deployment_id","offer_name","promotion_id","list_cents","minutes_saved","usage_detail"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/time-saved":{"get":{"summary":"The minutes an organisation's charged outcomes saved, in a window","tags":["ledger"],"description":"Summed from the ledger's `charge` entries that are not reversed (spec §14 \"Minutes saved per verified outcome\"; issue #353): each passed outcome's minutes come from the Work Contract it ran under, net of the minutes a person spent at the gate. A window is at most 366 days. Minutes and outcomes only: no figure here is money, and none is ever multiplied by a rate.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"entity","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"offer","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"minutes_saved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outcomes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_offer":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":["string","null"]},"offer_name":{"type":["string","null"]},"minutes_saved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outcomes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string"},"basis":{"type":"string","enum":["estimate","internal_study"]},"study_date":{"type":["string","null"]}},"required":["offer_id","offer_name","minutes_saved","outcomes","role","basis","study_date"],"additionalProperties":false}},"from":{"type":"string"},"to":{"type":"string"}},"required":["minutes_saved","outcomes","by_offer","from","to"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/reverse":{"post":{"summary":"Reverse a charge, with a reason","tags":["ledger"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5,"maxLength":500}},"required":["reason"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"reversed":{"type":"boolean"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reversed","amount_cents"],"additionalProperties":false}}}}}}},"/v1/webhooks/razorpay":{"post":{"summary":"Razorpay's webhook (signature-verified over the raw body)","tags":["ledger"],"responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks/{rail}":{"post":{"summary":"A payment rail's webhook (signature-verified over the raw body)","tags":["ledger"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"rail","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/seller-entities":{"post":{"summary":"Add a seller entity that issues tax invoices (the founder, signed in)","tags":["ledger"],"description":"The seller's legal facts, dummy until live: a tax adviser confirms them before live keys (docs/runbooks/payments.md §8). The invoice series numbers gaplessly from 1.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"legal_name":{"type":"string","minLength":1,"maxLength":200},"gstin":{"default":null,"anyOf":[{"type":"string","pattern":"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"},{"type":"null"}]},"state_code":{"type":"string","pattern":"^[0-9]{2}$"},"address":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":200}},"invoice_series":{"type":"string","pattern":"^[A-Z0-9/-]{1,16}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"bank_instructions":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":200}}},"required":["name","legal_name","state_code","invoice_series","currency"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"legal_name":{"type":"string"},"gstin":{"type":["string","null"]},"state_code":{"type":"string"},"address":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"invoice_series":{"type":"string"},"next_invoice_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","legal_name","gstin","state_code","address","invoice_series","next_invoice_no","currency","active"],"additionalProperties":false}}}}}},"get":{"summary":"The seller entities that issue tax invoices","tags":["ledger"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"legal_name":{"type":"string"},"gstin":{"type":["string","null"]},"state_code":{"type":"string"},"address":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"invoice_series":{"type":"string"},"next_invoice_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","legal_name","gstin","state_code","address","invoice_series","next_invoice_no","currency","active"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/invoices":{"get":{"summary":"The organisation's tax invoices, newest first","tags":["ledger"],"description":"One per paid top-up, and for an organisation on invoice terms one statement per billing period (`kind: statement`, I13): the amount, the tax and the total, with CGST and SGST or IGST, and when a statement is due. A statement's total may be negative when credits exceeded charges.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"seller_entity_id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cgst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sgst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"igst_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"place_of_supply_state":{"type":["string","null"]},"issued_at":{"type":"string"},"due_at":{"type":["string","null"]},"paid_at":{"type":["string","null"]},"period_start":{"type":["string","null"]},"period_end":{"type":["string","null"]},"document_ready":{"type":"boolean"},"billed_to":{"type":"object","properties":{"name":{"type":"string"},"gstin":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","gstin","contact_name","email"],"additionalProperties":false}},"required":["id","number","seller_entity_id","kind","status","currency","amount_cents","tax_cents","total_cents","cgst_cents","sgst_cents","igst_cents","place_of_supply_state","issued_at","due_at","paid_at","period_start","period_end","document_ready","billed_to"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/invoices/{id}/document":{"get":{"summary":"A presigned link to a tax invoice's PDF","tags":["ledger"],"description":"The control plane writes the document once and signs a short-lived link to it; it never reads the bytes back. `sha256` verifies what the link returns.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"sha256":{"type":["string","null"]},"expires_in_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["url","sha256","expires_in_sec"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/payments/{id}":{"get":{"summary":"One payment a top-up opened: where it is, and what it became","tags":["ledger"],"description":"`created` until the rail answers; `captured` once the wallet is credited (with the invoice and the ledger entry); `failed` with the rail's code and words; `abandoned` when nobody paid within `PAYMENTS_ABANDON_AFTER_MIN`. A capture that arrives later still credits and turns it `captured`. The Store's add-money page polls this.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^pay_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["created","captured","failed","abandoned"]},"rail":{"type":"string"},"rail_label":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"order_id":{"type":["string","null"]},"return_to":{"type":["string","null"]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"document_href":{"type":"string"}},"required":["id","number","document_href"],"additionalProperties":false},{"type":"null"}]},"ledger_entry_id":{"type":["string","null"]},"failure_code":{"type":["string","null"]},"failure_description":{"type":["string","null"]},"client_verified_at":{"type":["string","null"]},"created_at":{"type":"string"},"captured_at":{"type":["string","null"]}},"required":["id","status","rail","rail_label","amount_cents","tax_cents","total_minor","currency","order_id","return_to","invoice","ledger_entry_id","failure_code","failure_description","client_verified_at","created_at","captured_at"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/payments":{"get":{"summary":"The organisation's payments, newest first; `?order=` narrows to one Store order","tags":["ledger"],"description":"What the Store reads to show a pending, failed or abandoned payment against an order, to offer a retry from the same order, and to find a capture after the browser closed. Pages by `cursor` (docs/api/api-conventions.md §4).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"order","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":400},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["created","captured","failed","abandoned"]},"rail":{"type":"string"},"rail_label":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"order_id":{"type":["string","null"]},"return_to":{"type":["string","null"]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"document_href":{"type":"string"}},"required":["id","number","document_href"],"additionalProperties":false},{"type":"null"}]},"ledger_entry_id":{"type":["string","null"]},"failure_code":{"type":["string","null"]},"failure_description":{"type":["string","null"]},"client_verified_at":{"type":["string","null"]},"created_at":{"type":"string"},"captured_at":{"type":["string","null"]}},"required":["id","status","rail","rail_label","amount_cents","tax_cents","total_minor","currency","order_id","return_to","invoice","ledger_entry_id","failure_code","failure_description","client_verified_at","created_at","captured_at"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/payments/{id}/verify":{"post":{"summary":"Check the signature a browser's checkout returned. Credits nothing","tags":["ledger"],"description":"Razorpay Checkout's success handler gives the page `razorpay_order_id`, `razorpay_payment_id` and `razorpay_signature`; the page sends the last two here. A signature that is the rail's for this payment's order sets `client_verified_at` and answers the payment as it is — still `created` until the webhook lands, which remains the only thing that credits the wallet. A signature that does not verify is `CLD-E400`. The fake rail's signature is HMAC-SHA256 of `<rail order id>|<rail payment id>` under its webhook secret (docs/runbooks/payments.md).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rail_payment_id":{"type":"string","minLength":1,"maxLength":100},"signature":{"type":"string","minLength":1,"maxLength":200}},"required":["rail_payment_id","signature"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true},{"schema":{"type":"string","pattern":"^pay_[0-9A-HJKMNP-TV-Z]{26}$"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["created","captured","failed","abandoned"]},"rail":{"type":"string"},"rail_label":{"type":"string"},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_minor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"order_id":{"type":["string","null"]},"return_to":{"type":["string","null"]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"document_href":{"type":"string"}},"required":["id","number","document_href"],"additionalProperties":false},{"type":"null"}]},"ledger_entry_id":{"type":["string","null"]},"failure_code":{"type":["string","null"]},"failure_description":{"type":["string","null"]},"client_verified_at":{"type":["string","null"]},"created_at":{"type":"string"},"captured_at":{"type":["string","null"]}},"required":["id","status","rail","rail_label","amount_cents","tax_cents","total_minor","currency","order_id","return_to","invoice","ledger_entry_id","failure_code","failure_description","client_verified_at","created_at","captured_at"],"additionalProperties":false}}}}}}},"/v1/admin/promotions":{"post":{"summary":"Create or update a promotion by slug (the catalogue)","tags":["store"],"description":"Applied from the Store's `catalog/promotions/<slug>.yaml`, idempotent by content: the same body again answers `changed: false`. A `percent_off` value is basis points; `amount_off` and `credit` name their currency; a `code` needs `visibility: code`. Grants become exactly the body's. Send an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"title":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["percent_off","amount_off","free_units","credit"]},"value":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"scope":{"type":"object","properties":{"offer_ids":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"shelf":{"type":"string","maxLength":30},"market":{"type":"string","enum":["in","us","sg","any"]},"any":{"type":"boolean"}},"additionalProperties":false},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ends_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"max_uses":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_uses_per_org":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":"string","enum":["none","with_plan"]},"visibility":{"type":"string","enum":["public","targeted","code"]},"channels":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["site","desk","email","social"]}},"display_text":{"type":"string","minLength":1,"maxLength":500},"code":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9-]{3,40}$"},{"type":"null"}]},"status":{"type":"string","enum":["draft","live","ended"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"grants":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"subject_kind":{"type":"string","enum":["org","account_domain","channel_partner","segment","persona","first_n_orders"]},"subject":{"type":"string","minLength":1,"maxLength":200},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["subject_kind","subject"],"additionalProperties":false}}},"required":["slug","title","kind","value","visibility","display_text","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]},"scope":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"max_uses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_uses_per_org":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":"string"},"visibility":{"type":"string"},"channels":{"type":"array","items":{"type":"string"}},"display_text":{"type":"string"},"code":{"type":["string","null"]},"status":{"type":"string"},"reason":{"type":["string","null"]},"changed":{"type":"boolean"},"created":{"type":"boolean"}},"required":["id","slug","title","kind","value","currency","scope","starts_at","ends_at","max_uses","max_uses_per_org","stack","visibility","channels","display_text","code","status","reason","changed","created"],"additionalProperties":false}}}}}},"get":{"summary":"Every promotion, with how often each was used","tags":["store"],"parameters":[{"schema":{"type":"string","enum":["draft","live","ended"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["public","targeted","code"]},"in":"query","name":"visibility","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]},"scope":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"max_uses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_uses_per_org":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":"string"},"visibility":{"type":"string"},"channels":{"type":"array","items":{"type":"string"}},"display_text":{"type":"string"},"code":{"type":["string","null"]},"status":{"type":"string"},"reason":{"type":["string","null"]},"uses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","slug","title","kind","value","currency","scope","starts_at","ends_at","max_uses","max_uses_per_org","stack","visibility","channels","display_text","code","status","reason","uses"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/promotions/{slug}/end":{"post":{"summary":"End a promotion now: it applies to nothing from here on","tags":["store"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]},"scope":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"max_uses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_uses_per_org":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stack":{"type":"string"},"visibility":{"type":"string"},"channels":{"type":"array","items":{"type":"string"}},"display_text":{"type":"string"},"code":{"type":["string","null"]},"status":{"type":"string"},"reason":{"type":["string","null"]}},"required":["id","slug","title","kind","value","currency","scope","starts_at","ends_at","max_uses","max_uses_per_org","stack","visibility","channels","display_text","code","status","reason"],"additionalProperties":false}}}}}}},"/v1/orgs/{org}/promotions":{"get":{"summary":"The promotions this organisation may use now","tags":["store"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"path","name":"org","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"kind":{"type":"string"},"display_text":{"type":"string"},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"scope":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"visibility":{"type":"string"}},"required":["slug","kind","display_text","starts_at","ends_at","scope","visibility"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/estimates":{"post":{"summary":"Create or update an estimate by slug (the catalogue)","tags":["store"],"description":"Applied from `catalogue/estimates/<slug>.yaml`, idempotent by content: the same body again answers `changed: false`. An estimate is a typical month of work for an audience — quantities of listed outcome cards' price lines — and holds no amount: it is priced from the price rules when it is read. Each term is an active term of its facet and at least one is named (`CLD-E400`); each line's card is an outcome card priced for the estimate's market (`CLD-E409`) with the named price line, or a tag, in its currency (`CLD-E426`). Send an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"name":{"type":"string","minLength":1,"maxLength":80},"market":{"type":"string","enum":["in","us","sg","any"]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"facets":{"type":"object","properties":{"industry":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"function":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"persona":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"jurisdiction":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}}},"additionalProperties":false},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"rule_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"quantity":{"type":"integer","minimum":1,"maximum":10000000}},"required":["sku","quantity"],"additionalProperties":false}},"sort_order":{"type":"integer","minimum":0,"maximum":10000}},"required":["slug","name","market","currency","facets","lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"market":{"type":"string"},"currency":{"type":"string"},"facets":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","rule_id","quantity"],"additionalProperties":false}},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","retired"]},"changed":{"type":"boolean"},"created":{"type":"boolean"}},"required":["id","slug","name","market","currency","facets","lines","sort_order","status","changed","created"],"additionalProperties":false}}}}}},"get":{"summary":"Every estimate as it was applied","tags":["store"],"parameters":[{"schema":{"type":"string","enum":["active","retired"]},"in":"query","name":"status","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"market":{"type":"string"},"currency":{"type":"string"},"facets":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","rule_id","quantity"],"additionalProperties":false}},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","retired"]}},"required":["id","slug","name","market","currency","facets","lines","sort_order","status"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/admin/estimates/{slug}/retire":{"post":{"summary":"Retire an estimate: no audience shows it from here on","tags":["store"],"description":"What the catalogue's apply does for an estimate whose file was removed. The row is kept; applying the slug again makes it active again. Send an Idempotency-Key.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"market":{"type":"string"},"currency":{"type":"string"},"facets":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","rule_id","quantity"],"additionalProperties":false}},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","retired"]}},"required":["id","slug","name","market","currency","facets","lines","sort_order","status"],"additionalProperties":false}}}}}}},"/v1/store/audiences":{"get":{"summary":"Every audience the catalogue makes: the combinations of terms that listed cards carry","tags":["store"],"description":"Public. An audience is at most one term each of industry, function, persona and jurisdiction that at least `min_offers` listed outcome cards all carry. ONE ROW PER DISTINCT SET OF CARDS: combinations that select the same cards are one audience under the key with the fewest terms, and the others are its `same_as` (a page for one of them is that page). `depth` is the most terms combined (default 2, at most 4). `market` keeps to the cards priced for one market. Most cards first. Answers an `ETag` and `304` to a matching `If-None-Match`.","parameters":[{"schema":{"type":"string","enum":["in","us","sg"]},"in":"query","name":"market","required":false},{"schema":{"default":2,"type":"integer","minimum":1,"maximum":4},"in":"query","name":"depth","required":false},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"min_offers","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":["string","null"]},"depth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"audiences":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"terms":{"type":"array","items":{"type":"object","properties":{"facet":{"type":"string","enum":["industry","function","persona","jurisdiction"]},"slug":{"type":"string"},"name":{"type":"string"}},"required":["facet","slug","name"],"additionalProperties":false}},"offer_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priced_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"orderable_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"same_as":{"type":"array","items":{"type":"string"}},"estimates":{"type":"array","items":{"type":"string"}}},"required":["key","terms","offer_count","priced_count","orderable_count","same_as","estimates"],"additionalProperties":false}}},"required":["market","depth","audiences"],"additionalProperties":false}}}},"304":{"description":"Default Response"}}}},"/v1/store/audiences/{key}":{"get":{"summary":"One audience: its cards, the price lines of a month's work, and its estimates priced now","tags":["store"],"description":"Public. `key` is `<facet>-<term>` joined by `__` in the order industry, function, persona, jurisdiction (`function-chartered-accountants__jurisdiction-india`); a string that is not a key is `CLD-E400`, a term that is not active or an audience no listed card is in is `CLD-E404`. `offers` are the listed outcome cards that carry every term, as `GET /v1/store/offers` serves them, by id, at most `limit`. `price_lines` are those cards' lines in `currency` (default: the currency most of them are priced in): each active `per_outcome` and `usage` rule, never a plan rate, with one unit at the list and at a public, live promotion's price. `estimates` are the catalogue's typical months this audience shows, in that currency, each line and total computed from the price rules on this read. An estimate is not a quote: nothing is held or charged, and amounts exclude tax as every price on the registry does.","parameters":[{"schema":{"type":"string","enum":["in","us","sg"]},"in":"query","name":"market","required":false},{"schema":{"type":"string","pattern":"^[A-Z]{3}$"},"in":"query","name":"currency","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1,"maxLength":400},"in":"path","name":"key","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"terms":{"type":"array","items":{"type":"object","properties":{"facet":{"type":"string","enum":["industry","function","persona","jurisdiction"]},"slug":{"type":"string"},"name":{"type":"string"}},"required":["facet","slug","name"],"additionalProperties":false}},"market":{"type":["string","null"]},"currency":{"type":["string","null"]},"offer_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"},"offers":{"type":"array","items":{"type":"object","properties":{"promotion_slugs":{"type":"array","items":{"type":"string"}},"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":"string"}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents","promotion_slug"],"additionalProperties":false}},"setup":{"anyOf":[{"type":"object","properties":{"scope":{"type":"string","enum":["entity"]},"domain":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},{"type":"string","pattern":"^[a-z][a-z0-9_]{0,31}\\.[a-z][a-z0-9_]{0,63}$"}]},"submission":{"type":"string","enum":["cell_record_ref","job_input"]},"layout":{"default":"sections","type":"string","enum":["sections","steps"]},"sections":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":60},"hint":{"type":"string","minLength":1,"maxLength":90},"kind":{"type":"string","enum":["overlay","connection","ledger","record","choice","first_review"]},"required":{"default":true,"type":"boolean"},"reuse":{"default":"entity","type":"string","enum":["entity"]},"summary":{"default":"none","type":"string","enum":["masked","none"]},"surface":{"type":"string","minLength":1,"maxLength":100},"connector":{"type":"string","minLength":1,"maxLength":100},"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"datasets":{"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"}},"fields":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"ledgers":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","enum":["zoho_books","csv","tally"]}},"options":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":200},"availability":{"default":"available","type":"string","enum":["available","coming_soon"]},"request_url":{"type":"string","maxLength":300,"format":"uri"},"connector":{"type":"string","minLength":1,"maxLength":100},"offer":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"}},"required":["id","label","availability"],"additionalProperties":false}}},"required":["id","label","kind","required","reuse","summary"],"additionalProperties":false}}},"required":["scope","domain","submission","layout","sections"],"additionalProperties":false},{"type":"null"}]},"id":{"type":"string"},"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"category":{"type":"string"},"shelf":{"type":["string","null"]},"market":{"type":"string"},"publisher":{"type":"string"},"certification":{"type":["string","null"]},"status":{"type":"string","enum":["draft","listed","paused","retired"]},"status_reason":{"type":["string","null"]},"pack":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"rebound_from":{"type":["string","null"]}},"required":["name","version"],"additionalProperties":false},{"type":"null"}]},"orderable":{"type":"boolean"},"orderable_in":{"type":"object","properties":{"in":{"type":"boolean"},"us":{"type":"boolean"},"sg":{"type":"boolean"}},"required":["in","us","sg"],"additionalProperties":false},"lifecycle":{"type":"string"},"sale_markets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sale_states":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"state":{"type":"string"},"opens_at":{"type":["string","null"]},"cohort":{"type":["string","null"]}},"required":["market","state","opens_at","cohort"],"additionalProperties":false}},"price_cents":{"type":"number"},"currency":{"type":"string"},"work_contract_id":{"type":["string","null"]},"quality_contract_id":{"type":["string","null"]},"sold_in":{"type":"array","items":{"type":"string"}},"waitlist":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"title":{"type":"string"},"name":{"type":["string","null"]},"included_units":{"type":"number"},"overage_rule_id":{"type":["string","null"]},"overage_cents":{"type":["number","null"]},"currency":{"type":"string"},"orderable":{"type":"boolean"},"member_rule_id":{"type":["string","null"]},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"included_unit":{"default":"outcome","type":"string"}},"required":["offer_id","slug","title","name","included_units","overage_rule_id","overage_cents","currency","orderable","included_unit"],"additionalProperties":false}},"facets":{"type":"object","properties":{"industry":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"function":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"jurisdiction":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"persona":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"channel":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}}},"required":["industry","function","jurisdiction","persona","channel"],"additionalProperties":false},"family":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"],"additionalProperties":false},{"type":"null"}]},"variant_axes":{"anyOf":[{"type":"object","properties":{"market":{"type":"string"},"jurisdiction":{"type":"string"},"tier":{"type":"string"},"channel":{"type":"string"}},"required":["market"],"additionalProperties":false},{"type":"null"}]},"cell_mode":{"type":["string","null"]},"min_commitment_cents":{"type":["number","null"]},"min_commitment_currency":{"type":["string","null"]},"price_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount_cents":{"type":"number"},"currency":{"type":"string"},"units":{"type":["number","null"]},"period_days":{"type":["number","null"]},"basis_points":{"type":["number","null"]},"label":{"type":"string"},"description":{"type":"string"},"overage":{"type":"boolean"},"unit":{"type":"string"},"compare_at_cents":{"type":["number","null"]},"renews":{"type":"boolean"},"max_units_per_submission":{"default":null,"type":["number","null"]},"sort_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"work_contract_id":{"type":["string","null"]},"unit_multiple":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_cap_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"setup_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"term_periods":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"release_cents":{"default":null,"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","amount_cents","currency","units","period_days","basis_points","label","description","unit","compare_at_cents","renews","max_units_per_submission","sort_order","selection_group","selection_label","max_records","work_contract_id","unit_multiple","monthly_cap_cents","setup_cents","term_periods","release_cents"],"additionalProperties":false}},"quality":{"type":"object","properties":{"measured":{"type":"boolean"},"jobs":{"type":"number"},"pass_rate":{"type":["number","null"]},"abstain_rate":{"type":["number","null"]},"median_wall_ms":{"type":["number","null"]},"note":{"type":"string"}},"required":["measured","jobs","pass_rate","abstain_rate","median_wall_ms","note"],"additionalProperties":false},"time_saved_basis":{"default":null,"anyOf":[{"type":"string","enum":["estimate","internal_study"]},{"type":"null"}]},"mark":{"default":null,"anyOf":[{"type":"object","properties":{"icon":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"hue":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"}},"required":["icon","hue"],"additionalProperties":false},{"type":"null"}]},"time_saved":{"default":null,"anyOf":[{"type":"object","properties":{"role":{"type":"string"},"minutes_per_outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes_at_gate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"basis":{"type":"string","enum":["internal_study"]},"study_date":{"type":"string"},"study_n":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"baseline":{"type":"string"},"size_note":{"type":["string","null"]}},"required":["role","minutes_per_outcome","minutes_at_gate","basis","study_date","study_n","baseline","size_note"],"additionalProperties":false},{"type":"null"}]}},"required":["setup","id","sku","slug","title","name","category","shelf","market","publisher","certification","status","orderable","orderable_in","lifecycle","sale_markets","sale_states","price_cents","currency","work_contract_id","quality_contract_id","sold_in","waitlist","kind","members","facets","family","variant_axes","price_rules","quality","time_saved_basis","mark","time_saved"],"additionalProperties":false}},"promotions":{"type":"array","items":{"type":"object","properties":{"promoted":{"type":"array","items":{"type":"object","properties":{"offer_id":{"type":"string"},"price_rule_id":{"type":"string"},"currency":{"type":"string"},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["offer_id","price_rule_id","currency","list_cents","promoted_cents"],"additionalProperties":false}},"slug":{"type":"string"},"kind":{"type":"string","enum":["percent_off","amount_off","free_units","credit"]},"display_text":{"type":"string"},"starts_at":{"type":"string"},"ends_at":{"type":["string","null"]},"scope":{"type":"object","properties":{"offer_ids":{"type":"array","items":{"type":"string"}},"shelf":{"type":"string"},"market":{"type":"string"},"any":{"type":"boolean"}},"additionalProperties":false}},"required":["promoted","slug","kind","display_text","starts_at","ends_at","scope"],"additionalProperties":false}},"price_lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"offer_id":{"type":"string"},"slug":{"type":["string","null"]},"name":{"type":["string","null"]},"title":{"type":"string"},"rule_id":{"type":"string"},"kind":{"type":"string","enum":["per_outcome","usage"]},"label":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string"},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":["string","null"]},"tiers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"from_units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from_units","amount_cents"],"additionalProperties":false}},{"type":"null"}]},"selection_group":{"type":["string","null"]},"selection_label":{"type":["string","null"]},"max_records":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"is_tag":{"type":"boolean"},"lifecycle":{"type":"string"},"orderable":{"type":"boolean"}},"required":["sku","offer_id","slug","name","title","rule_id","kind","label","description","unit","unit_multiple","currency","unit_cents","now_unit_cents","promotion_slug","tiers","selection_group","selection_label","max_records","is_tag","lifecycle","orderable"],"additionalProperties":false}},"estimates":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"market":{"type":"string"},"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"rule_id":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"},"unit":{"type":"string"},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":["string","null"]},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","rule_id","quantity","label","unit","unit_multiple","unit_cents","now_unit_cents","promotion_slug","list_cents","now_cents"],"additionalProperties":false}},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"omitted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["slug","name","market","currency","lines","list_cents","now_cents","omitted"],"additionalProperties":false}},"generated_at":{"type":"string"}},"required":["key","terms","market","currency","offer_count","has_more","offers","promotions","price_lines","estimates","generated_at"],"additionalProperties":false}}}}}}},"/v1/store/estimates":{"post":{"summary":"Price a month's work: quantities of listed cards' price lines, at the list and at today's price","tags":["store"],"description":"Public and rate-limited by address (`CLD-E430` with `Retry-After`). Each line is a listed outcome card by SKU, optionally the price line (`rule_id`, else the card's tag in the currency) and a count of units in a month. `currency` defaults to the first card's own. A line is priced as `GET /v1/store/audiences/{key}` prices an estimate: the tag times the count, a metered line unit by unit through its tiers. A SKU no listed card has is `CLD-E404`, a card priced for another market `CLD-E409`, no price in the currency `CLD-E426`, a `rule_id` that is not one of the card's lines `CLD-E400`. This is an estimate at the list, never a quote: it reads no organisation, holds nothing and charges nothing, and amounts exclude tax.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":"string","enum":["in","us","sg"]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"rule_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"quantity":{"type":"integer","minimum":0,"maximum":10000000}},"required":["sku","quantity"],"additionalProperties":false}}},"required":["lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":["string","null"]},"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{8}$"},"rule_id":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"},"unit":{"type":"string"},"unit_multiple":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_unit_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promotion_slug":{"type":["string","null"]},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","rule_id","quantity","label","unit","unit_multiple","unit_cents","now_unit_cents","promotion_slug","list_cents","now_cents"],"additionalProperties":false}},"list_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"now_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"generated_at":{"type":"string"}},"required":["market","currency","lines","list_cents","now_cents","generated_at"],"additionalProperties":false}}}}}}}},"servers":[{"url":"https://api.areev.ai"}],"tags":[{"name":"meta","description":"Health and version"},{"name":"auth","description":"Sign-in, sessions, credentials"},{"name":"tenancy","description":"Organisations, membership"},{"name":"memories","description":"Memory provisioning and credentials"},{"name":"entities","description":"Business identity administration"},{"name":"cells","description":"The cell registry and control channel"},{"name":"packs","description":"The pack registry and deployments"},{"name":"jobs","description":"Jobs, approvals and evidence"},{"name":"ledger","description":"Wallet, ledger and payments"},{"name":"connectors","description":"Mailboxes, ledgers and the consents behind them"},{"name":"store","description":"The catalog, orders and entitlements"}]}