{"openapi":"3.0.3","info":{"title":"worker-platform","description":"Independent application platform control plane","version":"1.0.0"},"components":{"securitySchemes":{"tenantToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"managerToken":{"type":"http","scheme":"bearer","description":"MANAGER_TOKEN reaches every environment. A token bound to one environment (ENVIRONMENT_MANAGER_TOKENS) stays in it: a request naming another environment answers 403 manager_scope_denied, a list without one lists its own, a Worker or billing account outside it answers 404, it reaches only Stripe test-mode billing accounts, it acts on a tenant as a whole (mints for it, keys it, switches its services, deletes it, reads or sets its payer) only when the tenant has no other environment, no live-mode payer and, while it has no environment of the token's own, no Worker name released within the name cooldown (403 manager_scope_denied otherwise), and routes that act on the whole platform (AirRouter prices and upstreams, Exa reconciliation) answer 403 manager_scope_denied."},"appKey":{"type":"http","scheme":"bearer","bearerFormat":"ak_<environment>_<random>"},"billingToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"routerKey":{"type":"http","scheme":"bearer","bearerFormat":"rk_<random>"}},"schemas":{}},"paths":{"/v1/admin/tenants":{"get":{"description":"List application environments for manager navigation; the filters combine. With `group=tenant`, one row per tenant listing its matching environments. With `limit`, one page (1 to 100 rows, a larger limit is clamped) and the matching `total`; `tenant` or `tenants` without `limit` returns all of those tenants' rows; any other query without `limit` returns the first 50. Order: tenant id, then environment name. With no query at all (deprecated: kept for older integrator builds and the console), every environment as `{id, environment, maxWorkers}`.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false,"description":"Exactly this tenant."},{"schema":{"type":"string"},"in":"query","name":"tenants","required":false,"description":"Any of these tenants: comma-separated ids, at most 100."},{"schema":{"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false,"description":"Exactly this environment name."},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Case-insensitive substring of the tenant id or of a worker name in the environment; trimmed, at most 200 characters are used."},{"schema":{"type":"string","enum":["tenant"]},"in":"query","name":"group","required":false,"description":"One row per tenant: `{id, environments}`, its matching environment names A to Z."},{"schema":{"type":"integer"},"in":"query","name":"limit","required":false,"description":"Page size, clamped to 1 to 100."},{"schema":{"type":"integer"},"in":"query","name":"offset","required":false,"description":"Rows to skip; below 0 counts as 0."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenants"],"properties":{"tenants":{"type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"description":"The tenant id.","type":"string"},"environment":{"description":"Absent with `group=tenant`.","type":"string"},"maxWorkers":{"description":"Absent with `group=tenant`.","type":"integer"},"workers":{"description":"The environment's worker names A to Z. Absent without a query and with `group=tenant`.","type":"array","items":{"type":"string"}},"environments":{"description":"With `group=tenant`: the matching environment names A to Z.","type":"array","items":{"type":"string"}}}}},"total":{"description":"Rows the filters match; tenants with `group=tenant`. Absent without a query.","type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}}}}},"/v1/admin/tenants/summary":{"get":{"description":"How many tenants have an application environment: in all, and per environment name (A to Z). A manager token bound to an environment counts only that one.","security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenants","environments"],"properties":{"tenants":{"type":"integer"},"environments":{"type":"array","items":{"type":"object","required":["name","tenants"],"properties":{"name":{"type":"string"},"tenants":{"type":"integer"}}}}}}}}}}}},"/v1/databases":{"get":{"description":"List persistent databases and their bound services.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["databases"],"properties":{"databases":{"type":"array","items":{"type":"object","required":["id","name","environmentId","createdAt","workers"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentId":{"type":"string"},"createdAt":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}}}}}}}}}}},"post":{"description":"Create a named database, or return it if it already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","environmentId","createdAt","workers"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentId":{"type":"string"},"createdAt":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}}}}}}}}},"/v1/databases/{name}":{"delete":{"description":"Delete an unbound database. Bound databases return database_in_use.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/databases/{name}/tables":{"get":{"description":"Inspect the database table definitions.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["result"],"properties":{"result":{"type":"array","items":{}}}}}}}}}},"/v1/admin/databases":{"get":{"description":"List persistent databases and their bound services.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["databases"],"properties":{"databases":{"type":"array","items":{"type":"object","required":["id","name","environmentId","createdAt","workers"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentId":{"type":"string"},"createdAt":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}}}}}}}}}}},"post":{"description":"Create a named database, or return it if it already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","name","environmentId","createdAt","workers"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentId":{"type":"string"},"createdAt":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}}}}}}}}},"/v1/admin/databases/{name}":{"delete":{"description":"Delete an unbound database. Bound databases return database_in_use.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/databases/{name}/tables":{"get":{"description":"Inspect the database table definitions.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["result"],"properties":{"result":{"type":"array","items":{}}}}}}}}}},"/v1/identity":{"get":{"description":"Resolve the authenticated application/environment, including opaque API keys.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenant","environment","maxWorkers"],"properties":{"tenant":{"type":"string"},"environment":{"type":"string"},"maxWorkers":{"type":"integer"}}}}}}}}},"/v1/workers/{name}/deployments":{"get":{"description":"List retained deployments newest first, without exposing storage object keys.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deployments"],"properties":{"deployments":{"type":"array","items":{"type":"object","required":["id","sizeBytes","fileCount","hasAssets","createdAt"],"properties":{"id":{"type":"string"},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"}}}}}}}}}}}},"/v1/admin/workers/{name}/deployments":{"get":{"description":"List retained deployments newest first, without exposing storage object keys.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deployments"],"properties":{"deployments":{"type":"array","items":{"type":"object","required":["id","sizeBytes","fileCount","hasAssets","createdAt"],"properties":{"id":{"type":"string"},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"}}}}}}}}}}}},"/v1/tenants/{tenant}/keys":{"post":{"description":"Issue an environment-scoped API key. Its secret is returned only once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment","label"],"properties":{"environment":{"minLength":1,"maxLength":63,"pattern":"^[a-z0-9][a-z0-9_-]*$","type":"string"},"label":{"minLength":1,"maxLength":100,"type":"string"},"maxWorkers":{"minimum":0,"type":"integer"},"scope":{"description":"full: every tenant route, like a tenant token. crash-dsyms: only uploading and listing dSYMs for AirFeedback's crash reports (POST /v1/feedback/dsyms, POST /v1/feedback/dsyms/complete, GET /v1/feedback/dsyms) and GET /v1/identity; any other route answers 403 key_scope_denied.","anyOf":[{"type":"string","enum":["full"]},{"type":"string","enum":["crash-dsyms"]}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["id","label","suffix","createdAt","maxWorkers","scope","environment"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"suffix":{"type":"string"},"createdAt":{"type":"string"},"maxWorkers":{"type":"integer"},"scope":{"description":"full: every tenant route, like a tenant token. crash-dsyms: only uploading and listing dSYMs for AirFeedback's crash reports (POST /v1/feedback/dsyms, POST /v1/feedback/dsyms/complete, GET /v1/feedback/dsyms) and GET /v1/identity; any other route answers 403 key_scope_denied.","anyOf":[{"type":"string","enum":["full"]},{"type":"string","enum":["crash-dsyms"]}]},"environment":{"type":"string"}}},{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}]}}}}}},"get":{"description":"List API key metadata; secrets and digests are never returned.","parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"object","required":["id","label","suffix","createdAt","maxWorkers","scope","environment"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"suffix":{"type":"string"},"createdAt":{"type":"string"},"maxWorkers":{"type":"integer"},"scope":{"description":"full: every tenant route, like a tenant token. crash-dsyms: only uploading and listing dSYMs for AirFeedback's crash reports (POST /v1/feedback/dsyms, POST /v1/feedback/dsyms/complete, GET /v1/feedback/dsyms) and GET /v1/identity; any other route answers 403 key_scope_denied.","anyOf":[{"type":"string","enum":["full"]},{"type":"string","enum":["crash-dsyms"]}]},"environment":{"type":"string"}}}}}}}}}}}},"/v1/tenants/{tenant}/keys/{keyId}":{"delete":{"description":"Revoke a tenant API key immediately.","parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"keyId","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/app-key":{"get":{"description":"Get this environment's public ingestion key and endpoints.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["key","environment","bundleId","feedbackEndpoint","purchaseEndpoint","crashEndpoint","trafficHost"],"properties":{"key":{"type":"string"},"environment":{"type":"string"},"bundleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"feedbackEndpoint":{"type":"string"},"purchaseEndpoint":{"type":"string"},"crashEndpoint":{"description":"AirFeedback's crash reports: where the app's crash file posts its reports, with this key.","type":"string"},"trafficHost":{"description":"AirTraffic: the host to give the PostHog SDKs, with this key as the project API key.","type":"string"}}}}}}}}},"/v1/tenants/{tenant}/app-keys":{"get":{"description":"Get or initialize an environment's public App Key.","parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["key","environment","bundleId","feedbackEndpoint","purchaseEndpoint","crashEndpoint","trafficHost"],"properties":{"key":{"type":"string"},"environment":{"type":"string"},"bundleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"feedbackEndpoint":{"type":"string"},"purchaseEndpoint":{"type":"string"},"crashEndpoint":{"description":"AirFeedback's crash reports: where the app's crash file posts its reports, with this key.","type":"string"},"trafficHost":{"description":"AirTraffic: the host to give the PostHog SDKs, with this key as the project API key.","type":"string"}}}}}}}},"post":{"description":"Rotate the public App Key; old app builds using the old key stop reporting.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"minLength":1,"maxLength":63,"type":"string"},"bundleId":{"anyOf":[{"minLength":1,"maxLength":255,"type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["key","environment","bundleId","feedbackEndpoint","purchaseEndpoint","crashEndpoint","trafficHost"],"properties":{"key":{"type":"string"},"environment":{"type":"string"},"bundleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"feedbackEndpoint":{"type":"string"},"purchaseEndpoint":{"type":"string"},"crashEndpoint":{"description":"AirFeedback's crash reports: where the app's crash file posts its reports, with this key.","type":"string"},"trafficHost":{"description":"AirTraffic: the host to give the PostHog SDKs, with this key as the project API key.","type":"string"}}}}}}}},"patch":{"description":"Update the expected bundle ID without rotating the deployed public key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"minLength":1,"maxLength":63,"type":"string"},"bundleId":{"anyOf":[{"minLength":1,"maxLength":255,"type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["key","environment","bundleId","feedbackEndpoint","purchaseEndpoint","crashEndpoint","trafficHost"],"properties":{"key":{"type":"string"},"environment":{"type":"string"},"bundleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"feedbackEndpoint":{"type":"string"},"purchaseEndpoint":{"type":"string"},"crashEndpoint":{"description":"AirFeedback's crash reports: where the app's crash file posts its reports, with this key.","type":"string"},"trafficHost":{"description":"AirTraffic: the host to give the PostHog SDKs, with this key as the project API key.","type":"string"}}}}}}}}},"/v1/ingest/feedback":{"post":{"description":"Submit feedback using a public App Key. This credential grants no read access. Optional device proof: X-Attest-Key-Id and X-Attest-Assertion (an App Attest assertion over SHA-256 of the exact body); the entry is stored either way, verified or not, and X-Attest-Status answers verified, unverified or unknown-key (attest the key again).","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"message":{"description":"At most 4000 grapheme clusters after trimming.","type":"string"},"images":{"maxItems":4,"type":"array","items":{"type":"object","required":["mediaType","data"],"properties":{"mediaType":{"anyOf":[{"type":"string","enum":["image/jpeg"]},{"type":"string","enum":["image/png"]},{"type":"string","enum":["image/heic"]},{"type":"string","enum":["image/webp"]}]},"data":{"maxLength":11184812,"type":"string"}}}}}}}}},"security":[{"appKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"format":"uuid","type":"string"}}}}}}}}},"/v1/feedback":{"get":{"description":"List feedback newest first using an opaque keyset cursor; the optional filters combine.","parameters":[{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"string","enum":["uncategorized"]}]},"in":"query","name":"category","required":false,"description":"other also matches entries not placed yet; uncategorized matches only those; crash matches crash reports."},{"schema":{"anyOf":[{"type":"string","enum":["crash"]},{"type":"string","enum":["feedback"]}]},"in":"query","name":"kind","required":false,"description":"crash: only crash reports; feedback: everything but crash reports."},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"issue","required":false,"description":"Only the crash entries of this crash issue."},{"schema":{"anyOf":[{"type":"string","enum":["people"]},{"type":"string","enum":["agents"]}]},"in":"query","name":"sender","required":false,"description":"agents: entries whose metadata.alertsOwner is false (agent notes)."},{"schema":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["done"]}]},"in":"query","name":"status","required":false},{"schema":{"type":"boolean"},"in":"query","name":"verified","required":false,"description":"true: only entries a device proved (hide unverified); false: only the unverified ones."},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"q","required":false,"description":"Case-insensitive substring of the message, appVersion, deviceModel or osVersion, or of a crash entry's issue title or subtitle."}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"description":"Set on crash entries (category crash), null on everything else.","type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/feedback/summary":{"get":{"description":"The inbox's numbers over every entry in scope: totals, the last 30 days in tz (crash reports also on their own), per-category counts, the open crash issues and installs that crashed, and the dSYMs crash reports are waiting for.","parameters":[{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."},{"schema":{"type":"boolean"},"in":"query","name":"verified","required":false,"description":"true: only entries a device proved (hide unverified); false: only the unverified ones."}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["total","open","thisWeek","withScreenshots","latest","days","categories","agentNotes","crashes","missingDsyms"],"properties":{"total":{"type":"integer"},"open":{"type":"integer"},"thisWeek":{"description":"Arrived in the last 7 × 24 hours.","type":"integer"},"withScreenshots":{"type":"integer"},"latest":{"anyOf":[{"type":"object","required":["createdAt","appVersion"],"properties":{"createdAt":{"format":"date-time","type":"string"},"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count","crash"],"properties":{"date":{"format":"date","type":"string"},"count":{"description":"Every entry, crash reports included.","type":"integer"},"crash":{"description":"The crash reports among them.","type":"integer"}}}},"categories":{"description":"People's entries only; agent notes are counted in agentNotes.","type":"object","required":["problem","request","other","uncategorized","crash"],"properties":{"problem":{"type":"integer"},"request":{"type":"integer"},"other":{"description":"Includes uncategorized.","type":"integer"},"uncategorized":{"type":"integer"},"crash":{"description":"Crash reports (never in the other categories).","type":"integer"}}},"agentNotes":{"type":"integer"},"crashes":{"type":"object","required":["openIssues","installs30d"],"properties":{"openIssues":{"description":"Crash issues not marked fixed.","type":"integer"},"installs30d":{"description":"Installs that crashed in the last 30 days (rolling).","type":"integer"}}},"missingDsyms":{"description":"dSYMs crash reports are waiting for, most reports first (at most 20).","type":"array","items":{"type":"object","required":["uuid","image","appVersion","build","reports"],"properties":{"uuid":{"type":"string"},"image":{"type":"string"},"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"reports":{"type":"integer"}}}}}}}}}}}},"/v1/feedback/categories":{"put":{"description":"File entries under problem, request or other. Ids outside the scope are skipped; owner state only, no event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["items"],"properties":{"items":{"minItems":1,"maxItems":100,"type":"array","items":{"additionalProperties":false,"type":"object","required":["id","category"],"properties":{"id":{"format":"uuid","type":"string"},"category":{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]}}}}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["updated"],"properties":{"updated":{"type":"integer"}}}}}}}}},"/v1/feedback/{id}":{"get":{"description":"Read feedback without exposing storage object keys. A crash entry's crash also has its issue (with reports by app version, OS version and device) and the whole report.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms","issue","report"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}},"issue":{"anyOf":[{"type":"object","required":["id","title","subtitle","status","firstSeen","lastSeen","count","installs","appVersions","resolvedAt","regressedAt","versions","osVersions","devices"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]}]},"firstSeen":{"format":"date-time","type":"string"},"lastSeen":{"format":"date-time","type":"string"},"count":{"type":"integer"},"installs":{"description":"Distinct installIDs.","type":"integer"},"appVersions":{"type":"array","items":{"type":"string"}},"resolvedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"regressedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"versions":{"type":"array","items":{"type":"object","required":["appVersion","count"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}},"osVersions":{"type":"array","items":{"type":"object","required":["osVersion","count"],"properties":{"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","required":["model","count"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}}}},{"type":"null"}]},"report":{"type":"object","required":["id","occurredAt","receivedAt","installID","threads","images"],"properties":{"id":{"format":"uuid","type":"string"},"occurredAt":{"format":"date-time","type":"string"},"receivedAt":{"format":"date-time","type":"string"},"installID":{"format":"uuid","type":"string"},"threads":{"description":"Crashed thread first, symbolicated as far as the dSYMs allow.","type":"array","items":{"type":"object","required":["crashed","frames"],"properties":{"crashed":{"type":"boolean"},"frames":{"type":"array","items":{"type":"object","required":["image","uuid","offset","inApp","symbol","symbolOffset","file","line","inlined"],"properties":{"image":{"type":"string"},"uuid":{"type":"string"},"offset":{"type":"integer"},"inApp":{"type":"boolean"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"symbolOffset":{"anyOf":[{"type":"integer"},{"type":"null"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"type":"integer"},{"type":"null"}]},"inlined":{"description":"Functions inlined at this address, innermost first; the frame's symbol, file and line are its own function and the call's line.","type":"array","items":{"type":"object","required":["symbol","file","line"],"properties":{"symbol":{"type":"string"},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"type":"integer"},{"type":"null"}]}}}}}}}}}},"images":{"type":"array","items":{"type":"object","required":["name","uuid","inApp"],"properties":{"name":{"type":"string"},"uuid":{"type":"string"},"inApp":{"type":"boolean"}}}}}}}},{"type":"null"}]}}}}}}}},"patch":{"description":"Mark feedback done or not done. Owner state only; idempotent, and a repeated done keeps the first time. On a crash entry done means fixed: once grouped, it resolves (or reopens) the crash issue and marks (or clears) every entry of that issue so far; a later crash from a binary the issue had not crashed in reopens it as a new open entry, and one from a binary it had is filed fixed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["done"],"properties":{"done":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"description":"Set on crash entries (category crash), null on everything else.","type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}}}}}},"delete":{"description":"Delete feedback and its stored images. A crash entry is deleted with its crash report.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/feedback/{id}/images/{n}":{"get":{"description":"Resolve a five-minute signed image URL after checking scope. Default redirects; format=json supports credential-free browser image loading.","parameters":[{"schema":{"type":"string","enum":["json"]},"in":"query","name":"format","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minimum":0,"maximum":3,"type":"integer"},"in":"path","name":"n","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/feedback":{"get":{"description":"List feedback newest first using an opaque keyset cursor; the optional filters combine.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"string","enum":["uncategorized"]}]},"in":"query","name":"category","required":false,"description":"other also matches entries not placed yet; uncategorized matches only those; crash matches crash reports."},{"schema":{"anyOf":[{"type":"string","enum":["crash"]},{"type":"string","enum":["feedback"]}]},"in":"query","name":"kind","required":false,"description":"crash: only crash reports; feedback: everything but crash reports."},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"issue","required":false,"description":"Only the crash entries of this crash issue."},{"schema":{"anyOf":[{"type":"string","enum":["people"]},{"type":"string","enum":["agents"]}]},"in":"query","name":"sender","required":false,"description":"agents: entries whose metadata.alertsOwner is false (agent notes)."},{"schema":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["done"]}]},"in":"query","name":"status","required":false},{"schema":{"type":"boolean"},"in":"query","name":"verified","required":false,"description":"true: only entries a device proved (hide unverified); false: only the unverified ones."},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"q","required":false,"description":"Case-insensitive substring of the message, appVersion, deviceModel or osVersion, or of a crash entry's issue title or subtitle."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"description":"Set on crash entries (category crash), null on everything else.","type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/feedback/summary":{"get":{"description":"The inbox's numbers over every entry in scope: totals, the last 30 days in tz (crash reports also on their own), per-category counts, the open crash issues and installs that crashed, and the dSYMs crash reports are waiting for.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."},{"schema":{"type":"boolean"},"in":"query","name":"verified","required":false,"description":"true: only entries a device proved (hide unverified); false: only the unverified ones."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["total","open","thisWeek","withScreenshots","latest","days","categories","agentNotes","crashes","missingDsyms"],"properties":{"total":{"type":"integer"},"open":{"type":"integer"},"thisWeek":{"description":"Arrived in the last 7 × 24 hours.","type":"integer"},"withScreenshots":{"type":"integer"},"latest":{"anyOf":[{"type":"object","required":["createdAt","appVersion"],"properties":{"createdAt":{"format":"date-time","type":"string"},"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count","crash"],"properties":{"date":{"format":"date","type":"string"},"count":{"description":"Every entry, crash reports included.","type":"integer"},"crash":{"description":"The crash reports among them.","type":"integer"}}}},"categories":{"description":"People's entries only; agent notes are counted in agentNotes.","type":"object","required":["problem","request","other","uncategorized","crash"],"properties":{"problem":{"type":"integer"},"request":{"type":"integer"},"other":{"description":"Includes uncategorized.","type":"integer"},"uncategorized":{"type":"integer"},"crash":{"description":"Crash reports (never in the other categories).","type":"integer"}}},"agentNotes":{"type":"integer"},"crashes":{"type":"object","required":["openIssues","installs30d"],"properties":{"openIssues":{"description":"Crash issues not marked fixed.","type":"integer"},"installs30d":{"description":"Installs that crashed in the last 30 days (rolling).","type":"integer"}}},"missingDsyms":{"description":"dSYMs crash reports are waiting for, most reports first (at most 20).","type":"array","items":{"type":"object","required":["uuid","image","appVersion","build","reports"],"properties":{"uuid":{"type":"string"},"image":{"type":"string"},"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"reports":{"type":"integer"}}}}}}}}}}}},"/v1/admin/feedback/categories":{"put":{"description":"File entries under problem, request or other. Ids outside the scope are skipped; owner state only, no event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["items"],"properties":{"items":{"minItems":1,"maxItems":100,"type":"array","items":{"additionalProperties":false,"type":"object","required":["id","category"],"properties":{"id":{"format":"uuid","type":"string"},"category":{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]}}}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["updated"],"properties":{"updated":{"type":"integer"}}}}}}}}},"/v1/admin/feedback/{id}":{"get":{"description":"Read feedback without exposing storage object keys. A crash entry's crash also has its issue (with reports by app version, OS version and device) and the whole report.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms","issue","report"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}},"issue":{"anyOf":[{"type":"object","required":["id","title","subtitle","status","firstSeen","lastSeen","count","installs","appVersions","resolvedAt","regressedAt","versions","osVersions","devices"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"type":"string"},"subtitle":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]}]},"firstSeen":{"format":"date-time","type":"string"},"lastSeen":{"format":"date-time","type":"string"},"count":{"type":"integer"},"installs":{"description":"Distinct installIDs.","type":"integer"},"appVersions":{"type":"array","items":{"type":"string"}},"resolvedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"regressedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"versions":{"type":"array","items":{"type":"object","required":["appVersion","count"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}},"osVersions":{"type":"array","items":{"type":"object","required":["osVersion","count"],"properties":{"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","required":["model","count"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"}}}}}},{"type":"null"}]},"report":{"type":"object","required":["id","occurredAt","receivedAt","installID","threads","images"],"properties":{"id":{"format":"uuid","type":"string"},"occurredAt":{"format":"date-time","type":"string"},"receivedAt":{"format":"date-time","type":"string"},"installID":{"format":"uuid","type":"string"},"threads":{"description":"Crashed thread first, symbolicated as far as the dSYMs allow.","type":"array","items":{"type":"object","required":["crashed","frames"],"properties":{"crashed":{"type":"boolean"},"frames":{"type":"array","items":{"type":"object","required":["image","uuid","offset","inApp","symbol","symbolOffset","file","line","inlined"],"properties":{"image":{"type":"string"},"uuid":{"type":"string"},"offset":{"type":"integer"},"inApp":{"type":"boolean"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"symbolOffset":{"anyOf":[{"type":"integer"},{"type":"null"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"type":"integer"},{"type":"null"}]},"inlined":{"description":"Functions inlined at this address, innermost first; the frame's symbol, file and line are its own function and the call's line.","type":"array","items":{"type":"object","required":["symbol","file","line"],"properties":{"symbol":{"type":"string"},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"type":"integer"},{"type":"null"}]}}}}}}}}}},"images":{"type":"array","items":{"type":"object","required":["name","uuid","inApp"],"properties":{"name":{"type":"string"},"uuid":{"type":"string"},"inApp":{"type":"boolean"}}}}}}}},{"type":"null"}]}}}}}}}},"patch":{"description":"Mark feedback done or not done. Owner state only; idempotent, and a repeated done keeps the first time. On a crash entry done means fixed: once grouped, it resolves (or reopens) the crash issue and marks (or clears) every entry of that issue so far; a later crash from a binary the issue had not crashed in reopens it as a new open entry, and one from a binary it had is filed fixed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["done"],"properties":{"done":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","message","imageCount","images","metadata","doneAt","category","verified","createdAt","crash"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"message":{"type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"imageCount":{"type":"integer"},"images":{"type":"array","items":{"type":"object","required":["mediaType","sizeBytes","path"],"properties":{"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"},"path":{"type":"string"}}}},"metadata":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"doneAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"category":{"description":"Where the owner's inbox files it; null until placed, which reads as other. crash: an app crash report, never changed.","anyOf":[{"anyOf":[{"anyOf":[{"type":"string","enum":["problem"]},{"type":"string","enum":["request"]},{"type":"string","enum":["other"]}]},{"type":"string","enum":["crash"]}]},{"type":"null"}]},"verified":{"description":"A real device running the genuine app proved it sent this (App Attest); false for everything else, which the inbox tags 未验证 / Unverified. Never a reason it was refused.","type":"boolean"},"createdAt":{"format":"date-time","description":"For a crash entry, when it crashed.","type":"string"},"crash":{"anyOf":[{"description":"Set on crash entries (category crash), null on everything else.","type":"object","required":["reportId","issueId","status","title","location","exceptionType","subtitle","occurredAt","exception","app","device","occurrences","issueStatus","missingDsyms"],"properties":{"reportId":{"format":"uuid","type":"string"},"issueId":{"description":"Null until the background symbolication groups the report.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["symbolicated"]}]},"title":{"description":"<crashing in-app function> — <exception type> once symbolicated; null while pending (the app shows its own pending text).","anyOf":[{"type":"string"},{"type":"null"}]},"location":{"description":"The crashing in-app function (symbol, or image + offset without a dSYM); null while pending.","anyOf":[{"type":"string"},{"type":"null"}]},"exceptionType":{"description":"The exception's name, else the Mach exception and signal (EXC_BAD_ACCESS (SIGSEGV)).","type":"string"},"subtitle":{"description":"The subtitle's parts; the app formats them.","type":"object","required":["appVersion","deviceModel","osVersion"],"properties":{"appVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurredAt":{"format":"date-time","type":"string"},"exception":{"type":"object","required":["type","code","signal","name","message","terminationReason"],"properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"app":{"type":"object","required":["version","build","bundleID"],"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","required":["model","os","osVersion","osBuild","arch","locale"],"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"occurrences":{"description":"Reports in the entry's issue; null until grouped.","anyOf":[{"type":"integer"},{"type":"null"}]},"issueStatus":{"anyOf":[{"type":"string","enum":["open"]},{"type":"string","enum":["resolved"]},{"type":"null"}]},"missingDsyms":{"description":"In-app image UUIDs without a dSYM when last symbolicated.","type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}}}}}},"delete":{"description":"Delete feedback and its stored images. A crash entry is deleted with its crash report.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/feedback/{id}/images/{n}":{"get":{"description":"Resolve a five-minute signed image URL after checking scope. Default redirects; format=json supports credential-free browser image loading.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"type":"string","enum":["json"]},"in":"query","name":"format","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minimum":0,"maximum":3,"type":"integer"},"in":"path","name":"n","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/ingest/attestation/challenge":{"post":{"description":"A single-use challenge for attesting a device key, valid 5 minutes. App Attest: pass SHA-256 of its UTF-8 bytes as clientDataHash to attestKey.","security":[{"appKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["challenge","expiresAt"],"properties":{"challenge":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/ingest/attestation":{"post":{"description":"Attest a device key once. app-attest: the attestation object from DCAppAttestService.attestKey, checked against Apple's App Attestation root, the challenge, appId (<team id>.<the app's registered bundle id>) and the production environment. 201 the key is kept and its assertions make reports verified; 422 (attestation_invalid, attestation_development, challenge_invalid, bundle_id_unregistered): the key is not kept and reports stay unverified — they are never refused for it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["scheme","keyId","attestation","challenge","appId"],"properties":{"scheme":{"type":"string","enum":["app-attest"]},"keyId":{"minLength":1,"maxLength":128,"description":"Base64, as the device names the key.","type":"string"},"attestation":{"minLength":1,"maxLength":49152,"description":"Base64 of the attestation object.","type":"string"},"challenge":{"minLength":1,"maxLength":128,"type":"string"},"appId":{"minLength":12,"maxLength":266,"description":"<team id>.<bundle id>","type":"string"}}}}}},"security":[{"appKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["keyId","verified"],"properties":{"keyId":{"type":"string"},"verified":{"type":"boolean","enum":[true]}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/ingest/purchase-reports":{"post":{"description":"Record a purchase the app's own server confirmed with its payment provider, signed with a purchase key. 201 recorded; the same transaction ID again with the same fields is 200 already_recorded, with different fields 409 transaction_conflict. 401: invalid_purchase_key, purchase_key_revoked, invalid_signature, report_expired.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["keyId","timestamp","signature","transactionId","productId","amount","currency","purchasedAt","source","environment"],"properties":{"keyId":{"pattern":"^apk_[A-Za-z0-9_-]{22}$","description":"The purchase key's public id, apk_…","type":"string"},"timestamp":{"minimum":0,"maximum":100000000000,"description":"When this request was signed, Unix seconds. Refused beyond 300 seconds from the platform's clock.","type":"integer"},"signature":{"minLength":64,"maxLength":64,"description":"Hex HMAC-SHA256, keyed by the secret's UTF-8 bytes, over the canonical report: \"AirPayment-Report-v1\" (or \"AirPayment-Report-v2\" when distinctId, isRenewal or attribution is sent), keyId, timestamp, transactionId, productId, amount, currency, purchasedAt, source, environment (and for v2: distinctId, isRenewal, canonical attribution JSON) joined by \\n, UTF-8, no trailing newline (docs/ingestion.md).","type":"string"},"transactionId":{"minLength":1,"maxLength":256,"description":"The payment provider's transaction ID; recorded once per environment.","type":"string"},"productId":{"minLength":1,"maxLength":256,"description":"What was bought, the app's own product ID.","type":"string"},"amount":{"minLength":1,"maxLength":16,"description":"Decimal string in the currency's major unit, at most 3 decimals: \"6.00\", \"0.99\", \"120\".","type":"string"},"currency":{"pattern":"^[A-Z]{3}$","description":"ISO 4217 code, e.g. CNY.","type":"string"},"purchasedAt":{"minimum":0,"maximum":100000000000000,"description":"When the payment was confirmed, Unix milliseconds.","type":"integer"},"source":{"minLength":1,"maxLength":64,"description":"How the buyer paid, shown verbatim in the purchase list, e.g. 微信支付, Alipay, Stripe.","type":"string"},"environment":{"description":"sandbox for test payments: kept out of revenue, like App Store sandbox purchases.","anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["recorded"]},{"type":"string","enum":["already_recorded"]}]}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["recorded"]},{"type":"string","enum":["already_recorded"]}]}}}}}}}}},"/v1/purchase-keys":{"get":{"description":"List the environment's purchase keys, revoked ones included. Secrets are never returned. The keys AirHost binds to Workers are not listed: they are managed by the platform.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"type":"string"},"keys":{"type":"array","items":{"type":"object","required":["id","name","environment","createdAt","lastUsedAt","revokedAt"],"properties":{"id":{"description":"The public key id (apk_…) reports carry as keyId.","type":"string"},"name":{"type":"string"},"environment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}},"post":{"description":"Create a named purchase key. Its secret is in this response only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":100,"type":"string"}}}}}},"security":[{"tenantToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["id","name","environment","createdAt","lastUsedAt","revokedAt"],"properties":{"id":{"description":"The public key id (apk_…) reports carry as keyId.","type":"string"},"name":{"type":"string"},"environment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"object","required":["secret","endpoint"],"properties":{"secret":{"description":"apsk_…: returned only here, never again. Keep it on the server.","type":"string"},"endpoint":{"type":"string"}}}]}}}}}}},"/v1/purchase-keys/{id}":{"delete":{"description":"Revoke a purchase key at once and for good; reports under it answer 401 purchase_key_revoked. Rotate by creating a new key first. 409 managed_key: a key AirHost manages for a Worker cannot be revoked; it ends when the Worker is deleted.","parameters":[{"schema":{"pattern":"^apk_[A-Za-z0-9_-]{22}$","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/tenants/{tenant}/purchase-keys":{"get":{"description":"List the environment's purchase keys, revoked ones included. Secrets are never returned. The keys AirHost binds to Workers are not listed: they are managed by the platform.","parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"type":"string"},"keys":{"type":"array","items":{"type":"object","required":["id","name","environment","createdAt","lastUsedAt","revokedAt"],"properties":{"id":{"description":"The public key id (apk_…) reports carry as keyId.","type":"string"},"name":{"type":"string"},"environment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}},"post":{"description":"Create a named purchase key. Its secret is in this response only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":100,"type":"string"}}}}}},"parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["id","name","environment","createdAt","lastUsedAt","revokedAt"],"properties":{"id":{"description":"The public key id (apk_…) reports carry as keyId.","type":"string"},"name":{"type":"string"},"environment":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"object","required":["secret","endpoint"],"properties":{"secret":{"description":"apsk_…: returned only here, never again. Keep it on the server.","type":"string"},"endpoint":{"type":"string"}}}]}}}}}}},"/v1/tenants/{tenant}/purchase-keys/{id}":{"delete":{"description":"Revoke a purchase key at once and for good; reports under it answer 401 purchase_key_revoked. Rotate by creating a new key first. 409 managed_key: a key AirHost manages for a Worker cannot be revoked; it ends when the Worker is deleted.","parameters":[{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true},{"schema":{"pattern":"^apk_[A-Za-z0-9_-]{22}$","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/ingest/purchases":{"post":{"description":"Record an Apple-signed StoreKit 2 transaction. Duplicate transaction IDs return 200 without another event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["signedTransaction"],"properties":{"signedTransaction":{"minLength":1,"maxLength":65536,"type":"string"},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"}}}}}},"security":[{"appKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["recorded"]},{"type":"string","enum":["already_recorded"]}]}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["recorded"]},{"type":"string","enum":["already_recorded"]}]}}}}}}}}},"/v1/purchases":{"get":{"description":"List purchases newest first (by when they reached the platform); the optional filters combine. storeEnvironment identifies Apple's environment, independently of the resource environment. from and to bound the counted date (Apple's purchaseDate, else the report time); the cursor still pages by report time. total counts every purchase the filters match, whatever the cursor.","parameters":[{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]}]},"in":"query","name":"storeEnvironment","required":false,"description":"sandbox: Apple's sandbox only. production: everything else, an unknown environment included, as the summary counts it."},{"schema":{"anyOf":[{"type":"string","enum":["completed"]},{"type":"string","enum":["refunded"]}]},"in":"query","name":"status","required":false,"description":"refunded: revoked later (revocationDate is set). completed: not."},{"schema":{"anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"in":"query","name":"origin","required":false},{"schema":{"minLength":1,"maxLength":1024,"type":"string"},"in":"query","name":"productId","required":false,"description":"Exactly this product."},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"distinctId","required":false,"description":"Only purchases linked to this AirTraffic distinctId."},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"from","required":false,"description":"Counted at or after this moment: Apple's purchaseDate, else when the record reached the platform (the summary's date)."},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"to","required":false,"description":"Counted before this moment and recorded no later than it: the records a snapshot taken at `to` could see."}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore","total"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"description":"Every purchase the filters match; the same on every page.","type":"integer"}}}}}}}}},"/v1/purchases/summary":{"get":{"description":"The dashboard's numbers over every purchase in scope; days count production purchases that were not refunded.","parameters":[{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revenue","purchases","refunds","sandbox","products","days"],"properties":{"revenue":{"description":"Last 30 × 24 hours, production, not refunded, priced: one entry per currency, most sales first.","type":"array","items":{"type":"object","required":["currency","amountMilliunits","count"],"properties":{"currency":{"type":"string"},"amountMilliunits":{"type":"integer"},"count":{"type":"integer"}}}},"purchases":{"description":"Last 30 × 24 hours, production, not refunded.","type":"integer"},"refunds":{"description":"All time.","type":"integer"},"sandbox":{"description":"All time.","type":"integer"},"products":{"description":"Every productId with a record in scope, sandbox and refunded ones included: most records first, at most 50. What the list's productId filter can be asked for.","type":"array","items":{"type":"string"}},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"format":"date","type":"string"},"count":{"type":"integer"}}}}}}}}}}}},"/v1/purchases/{id}/journey":{"get":{"description":"Read the buyer's pre- and post-purchase AirTraffic behavior timeline centered on this purchase, plus decision summary metrics. Returns linked: false when the purchase has no distinctId.","parameters":[{"schema":{"minimum":2,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false,"description":"Total events across before + after; default 60."},{"schema":{"minimum":0.1,"maximum":720,"type":"number"},"in":"query","name":"beforeHours","required":false,"description":"Optional lookback hours before purchase (default: AirTraffic 30-day window)."},{"schema":{"minimum":0.1,"maximum":720,"type":"number"},"in":"query","name":"afterHours","required":false,"description":"Optional lookahead hours after purchase (default: AirTraffic 30-day window)."},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["purchase","linked","person","summary","before","at","after","next","previous"],"properties":{"purchase":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}},"linked":{"description":"Whether this purchase carries a distinctId linked to AirTraffic.","type":"boolean"},"person":{"anyOf":[{"type":"object","required":["personId","distinctIds","events","firstSeen","lastSeen","properties"],"properties":{"personId":{"type":"string"},"distinctIds":{"type":"array","items":{"type":"string"}},"events":{"type":"integer"},"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"properties":{"type":"object","additionalProperties":{"type":"string"}}}},{"type":"null"}]},"summary":{"anyOf":[{"type":"object","required":["firstSeen","timeToConvertSeconds","totalPersonEvents","paywallsBefore","purchaseAttemptsBefore","cancellationsBefore","failuresBefore","lastTrigger"],"properties":{"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"timeToConvertSeconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalPersonEvents":{"type":"integer"},"paywallsBefore":{"type":"integer"},"purchaseAttemptsBefore":{"type":"integer"},"cancellationsBefore":{"type":"integer"},"failuresBefore":{"type":"integer"},"lastTrigger":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"entrySource":{"type":"string"},"limit":{"type":"string"},"checkoutId":{"type":"string"},"event":{"type":"string"}}},{"type":"null"}]}}},{"type":"null"}]},"before":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"at":{"anyOf":[{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"after":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]},"previous":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/purchases/{id}":{"get":{"description":"Read a verified purchase.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}}}}}}},"delete":{"description":"Delete a purchase record; this does not refund an App Store transaction.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/purchases":{"get":{"description":"List purchases newest first (by when they reached the platform); the optional filters combine. storeEnvironment identifies Apple's environment, independently of the resource environment. from and to bound the counted date (Apple's purchaseDate, else the report time); the cursor still pages by report time. total counts every purchase the filters match, whatever the cursor.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]}]},"in":"query","name":"storeEnvironment","required":false,"description":"sandbox: Apple's sandbox only. production: everything else, an unknown environment included, as the summary counts it."},{"schema":{"anyOf":[{"type":"string","enum":["completed"]},{"type":"string","enum":["refunded"]}]},"in":"query","name":"status","required":false,"description":"refunded: revoked later (revocationDate is set). completed: not."},{"schema":{"anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"in":"query","name":"origin","required":false},{"schema":{"minLength":1,"maxLength":1024,"type":"string"},"in":"query","name":"productId","required":false,"description":"Exactly this product."},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"distinctId","required":false,"description":"Only purchases linked to this AirTraffic distinctId."},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"from","required":false,"description":"Counted at or after this moment: Apple's purchaseDate, else when the record reached the platform (the summary's date)."},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"to","required":false,"description":"Counted before this moment and recorded no later than it: the records a snapshot taken at `to` could see."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore","total"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"description":"Every purchase the filters match; the same on every page.","type":"integer"}}}}}}}}},"/v1/admin/purchases/mrr":{"get":{"description":"Estimated MRR and ARR from the auto-renewable subscriptions in scope: production only (not Apple's sandbox), a refund anywhere takes a subscription out, the period comes from the gap between the last two paid charges (else the product id, else a month), and a subscription counts while its latest charge plus the period and min(period, 30 days) of grace has not passed. Per currency, in milliunits, never converted.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["lines","active","assumedMonthly","notCounted"],"properties":{"lines":{"description":"One line per currency, largest MRR first, then by code; amounts are never converted.","type":"array","items":{"type":"object","required":["code","mrrMilliunits","arrMilliunits","count"],"properties":{"code":{"description":"ISO 4217, upper case.","type":"string"},"mrrMilliunits":{"type":"integer"},"arrMilliunits":{"description":"MRR × 12.","type":"integer"},"count":{"description":"Active subscriptions in this currency.","type":"integer"}}}},"active":{"description":"Subscriptions estimated active.","type":"integer"},"assumedMonthly":{"description":"Active ones with no usable gap between charges and no period in the product id: taken as monthly.","type":"integer"},"notCounted":{"description":"Subscriptions charged in the last 395 days whose latest charge has no price or no currency.","type":"integer"}}}}}}}}},"/v1/admin/purchases/summary":{"get":{"description":"The dashboard's numbers over every purchase in scope; days count production purchases that were not refunded.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revenue","purchases","refunds","sandbox","products","days"],"properties":{"revenue":{"description":"Last 30 × 24 hours, production, not refunded, priced: one entry per currency, most sales first.","type":"array","items":{"type":"object","required":["currency","amountMilliunits","count"],"properties":{"currency":{"type":"string"},"amountMilliunits":{"type":"integer"},"count":{"type":"integer"}}}},"purchases":{"description":"Last 30 × 24 hours, production, not refunded.","type":"integer"},"refunds":{"description":"All time.","type":"integer"},"sandbox":{"description":"All time.","type":"integer"},"products":{"description":"Every productId with a record in scope, sandbox and refunded ones included: most records first, at most 50. What the list's productId filter can be asked for.","type":"array","items":{"type":"string"}},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"format":"date","type":"string"},"count":{"type":"integer"}}}}}}}}}}}},"/v1/admin/purchases/{id}/journey":{"get":{"description":"Read the buyer's pre- and post-purchase AirTraffic behavior timeline centered on this purchase, plus decision summary metrics. Returns linked: false when the purchase has no distinctId.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"minimum":2,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false,"description":"Total events across before + after; default 60."},{"schema":{"minimum":0.1,"maximum":720,"type":"number"},"in":"query","name":"beforeHours","required":false,"description":"Optional lookback hours before purchase (default: AirTraffic 30-day window)."},{"schema":{"minimum":0.1,"maximum":720,"type":"number"},"in":"query","name":"afterHours","required":false,"description":"Optional lookahead hours after purchase (default: AirTraffic 30-day window)."},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["purchase","linked","person","summary","before","at","after","next","previous"],"properties":{"purchase":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}},"linked":{"description":"Whether this purchase carries a distinctId linked to AirTraffic.","type":"boolean"},"person":{"anyOf":[{"type":"object","required":["personId","distinctIds","events","firstSeen","lastSeen","properties"],"properties":{"personId":{"type":"string"},"distinctIds":{"type":"array","items":{"type":"string"}},"events":{"type":"integer"},"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"properties":{"type":"object","additionalProperties":{"type":"string"}}}},{"type":"null"}]},"summary":{"anyOf":[{"type":"object","required":["firstSeen","timeToConvertSeconds","totalPersonEvents","paywallsBefore","purchaseAttemptsBefore","cancellationsBefore","failuresBefore","lastTrigger"],"properties":{"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"timeToConvertSeconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"totalPersonEvents":{"type":"integer"},"paywallsBefore":{"type":"integer"},"purchaseAttemptsBefore":{"type":"integer"},"cancellationsBefore":{"type":"integer"},"failuresBefore":{"type":"integer"},"lastTrigger":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"entrySource":{"type":"string"},"limit":{"type":"string"},"checkoutId":{"type":"string"},"event":{"type":"string"}}},{"type":"null"}]}}},{"type":"null"}]},"before":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"at":{"anyOf":[{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"after":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]},"previous":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/purchases/{id}":{"get":{"description":"Read a verified purchase.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","tenant","environment","transactionId","origin","originalTransactionId","productId","storeEnvironment","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"tenant":{"format":"uuid","type":"string"},"environment":{"type":"string"},"transactionId":{"type":"string"},"origin":{"description":"app_store: an Apple-signed StoreKit transaction. server: reported by the app's own server with a purchase key (POST /v1/ingest/purchase-reports). For telling records apart, not a label to show.","anyOf":[{"type":"string","enum":["app_store"]},{"type":"string","enum":["server"]}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Optional opaque AirTraffic distinct_id (device or account id, never PII) to link this purchase with pre/post behavior.","type":"string"},"source":{"description":"A server report's payment source, verbatim as the server sent it (e.g. 微信支付); show it as is. Absent on App Store records.","type":"string"},"isRenewal":{"description":"True for an automatic subscription renewal, false for an initial purchase or upgrade.","type":"boolean"},"attribution":{"additionalProperties":false,"type":"object","properties":{"source":{"minLength":1,"maxLength":128,"description":"Where the purchase started (e.g. paywall, usage, invite_gate, chat_card).","type":"string"},"entrySource":{"minLength":1,"maxLength":128,"description":"How the user reached the purchase surface (e.g. settings, usage_warning, chat_prompt).","type":"string"},"limit":{"minLength":1,"maxLength":128,"description":"Which quota limit triggered the paywall (e.g. ai, cloud, workspaces).","type":"string"},"checkoutId":{"minLength":1,"maxLength":128,"description":"Client-generated attempt id linking purchase_started to this verified purchase.","type":"string"},"platform":{"minLength":1,"maxLength":128,"description":"Client platform that initiated the purchase (e.g. ios, macos, web).","type":"string"},"releaseLabel":{"minLength":1,"maxLength":128,"description":"Build channel or release label (e.g. beta, production).","type":"string"}}},"originalTransactionId":{"description":"Apple's original transaction ID; a server report's own transaction ID.","type":"string"},"productId":{"type":"string"},"type":{"type":"string"},"quantity":{"type":"integer"},"priceMilliunits":{"type":"integer"},"currency":{"type":"string"},"storefront":{"type":"string"},"storeEnvironment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"transactionReason":{"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"type":"integer"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"createdAt":{"format":"date-time","type":"string"}}}}}}}},"delete":{"description":"Delete a purchase record; this does not refund an App Store transaction.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/tenants/{tenant}/feedback/submit":{"post":{"description":"Submit live feedback from a trusted integration using a durable record ID. Exactly one outbox event is enqueued; retries reconcile full content. Metadata is tenant-readable, so private admission/moderation identities must remain with the integration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["id","environment","createdAt"],"properties":{"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"message":{"description":"At most 4000 grapheme clusters after trimming.","type":"string"},"images":{"maxItems":4,"type":"array","items":{"type":"object","required":["mediaType","data"],"properties":{"mediaType":{"anyOf":[{"type":"string","enum":["image/jpeg"]},{"type":"string","enum":["image/png"]},{"type":"string","enum":["image/heic"]},{"type":"string","enum":["image/webp"]}]},"data":{"maxLength":11184812,"type":"string"}}}},"id":{"format":"uuid","type":"string"},"environment":{"minLength":1,"maxLength":63,"type":"string"},"createdAt":{"format":"date-time","type":"string"},"metadata":{"type":"object","additionalProperties":{}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["created"]},{"type":"string","enum":["already_created"]}]}}}}}}}}},"/v1/admin/tenants/{tenant}/feedback/import":{"post":{"description":"Import one historical feedback record and images without generating an event. Existing IDs are not overwritten.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["id","environment","createdAt"],"properties":{"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"message":{"description":"At most 4000 grapheme clusters after trimming.","type":"string"},"images":{"maxItems":4,"type":"array","items":{"type":"object","required":["mediaType","data"],"properties":{"mediaType":{"anyOf":[{"type":"string","enum":["image/jpeg"]},{"type":"string","enum":["image/png"]},{"type":"string","enum":["image/heic"]},{"type":"string","enum":["image/webp"]}]},"data":{"maxLength":11184812,"type":"string"}}}},"id":{"format":"uuid","type":"string"},"environment":{"minLength":1,"maxLength":63,"type":"string"},"createdAt":{"format":"date-time","type":"string"},"metadata":{"type":"object","additionalProperties":{}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["imported"]},{"type":"string","enum":["already_imported"]}]}}}}}}}}},"/v1/admin/tenants/{tenant}/purchases/import":{"post":{"description":"Import a previously verified purchase from a trusted source without generating an event. Conflicting IDs fail closed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["id","environment","createdAt","transactionId","details"],"properties":{"id":{"format":"uuid","type":"string"},"environment":{"minLength":1,"maxLength":63,"type":"string"},"createdAt":{"format":"date-time","type":"string"},"appVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"appBuild":{"description":"At most 255 grapheme clusters.","type":"string"},"deviceModel":{"description":"At most 255 grapheme clusters.","type":"string"},"osVersion":{"description":"At most 255 grapheme clusters.","type":"string"},"locale":{"description":"At most 255 grapheme clusters.","type":"string"},"transactionId":{"minLength":1,"maxLength":1024,"type":"string"},"details":{"additionalProperties":false,"type":"object","required":["originalTransactionId","productId","environment"],"properties":{"originalTransactionId":{"minLength":1,"maxLength":1024,"type":"string"},"productId":{"minLength":1,"maxLength":1024,"type":"string"},"environment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["sandbox"]},{"type":"string","enum":["unknown"]}]},"type":{"minLength":1,"maxLength":1024,"type":"string"},"quantity":{"minimum":0,"maximum":9007199254740991,"type":"integer"},"priceMilliunits":{"minimum":0,"maximum":9007199254740991,"type":"integer"},"currency":{"minLength":1,"maxLength":1024,"type":"string"},"storefront":{"minLength":1,"maxLength":1024,"type":"string"},"transactionReason":{"minLength":1,"maxLength":1024,"type":"string"},"purchaseDate":{"format":"date-time","type":"string"},"revocationDate":{"format":"date-time","type":"string"},"revocationReason":{"minimum":0,"maximum":9007199254740991,"type":"integer"}}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"anyOf":[{"type":"string","enum":["imported"]},{"type":"string","enum":["already_imported"]}]}}}}}}}}},"/v1/traffic/query":{"post":{"description":"Run one query: trends, funnel, retention, web (traffic overview), events (the raw stream, paged both ways or centred on a moment), person (who a distinct id is), definitions (event names and property keys) or sql. See docs/airtraffic.md for each shape.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["kind","series"],"properties":{"kind":{"type":"string","enum":["trends"]},"series":{"minItems":1,"maxItems":10,"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"math":{"description":"Default total: total events, dau = unique people (or groups, with groupType) per bucket, weekly/monthly_active (daily interval), unique_session, unique_group (needs groupType), or an aggregate of `property`.","anyOf":[{"type":"string","enum":["total"]},{"type":"string","enum":["dau"]},{"type":"string","enum":["weekly_active"]},{"type":"string","enum":["monthly_active"]},{"type":"string","enum":["unique_session"]},{"type":"string","enum":["unique_group"]},{"type":"string","enum":["sum"]},{"type":"string","enum":["avg"]},{"type":"string","enum":["min"]},{"type":"string","enum":["max"]},{"type":"string","enum":["median"]},{"type":"string","enum":["p90"]},{"type":"string","enum":["p95"]},{"type":"string","enum":["p99"]}]},"property":{"minLength":1,"maxLength":200,"description":"Numeric event property for sum/avg/min/max/median/p90/p95/p99.","type":"string"},"groupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person for this series.","type":"boolean"},"name":{"maxLength":200,"type":"string"}}}},"interval":{"description":"Default day.","anyOf":[{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["week"]},{"type":"string","enum":["month"]}]},"breakdown":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"type":"string"},"type":{"anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"limit":{"minimum":1,"maximum":50,"description":"Default 10.","type":"integer"}}},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","steps"],"properties":{"kind":{"type":"string","enum":["funnel"]},"steps":{"minItems":2,"maxItems":10,"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"name":{"maxLength":200,"type":"string"}}}},"windowSeconds":{"minimum":1,"maximum":7776000,"description":"Default 1209600 (14 days).","type":"integer"},"order":{"description":"Default ordered.","anyOf":[{"type":"string","enum":["ordered"]},{"type":"string","enum":["strict"]}]},"breakdown":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"type":"string"},"type":{"anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"limit":{"minimum":1,"maximum":50,"description":"Default 10.","type":"integer"}}},"aggregationGroupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","startEvent","returnEvent"],"properties":{"kind":{"type":"string","enum":["retention"]},"startEvent":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}}}},"returnEvent":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}}}},"period":{"description":"Default day.","anyOf":[{"type":"string","enum":["day"]},{"type":"string","enum":["week"]},{"type":"string","enum":["month"]}]},"periods":{"minimum":1,"maximum":60,"type":"integer"},"retentionType":{"description":"Default first_time.","anyOf":[{"type":"string","enum":["first_time"]},{"type":"string","enum":["recurring"]}]},"aggregationGroupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["web"]},"limit":{"minimum":1,"maximum":100,"description":"Default 10.","type":"integer"},"breakdowns":{"description":"Include top pages, referrers, countries, devices, browsers and os. Default true.","type":"boolean"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["events"]},"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Only this person's events, under any linked distinct id.","type":"string"},"limit":{"minimum":1,"maximum":200,"description":"Default 50.","type":"integer"},"before":{"minLength":1,"maxLength":200,"description":"Older than this cursor: an answer's `next`.","type":"string"},"after":{"minLength":1,"maxLength":200,"description":"Newer than this cursor: an answer's `previous`.","type":"string"},"around":{"additionalProperties":false,"description":"Half the page before a moment and half from it on. Give at most one of before, after and around.","type":"object","required":["timestamp"],"properties":{"timestamp":{"minLength":1,"maxLength":40,"description":"ISO 8601: the moment the page is centred on.","type":"string"},"uuid":{"minLength":36,"maxLength":36,"description":"The event at that moment, when the centre is one event.","type":"string"}}},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"additionalProperties":false,"type":"object","required":["kind","distinctId"],"properties":{"kind":{"type":"string","enum":["person"]},"distinctId":{"minLength":1,"maxLength":200,"description":"Any distinct id of the person.","type":"string"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["definitions"]},"includeProperties":{"description":"Include sampled event and person property keys. Default true.","type":"boolean"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","query"],"properties":{"kind":{"type":"string","enum":["sql"]},"query":{"minLength":1,"maxLength":20000,"description":"One ClickHouse SELECT over events, person_distinct_ids and person_properties, already limited to this environment.","type":"string"}}}]}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["kind","interval","timezone","labels","series"],"properties":{"kind":{"type":"string","enum":["trends"]},"interval":{"type":"string"},"timezone":{"type":"string"},"labels":{"type":"array","items":{"description":"Bucket start, YYYY-MM-DDTHH:MM:SS in the query's timezone.","type":"string"}},"series":{"type":"array","items":{"type":"object","required":["index","name","event","math","data"],"properties":{"index":{"type":"integer"},"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"math":{"type":"string"},"breakdownValue":{"type":"string"},"data":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},{"type":"object","required":["kind","timezone","windowSeconds"],"properties":{"kind":{"type":"string","enum":["funnel"]},"timezone":{"type":"string"},"windowSeconds":{"type":"integer"},"steps":{"type":"array","items":{"type":"object","required":["name","event","count","conversionRate","stepConversionRate"],"properties":{"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"},"conversionRate":{"type":"number"},"stepConversionRate":{"type":"number"}}}},"breakdown":{"type":"array","items":{"type":"object","required":["value","steps"],"properties":{"value":{"type":"string"},"steps":{"type":"array","items":{"type":"object","required":["name","event","count","conversionRate","stepConversionRate"],"properties":{"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"},"conversionRate":{"type":"number"},"stepConversionRate":{"type":"number"}}}}}}}}},{"type":"object","required":["kind","period","timezone","retentionType","cohorts"],"properties":{"kind":{"type":"string","enum":["retention"]},"period":{"type":"string"},"timezone":{"type":"string"},"retentionType":{"type":"string"},"cohorts":{"type":"array","items":{"type":"object","required":["date","size","values"],"properties":{"date":{"type":"string"},"size":{"type":"integer"},"values":{"type":"array","items":{"type":"integer"}}}}}}},{"type":"object","required":["kind","timezone","dateFrom","dateTo","visitors","views","sessions","avgSessionSeconds","bounceRate","pages","referrers","countries","devices","browsers","os"],"properties":{"kind":{"type":"string","enum":["web"]},"timezone":{"type":"string"},"dateFrom":{"format":"date-time","type":"string"},"dateTo":{"format":"date-time","type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"},"sessions":{"type":"integer"},"avgSessionSeconds":{"type":"number"},"bounceRate":{"type":"number"},"pages":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"referrers":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"countries":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"browsers":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"os":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}}}},{"type":"object","required":["kind","results","next","previous"],"properties":{"kind":{"type":"string","enum":["events"]},"results":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"next":{"anyOf":[{"description":"Pass as `before` for older events; null at the oldest in the stretch read.","type":"string"},{"type":"null"}]},"previous":{"anyOf":[{"description":"Pass as `after` for newer events; null at the newest in the stretch read.","type":"string"},{"type":"null"}]}}},{"type":"object","required":["kind","personId","distinctIds","events","firstSeen","lastSeen","properties"],"properties":{"kind":{"type":"string","enum":["person"]},"personId":{"type":"string"},"distinctIds":{"description":"The person's own id, then the ids linked to it (at most 50).","type":"array","items":{"type":"string"}},"events":{"description":"Over everything kept.","type":"integer"},"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"properties":{"type":"object","additionalProperties":{"type":"string"}}}},{"type":"object","required":["kind","events","eventProperties","personProperties"],"properties":{"kind":{"type":"string","enum":["definitions"]},"events":{"type":"array","items":{"type":"object","required":["name","count","people","lastSeen"],"properties":{"name":{"type":"string"},"count":{"type":"integer"},"people":{"type":"integer"},"lastSeen":{"format":"date-time","type":"string"}}}},"eventProperties":{"type":"array","items":{"type":"object","required":["key","events"],"properties":{"key":{"type":"string"},"events":{"type":"integer"}}}},"personProperties":{"type":"array","items":{"type":"object","required":["key","people"],"properties":{"key":{"type":"string"},"people":{"type":"integer"}}}}}},{"type":"object","required":["kind","columns","rows"],"properties":{"kind":{"type":"string","enum":["sql"]},"columns":{"type":"array","items":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string"}}}},"rows":{"type":"array","items":{"type":"array","items":{}}},"statistics":{"type":"object","required":["elapsedSeconds","rowsRead"],"properties":{"elapsedSeconds":{"type":"number"},"rowsRead":{"type":"number"}}}}}]}}}}}}},"/v1/traffic/settings":{"get":{"description":"The environment's AirTraffic settings. updatedAt is null until someone chose.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"put":{"description":"Set whether SDK identity calls are kept (identified) or dropped (anonymous). Takes effect within 30 seconds on every instance; stored events are not rewritten.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identity"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"patch":{"description":"Change some settings; the others keep their value. Takes effect within 30 seconds on every instance; stored events are not rewritten.","requestBody":{"required":true,"content":{"application/json":{"schema":{"minProperties":1,"type":"object","properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/traffic/data":{"delete":{"description":"Reset: every event and person record received so far. Reads hide them at once (202); ClickHouse deletes them in the background. Events received afterwards stay.","security":[{"tenantToken":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["pending"]}}}}}}}}},"/v1/traffic/persons/{distinctId}":{"delete":{"description":"Delete a person synchronously: the person this distinct id resolves to, every distinct id linked to them, their events and their properties.","parameters":[{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"path","name":"distinctId","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["personId","deleted"],"properties":{"personId":{"type":"string"},"deleted":{"type":"integer"}}}}}}}}},"/v1/traffic/groups/{type}/{key}":{"delete":{"description":"Delete a group's events synchronously: every event whose $groups[type] is key.","parameters":[{"schema":{"minLength":1,"maxLength":64,"type":"string"},"in":"path","name":"type","required":true},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"path","name":"key","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"integer"}}}}}}}}},"/v1/admin/traffic/query":{"post":{"description":"Run one query: trends, funnel, retention, web (traffic overview), events (the raw stream, paged both ways or centred on a moment), person (who a distinct id is), definitions (event names and property keys) or sql. See docs/airtraffic.md for each shape.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["kind","series"],"properties":{"kind":{"type":"string","enum":["trends"]},"series":{"minItems":1,"maxItems":10,"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"math":{"description":"Default total: total events, dau = unique people (or groups, with groupType) per bucket, weekly/monthly_active (daily interval), unique_session, unique_group (needs groupType), or an aggregate of `property`.","anyOf":[{"type":"string","enum":["total"]},{"type":"string","enum":["dau"]},{"type":"string","enum":["weekly_active"]},{"type":"string","enum":["monthly_active"]},{"type":"string","enum":["unique_session"]},{"type":"string","enum":["unique_group"]},{"type":"string","enum":["sum"]},{"type":"string","enum":["avg"]},{"type":"string","enum":["min"]},{"type":"string","enum":["max"]},{"type":"string","enum":["median"]},{"type":"string","enum":["p90"]},{"type":"string","enum":["p95"]},{"type":"string","enum":["p99"]}]},"property":{"minLength":1,"maxLength":200,"description":"Numeric event property for sum/avg/min/max/median/p90/p95/p99.","type":"string"},"groupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person for this series.","type":"boolean"},"name":{"maxLength":200,"type":"string"}}}},"interval":{"description":"Default day.","anyOf":[{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["week"]},{"type":"string","enum":["month"]}]},"breakdown":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"type":"string"},"type":{"anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"limit":{"minimum":1,"maximum":50,"description":"Default 10.","type":"integer"}}},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","steps"],"properties":{"kind":{"type":"string","enum":["funnel"]},"steps":{"minItems":2,"maxItems":10,"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"name":{"maxLength":200,"type":"string"}}}},"windowSeconds":{"minimum":1,"maximum":7776000,"description":"Default 1209600 (14 days).","type":"integer"},"order":{"description":"Default ordered.","anyOf":[{"type":"string","enum":["ordered"]},{"type":"string","enum":["strict"]}]},"breakdown":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"type":"string"},"type":{"anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"limit":{"minimum":1,"maximum":50,"description":"Default 10.","type":"integer"}}},"aggregationGroupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","startEvent","returnEvent"],"properties":{"kind":{"type":"string","enum":["retention"]},"startEvent":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}}}},"returnEvent":{"additionalProperties":false,"type":"object","properties":{"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}}}},"period":{"description":"Default day.","anyOf":[{"type":"string","enum":["day"]},{"type":"string","enum":["week"]},{"type":"string","enum":["month"]}]},"periods":{"minimum":1,"maximum":60,"type":"integer"},"retentionType":{"description":"Default first_time.","anyOf":[{"type":"string","enum":["first_time"]},{"type":"string","enum":["recurring"]}]},"aggregationGroupType":{"minLength":1,"maxLength":64,"description":"A `$groups` type, e.g. team: count groups instead of people.","type":"string"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["web"]},"limit":{"minimum":1,"maximum":100,"description":"Default 10.","type":"integer"},"breakdowns":{"description":"Include top pages, referrers, countries, devices, browsers and os. Default true.","type":"boolean"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["events"]},"event":{"description":"An event name; null or absent means every event.","anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"distinctId":{"minLength":1,"maxLength":200,"description":"Only this person's events, under any linked distinct id.","type":"string"},"limit":{"minimum":1,"maximum":200,"description":"Default 50.","type":"integer"},"before":{"minLength":1,"maxLength":200,"description":"Older than this cursor: an answer's `next`.","type":"string"},"after":{"minLength":1,"maxLength":200,"description":"Newer than this cursor: an answer's `previous`.","type":"string"},"around":{"additionalProperties":false,"description":"Half the page before a moment and half from it on. Give at most one of before, after and around.","type":"object","required":["timestamp"],"properties":{"timestamp":{"minLength":1,"maxLength":40,"description":"ISO 8601: the moment the page is centred on.","type":"string"},"uuid":{"minLength":36,"maxLength":36,"description":"The event at that moment, when the centre is one event.","type":"string"}}},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"additionalProperties":false,"type":"object","required":["kind","distinctId"],"properties":{"kind":{"type":"string","enum":["person"]},"distinctId":{"minLength":1,"maxLength":200,"description":"Any distinct id of the person.","type":"string"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["definitions"]},"includeProperties":{"description":"Include sampled event and person property keys. Default true.","type":"boolean"},"dateFrom":{"maxLength":40,"description":"-7d, -24h, -2w, -3m, -1y, today, or ISO 8601.","type":"string"},"dateTo":{"maxLength":40,"description":"Default now.","type":"string"},"timezone":{"maxLength":64,"description":"IANA zone for buckets; default UTC.","type":"string"},"filters":{"maxItems":20,"type":"array","items":{"additionalProperties":false,"type":"object","required":["property"],"properties":{"property":{"minLength":1,"maxLength":200,"description":"Event property key, e.g. $pathname or plan; or a person property with type person.","type":"string"},"type":{"description":"Default event.","anyOf":[{"type":"string","enum":["event"]},{"type":"string","enum":["person"]}]},"operator":{"description":"Default exact.","anyOf":[{"type":"string","enum":["exact"]},{"type":"string","enum":["is_not"]},{"type":"string","enum":["icontains"]},{"type":"string","enum":["not_icontains"]},{"type":"string","enum":["regex"]},{"type":"string","enum":["not_regex"]},{"type":"string","enum":["gt"]},{"type":"string","enum":["gte"]},{"type":"string","enum":["lt"]},{"type":"string","enum":["lte"]},{"type":"string","enum":["is_set"]},{"type":"string","enum":["is_not_set"]}]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"identifiedOnly":{"description":"Only include events belonging to an identified person (linked via $identify or reporting an account id distinct from $device_id). Default false.","type":"boolean"}}},{"type":"object","required":["kind","query"],"properties":{"kind":{"type":"string","enum":["sql"]},"query":{"minLength":1,"maxLength":20000,"description":"One ClickHouse SELECT over events, person_distinct_ids and person_properties, already limited to this environment.","type":"string"}}}]}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["kind","interval","timezone","labels","series"],"properties":{"kind":{"type":"string","enum":["trends"]},"interval":{"type":"string"},"timezone":{"type":"string"},"labels":{"type":"array","items":{"description":"Bucket start, YYYY-MM-DDTHH:MM:SS in the query's timezone.","type":"string"}},"series":{"type":"array","items":{"type":"object","required":["index","name","event","math","data"],"properties":{"index":{"type":"integer"},"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"math":{"type":"string"},"breakdownValue":{"type":"string"},"data":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},{"type":"object","required":["kind","timezone","windowSeconds"],"properties":{"kind":{"type":"string","enum":["funnel"]},"timezone":{"type":"string"},"windowSeconds":{"type":"integer"},"steps":{"type":"array","items":{"type":"object","required":["name","event","count","conversionRate","stepConversionRate"],"properties":{"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"},"conversionRate":{"type":"number"},"stepConversionRate":{"type":"number"}}}},"breakdown":{"type":"array","items":{"type":"object","required":["value","steps"],"properties":{"value":{"type":"string"},"steps":{"type":"array","items":{"type":"object","required":["name","event","count","conversionRate","stepConversionRate"],"properties":{"name":{"type":"string"},"event":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer"},"conversionRate":{"type":"number"},"stepConversionRate":{"type":"number"}}}}}}}}},{"type":"object","required":["kind","period","timezone","retentionType","cohorts"],"properties":{"kind":{"type":"string","enum":["retention"]},"period":{"type":"string"},"timezone":{"type":"string"},"retentionType":{"type":"string"},"cohorts":{"type":"array","items":{"type":"object","required":["date","size","values"],"properties":{"date":{"type":"string"},"size":{"type":"integer"},"values":{"type":"array","items":{"type":"integer"}}}}}}},{"type":"object","required":["kind","timezone","dateFrom","dateTo","visitors","views","sessions","avgSessionSeconds","bounceRate","pages","referrers","countries","devices","browsers","os"],"properties":{"kind":{"type":"string","enum":["web"]},"timezone":{"type":"string"},"dateFrom":{"format":"date-time","type":"string"},"dateTo":{"format":"date-time","type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"},"sessions":{"type":"integer"},"avgSessionSeconds":{"type":"number"},"bounceRate":{"type":"number"},"pages":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"referrers":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"countries":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"browsers":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}},"os":{"type":"array","items":{"type":"object","required":["value","visitors","views"],"properties":{"value":{"type":"string"},"visitors":{"type":"integer"},"views":{"type":"integer"}}}}}},{"type":"object","required":["kind","results","next","previous"],"properties":{"kind":{"type":"string","enum":["events"]},"results":{"type":"array","items":{"type":"object","required":["uuid","event","distinctId","personId","timestamp","sessionId","source","groups","properties"],"properties":{"uuid":{"type":"string"},"event":{"type":"string"},"distinctId":{"type":"string"},"personId":{"type":"string"},"timestamp":{"format":"date-time","type":"string"},"sessionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"groups":{"type":"object","additionalProperties":{"type":"string"}},"properties":{"type":"object","additionalProperties":{}}}}},"next":{"anyOf":[{"description":"Pass as `before` for older events; null at the oldest in the stretch read.","type":"string"},{"type":"null"}]},"previous":{"anyOf":[{"description":"Pass as `after` for newer events; null at the newest in the stretch read.","type":"string"},{"type":"null"}]}}},{"type":"object","required":["kind","personId","distinctIds","events","firstSeen","lastSeen","properties"],"properties":{"kind":{"type":"string","enum":["person"]},"personId":{"type":"string"},"distinctIds":{"description":"The person's own id, then the ids linked to it (at most 50).","type":"array","items":{"type":"string"}},"events":{"description":"Over everything kept.","type":"integer"},"firstSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastSeen":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"properties":{"type":"object","additionalProperties":{"type":"string"}}}},{"type":"object","required":["kind","events","eventProperties","personProperties"],"properties":{"kind":{"type":"string","enum":["definitions"]},"events":{"type":"array","items":{"type":"object","required":["name","count","people","lastSeen"],"properties":{"name":{"type":"string"},"count":{"type":"integer"},"people":{"type":"integer"},"lastSeen":{"format":"date-time","type":"string"}}}},"eventProperties":{"type":"array","items":{"type":"object","required":["key","events"],"properties":{"key":{"type":"string"},"events":{"type":"integer"}}}},"personProperties":{"type":"array","items":{"type":"object","required":["key","people"],"properties":{"key":{"type":"string"},"people":{"type":"integer"}}}}}},{"type":"object","required":["kind","columns","rows"],"properties":{"kind":{"type":"string","enum":["sql"]},"columns":{"type":"array","items":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string"}}}},"rows":{"type":"array","items":{"type":"array","items":{}}},"statistics":{"type":"object","required":["elapsedSeconds","rowsRead"],"properties":{"elapsedSeconds":{"type":"number"},"rowsRead":{"type":"number"}}}}}]}}}}}}},"/v1/admin/traffic/settings":{"get":{"description":"The environment's AirTraffic settings. updatedAt is null until someone chose.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"put":{"description":"Set whether SDK identity calls are kept (identified) or dropped (anonymous). Takes effect within 30 seconds on every instance; stored events are not rewritten.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identity"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"patch":{"description":"Change some settings; the others keep their value. Takes effect within 30 seconds on every instance; stored events are not rewritten.","requestBody":{"required":true,"content":{"application/json":{"schema":{"minProperties":1,"type":"object","properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["identity","updatedAt"],"properties":{"identity":{"description":"anonymous drops SDK identity calls; identified links distinct ids to people and keeps person properties.","anyOf":[{"type":"string","enum":["anonymous"]},{"type":"string","enum":["identified"]}]},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/traffic/data":{"delete":{"description":"Reset: every event and person record received so far. Reads hide them at once (202); ClickHouse deletes them in the background. Events received afterwards stay.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["pending"]}}}}}}}}},"/v1/admin/traffic/persons/{distinctId}":{"delete":{"description":"Delete a person synchronously: the person this distinct id resolves to, every distinct id linked to them, their events and their properties.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"path","name":"distinctId","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["personId","deleted"],"properties":{"personId":{"type":"string"},"deleted":{"type":"integer"}}}}}}}}},"/v1/admin/traffic/groups/{type}/{key}":{"delete":{"description":"Delete a group's events synchronously: every event whose $groups[type] is key.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"minLength":1,"maxLength":64,"type":"string"},"in":"path","name":"type","required":true},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"path","name":"key","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"integer"}}}}}}}}},"/v1/ingest/crashes":{"post":{"description":"Submit one crash report using a public App Key, in the one crash format every platform shares (platform picks the symbolication module; default apple). Optional device proof as on feedback ingest (X-Attest-Key-Id, X-Attest-Assertion over SHA-256 of the exact body): stored either way with verified true or false, X-Attest-Status answers verified, unverified or unknown-key. 201 stored, and filed as a feedback entry (category crash) that notifies like feedback; 200 this id was already stored, nothing is written or sent again; 202 {accepted:false} while the app's crash reports are off (nothing stored). 429 rate_limited with Retry-After: send again later. This credential grants no read access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","occurredAt","installID","threads"],"properties":{"id":{"format":"uuid","description":"Made by the device; a repeat id answers 200 with the same id.","type":"string"},"occurredAt":{"format":"date-time","description":"The MetricKit payload's timeStampEnd; clamped to now.","type":"string"},"installID":{"format":"uuid","description":"Random per install; only counts affected installs.","type":"string"},"platform":{"description":"Which symbolication module reads the report (default apple). One wire for every platform; a platform whose module is not implemented yet is refused with 422 platform_unsupported.","anyOf":[{"type":"string","enum":["apple"]},{"type":"string","enum":["android"]},{"type":"string","enum":["web"]},{"type":"string","enum":["react-native"]},{"type":"string","enum":["flutter"]}]},"app":{"type":"object","properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"build":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleID":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"device":{"type":"object","properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"os":{"anyOf":[{"type":"string"},{"type":"null"}]},"osVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"osBuild":{"anyOf":[{"type":"string"},{"type":"null"}]},"arch":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"exception":{"type":"object","properties":{"type":{"anyOf":[{"type":"integer"},{"type":"null"}]},"code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"signal":{"anyOf":[{"type":"integer"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"description":"Kept up to 1024 characters.","type":"string"},{"type":"null"}]},"terminationReason":{"anyOf":[{"description":"Kept up to 512 characters.","type":"string"},{"type":"null"}]}}},"threads":{"minItems":1,"description":"Crashed thread first. Kept: 64 threads, 256 frames of the crashed one, 64 of others.","type":"array","items":{"type":"object","required":["frames"],"properties":{"crashed":{"type":"boolean"},"frames":{"type":"array","items":{"anyOf":[{"description":"A native frame: binary image + address (apple).","type":"object","required":["image","uuid","offset","inApp"],"properties":{"image":{"type":"string"},"uuid":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"offset":{"minimum":0,"description":"Into the image's text segment (MetricKit's offsetIntoBinaryTextSegment).","type":"integer"},"inApp":{"description":"The image is the app's own: symbolicated here from its symbol files.","type":"boolean"},"symbol":{"anyOf":[{"description":"A system frame's symbol, resolved on the device.","type":"string"},{"type":"null"}]},"symbolOffset":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]}}},{"description":"A source frame: function and file/line/column (JS, JVM, Dart), for the platforms that send them.","type":"object","required":["inApp"],"properties":{"function":{"anyOf":[{"type":"string"},{"type":"null"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"line":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"column":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"module":{"anyOf":[{"description":"The JVM class, JS bundle or Dart library the frame is in.","type":"string"},{"type":"null"}]},"inApp":{"type":"boolean"}}}]}}}}},"images":{"type":"array","items":{"type":"object","required":["name","uuid","inApp"],"properties":{"name":{"type":"string"},"uuid":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"inApp":{"type":"boolean"}}}}}}}}},"security":[{"appKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","accepted"],"properties":{"id":{"format":"uuid","type":"string"},"accepted":{"type":"boolean","enum":[true]}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","accepted"],"properties":{"id":{"format":"uuid","type":"string"},"accepted":{"type":"boolean","enum":[true]}}}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accepted"],"properties":{"accepted":{"type":"boolean","enum":[false]}}}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/feedback/crash-settings":{"get":{"description":"The app's crash reports switch. updatedAt is null until someone chose.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","updatedAt"],"properties":{"enabled":{"description":"Crash reports (default true). Off: ingest answers 202 {accepted:false} and stores nothing.","type":"boolean"},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"patch":{"description":"Turn crash reports on or off. Applies within 30 seconds on every instance; stored reports stay.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","updatedAt"],"properties":{"enabled":{"description":"Crash reports (default true). Off: ingest answers 202 {accepted:false} and stores nothing.","type":"boolean"},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/feedback/dsyms":{"post":{"description":"Start dSYM uploads: one per DWARF Mach-O file (X.dSYM/Contents/Resources/DWARF/X), by its LC_UUID. Answers a signed PUT URL (15 minutes) per UUID not stored yet — PUT the bytes there with exactly the given headers — and the UUIDs already stored. At most 1 GiB per file, and never more than the app's whole dSYM allowance (dsym_too_large).","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["files"],"properties":{"files":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["uuid","arch","name","size"],"properties":{"uuid":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"arch":{"pattern":"^[a-z0-9_]{1,16}$","type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"integer"}}}}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["uploads","present"],"properties":{"uploads":{"type":"array","items":{"type":"object","required":["uuid","url","method","headers"],"properties":{"uuid":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}},"present":{"type":"array","items":{"type":"string"}}}}}}}}},"get":{"description":"Stored dSYMs, newest first, and the app's dSYM storage: files (a fat file's aliases not counted again) and bytes against its limits. Completing an upload that goes over a limit evicts the oldest dSYMs.","parameters":[{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore","usage"],"properties":{"items":{"type":"array","items":{"type":"object","required":["uuid","name","arch","size","uploadedAt","aliasOf"],"properties":{"uuid":{"type":"string"},"name":{"type":"string"},"arch":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"},"aliasOf":{"description":"Another slice of a fat file stored under that UUID's object.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]},"usage":{"type":"object","required":["files","bytes","maxFiles","maxBytes"],"properties":{"files":{"type":"integer"},"bytes":{"type":"integer"},"maxFiles":{"type":"integer"},"maxBytes":{"type":"integer"}}}}}}}}}}},"/v1/feedback/symbols":{"post":{"description":"Start symbol file uploads of one kind. dsym: one per DWARF Mach-O file, id = its LC_UUID (as POST /dsyms). Answers a signed PUT URL (15 minutes) per file not stored yet, and the ids already stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["kind","files"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"files":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["id","name","size"],"properties":{"id":{"minLength":1,"maxLength":128,"description":"The file's identity: a dSYM's UUID.","type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"integer"},"arch":{"pattern":"^[a-z0-9_]{1,16}$","type":"string"}}}}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["kind","uploads","present"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"uploads":{"type":"array","items":{"type":"object","required":["id","url","method","headers"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}},"present":{"type":"array","items":{"type":"string"}}}}}}}}}},"/v1/feedback/symbols/complete":{"post":{"description":"Finish symbol file uploads of one kind (dsym: as POST /dsyms/complete); reports waiting for them are symbolicated again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["kind","ids"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"minLength":1,"maxLength":128,"type":"string"}}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["kind","completed","failed","evicted","requeued"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"completed":{"type":"array","items":{"type":"object","required":["id","name","size","uploadedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"}}}},"failed":{"type":"array","items":{"type":"object","required":["id","code","reason"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}}}},"evicted":{"type":"array","items":{"type":"string"}},"requeued":{"type":"integer"}}}}}}}}},"/v1/feedback/dsyms/complete":{"post":{"description":"Finish dSYM uploads: each object's Mach-O headers must carry its UUID; every slice's __TEXT vmaddr is recorded (other slices of a fat file as aliases), the oldest dSYMs are evicted while the app is over its file or byte limit, and reports waiting for these UUIDs are symbolicated again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["uuids"],"properties":{"uuids":{"minItems":1,"maxItems":100,"type":"array","items":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"}}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["completed","failed","evicted","requeued"],"properties":{"completed":{"type":"array","items":{"type":"object","required":["uuid","name","arch","size","uploadedAt","aliasOf"],"properties":{"uuid":{"type":"string"},"name":{"type":"string"},"arch":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"},"aliasOf":{"description":"Another slice of a fat file stored under that UUID's object.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"failed":{"type":"array","items":{"type":"object","required":["uuid","code","reason"],"properties":{"uuid":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}}}},"evicted":{"description":"UUIDs removed, oldest first, to keep the app within its dSYM limits (a fat file's aliases with it).","type":"array","items":{"type":"string"}},"requeued":{"description":"Reports sent back to symbolication.","type":"integer"}}}}}}}}},"/v1/feedback/dsyms/{uuid}":{"delete":{"description":"Delete a dSYM (and the other UUIDs stored in the same file). Reports keep the symbols they have.","parameters":[{"schema":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"in":"path","name":"uuid","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/feedback/crash-settings":{"get":{"description":"The app's crash reports switch. updatedAt is null until someone chose.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","updatedAt"],"properties":{"enabled":{"description":"Crash reports (default true). Off: ingest answers 202 {accepted:false} and stores nothing.","type":"boolean"},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"patch":{"description":"Turn crash reports on or off. Applies within 30 seconds on every instance; stored reports stay.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","updatedAt"],"properties":{"enabled":{"description":"Crash reports (default true). Off: ingest answers 202 {accepted:false} and stores nothing.","type":"boolean"},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/feedback/dsyms":{"post":{"description":"Start dSYM uploads: one per DWARF Mach-O file (X.dSYM/Contents/Resources/DWARF/X), by its LC_UUID. Answers a signed PUT URL (15 minutes) per UUID not stored yet — PUT the bytes there with exactly the given headers — and the UUIDs already stored. At most 1 GiB per file, and never more than the app's whole dSYM allowance (dsym_too_large).","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["files"],"properties":{"files":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["uuid","arch","name","size"],"properties":{"uuid":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"arch":{"pattern":"^[a-z0-9_]{1,16}$","type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"integer"}}}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["uploads","present"],"properties":{"uploads":{"type":"array","items":{"type":"object","required":["uuid","url","method","headers"],"properties":{"uuid":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}},"present":{"type":"array","items":{"type":"string"}}}}}}}}},"get":{"description":"Stored dSYMs, newest first, and the app's dSYM storage: files (a fat file's aliases not counted again) and bytes against its limits. Completing an upload that goes over a limit evicts the oldest dSYMs.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["items","nextBefore","usage"],"properties":{"items":{"type":"array","items":{"type":"object","required":["uuid","name","arch","size","uploadedAt","aliasOf"],"properties":{"uuid":{"type":"string"},"name":{"type":"string"},"arch":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"},"aliasOf":{"description":"Another slice of a fat file stored under that UUID's object.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"nextBefore":{"anyOf":[{"type":"string"},{"type":"null"}]},"usage":{"type":"object","required":["files","bytes","maxFiles","maxBytes"],"properties":{"files":{"type":"integer"},"bytes":{"type":"integer"},"maxFiles":{"type":"integer"},"maxBytes":{"type":"integer"}}}}}}}}}}},"/v1/admin/feedback/symbols":{"post":{"description":"Start symbol file uploads of one kind. dsym: one per DWARF Mach-O file, id = its LC_UUID (as POST /dsyms). Answers a signed PUT URL (15 minutes) per file not stored yet, and the ids already stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["kind","files"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"files":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["id","name","size"],"properties":{"id":{"minLength":1,"maxLength":128,"description":"The file's identity: a dSYM's UUID.","type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"integer"},"arch":{"pattern":"^[a-z0-9_]{1,16}$","type":"string"}}}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["kind","uploads","present"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"uploads":{"type":"array","items":{"type":"object","required":["id","url","method","headers"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}},"present":{"type":"array","items":{"type":"string"}}}}}}}}}},"/v1/admin/feedback/symbols/complete":{"post":{"description":"Finish symbol file uploads of one kind (dsym: as POST /dsyms/complete); reports waiting for them are symbolicated again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["kind","ids"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"minLength":1,"maxLength":128,"type":"string"}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["kind","completed","failed","evicted","requeued"],"properties":{"kind":{"description":"dsym (apple). proguard, sourcemap and flutter-symbols are reserved: 422 symbol_kind_unsupported until their module exists.","anyOf":[{"type":"string","enum":["dsym"]},{"type":"string","enum":["proguard"]},{"type":"string","enum":["sourcemap"]},{"type":"string","enum":["flutter-symbols"]}]},"completed":{"type":"array","items":{"type":"object","required":["id","name","size","uploadedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"}}}},"failed":{"type":"array","items":{"type":"object","required":["id","code","reason"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}}}},"evicted":{"type":"array","items":{"type":"string"}},"requeued":{"type":"integer"}}}}}}}}},"/v1/admin/feedback/dsyms/complete":{"post":{"description":"Finish dSYM uploads: each object's Mach-O headers must carry its UUID; every slice's __TEXT vmaddr is recorded (other slices of a fat file as aliases), the oldest dSYMs are evicted while the app is over its file or byte limit, and reports waiting for these UUIDs are symbolicated again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["uuids"],"properties":{"uuids":{"minItems":1,"maxItems":100,"type":"array","items":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["completed","failed","evicted","requeued"],"properties":{"completed":{"type":"array","items":{"type":"object","required":["uuid","name","arch","size","uploadedAt","aliasOf"],"properties":{"uuid":{"type":"string"},"name":{"type":"string"},"arch":{"type":"string"},"size":{"type":"integer"},"uploadedAt":{"format":"date-time","type":"string"},"aliasOf":{"description":"Another slice of a fat file stored under that UUID's object.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"failed":{"type":"array","items":{"type":"object","required":["uuid","code","reason"],"properties":{"uuid":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}}}},"evicted":{"description":"UUIDs removed, oldest first, to keep the app within its dSYM limits (a fat file's aliases with it).","type":"array","items":{"type":"string"}},"requeued":{"description":"Reports sent back to symbolication.","type":"integer"}}}}}}}}},"/v1/admin/feedback/dsyms/{uuid}":{"delete":{"description":"Delete a dSYM (and the other UUIDs stored in the same file). Reports keep the symbols they have.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"pattern":"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$","type":"string"},"in":"path","name":"uuid","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/knowledge":{"get":{"description":"Whether AirKnowledge is on for this environment, and its knowledge bases, oldest first, each with its revision and its live and previous versions and draft, each with its files (names, sizes and SHA-256, never their text).","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","knowledges"],"properties":{"enabled":{"type":"boolean"},"knowledges":{"type":"array","items":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}}}}}},"post":{"description":"A new, empty knowledge base named `name` (one line, up to 64 characters, unique within the environment). `id` keeps an id the integrator already uses; one is made otherwise.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"id":{"format":"uuid","type":"string"}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}":{"get":{"description":"A knowledge base: its name and revision, and its live and previous versions and draft, each with its files.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"patch":{"description":"Rename a knowledge base. Requires If-Match with the knowledge base's revision (409 `revision_conflict` when it moved). The name is one line of up to 64 characters, unique within the environment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"if-match","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete a knowledge base. Its files are deleted by the cleanup; apps reading it answer that the knowledge is unavailable.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"204":{"description":"Default Response"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/draft":{"post":{"description":"The open draft, opening one when there is none: a copy of the live version, its files copied in storage, or empty when nothing is live.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Discard the draft; its files are deleted by the cleanup.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"204":{"description":"Default Response"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/draft/files/{name}":{"delete":{"description":"Remove a file from the draft. Removing a file the draft doesn't hold changes nothing; 409 `no_draft` without a draft.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"put":{"description":"Write a file of the draft: its UTF-8 text as the raw body, at most 4 MiB, under a name `index.md` or `nn-slug.md|csv|tsv`. Writes or replaces it; the same bytes again change nothing (`unchanged`). Opens a draft when there is none.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","byteCount","sha256","draftRevision","unchanged"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"draftRevision":{"type":"integer"},"unchanged":{"description":"True when the draft already held these exact bytes under this name.","type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/draft/files/{name}/restore":{"post":{"description":"Copy the live version's file of that name back into the draft, replacing any file of that name there; the same file again changes nothing (`unchanged`).","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","byteCount","sha256","draftRevision","unchanged"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"draftRevision":{"type":"integer"},"unchanged":{"description":"True when the draft already held these exact bytes under this name.","type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/draft/publish":{"post":{"description":"Publish the draft. Requires If-Match with the knowledge base's revision (409 `revision_conflict` when it moved). `files` is what the device believes the draft holds, each name with its SHA-256; anything else is 409 `draft_out_of_sync`. The draft must hold `index.md`, which must name every other file and only those (422 `index_missing`, `index_mismatch`). The draft goes live, the live version becomes the previous one, and the previous one is retired.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"if-match","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/rollback":{"post":{"description":"Put the previous version back. Requires If-Match with the knowledge base's revision (409 `revision_conflict` when it moved). The previous version and the live one trade places; 409 `no_previous_version` when there is none.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"if-match","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/unpublish":{"post":{"description":"Unpublish. Requires If-Match with the knowledge base's revision (409 `revision_conflict` when it moved). Nothing is live afterwards; the version that was becomes the previous one.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"if-match","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["knowledgeID","name","revision","live","previous","draft"],"properties":{"knowledgeID":{"format":"uuid","type":"string"},"name":{"type":"string"},"revision":{"description":"Every publish, rollback, unpublish and rename bumps it; those carry it in If-Match.","type":"integer"},"live":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"previous":{"anyOf":[{"type":"object","required":["versionID","state","fileCount","byteCount","createdAt","publishedAt","files"],"properties":{"versionID":{"format":"uuid","type":"string"},"state":{"description":"draft, live, previous or retired.","type":"string"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"createdAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}}}},{"type":"null"}]},"draft":{"anyOf":[{"type":"object","required":["versionID","draftRevision","fileCount","byteCount","files","updatedAt"],"properties":{"versionID":{"format":"uuid","type":"string"},"draftRevision":{"type":"integer"},"fileCount":{"type":"integer"},"byteCount":{"type":"integer"},"files":{"type":"array","items":{"type":"object","required":["name","byteCount","sha256","mediaType"],"properties":{"name":{"type":"string"},"byteCount":{"type":"integer"},"sha256":{"type":"string"},"mediaType":{"type":"string"}}}},"updatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/knowledge/{id}/versions/{version}/files/{name}":{"get":{"description":"A file of the draft, the live or the previous version, as stored. `ETag` is its SHA-256 and `If-None-Match` answers 304; a published version's files are cacheable for good, a draft's are `no-cache`. 404 `knowledge_version_gone` for a retired version or another knowledge base's, `knowledge_file_not_found` for a file the version doesn't hold.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"version","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/knowledge/{id}/mcp":{"post":{"description":"The knowledge MCP server (JSON-RPC 2.0, one message per POST) over one version of this knowledge base — `draft`, `live` (the default) or `previous` — whether AirKnowledge is on or off, for AirBuild's Try It and the console. Paced per knowledge base as the public server is, in a bucket of its own: 429 `knowledge_rate_limited` with `Retry-After`.","parameters":[{"schema":{"type":"string"},"in":"query","name":"version","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/knowledge/{id}/mcp":{"post":{"description":"The knowledge MCP server for an app's Worker, over the live version: a stateless MCP server (Streamable HTTP, JSON responses, no sessions). Methods `initialize`, `ping`, `tools/list`, `tools/call`; tools `ls`, `read` and `grep`. Only Workers deployed on this platform call it (the outbound worker signs them on): 401 `knowledge_auth_required` otherwise; 404 `knowledge_not_found` for another environment's knowledge base; 403 `knowledge_disabled` while AirKnowledge is off; 429 `knowledge_rate_limited` with `Retry-After`.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/billing/account":{"get":{"description":"Cash and grant balances, status, and unspent grants of this billing account.","security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/ledger":{"get":{"description":"Ledger entries newest first; pass `next` back as `before` for the next page.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["entries","next"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","kind","bucket","amountMicroUSD","grantId","usageId","topupId","note","createdAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"bucket":{"anyOf":[{"type":"string","enum":["cash"]},{"type":"string","enum":["grant"]}]},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"usageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"topupId":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/activity":{"get":{"description":"Money in and out, newest first: top-ups, grants, refunds, adjustments, expired grants, and paid-call charges merged into one entry per UTC day and application. Pass `next` back as `before` for the next page.","parameters":[{"schema":{"minLength":1,"maxLength":400,"type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["entries","next"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","kind","tenantId","day","calls","amountMicroUSD","createdAt"],"properties":{"id":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["topup"]},{"type":"string","enum":["grant"]},{"type":"string","enum":["refund"]},{"type":"string","enum":["adjustment"]},{"type":"string","enum":["exa_freeze"]},{"type":"string","enum":["exa_release"]},{"type":"string","enum":["usage"]},{"type":"string","enum":["grant_expired"]}]},"tenantId":{"description":"usage: the application charged.","anyOf":[{"type":"string"},{"type":"null"}]},"day":{"description":"usage: the UTC day, YYYY-MM-DD.","anyOf":[{"type":"string"},{"type":"null"}]},"calls":{"description":"usage: paid calls merged into this entry.","anyOf":[{"type":"integer"},{"type":"null"}]},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"createdAt":{"format":"date-time","type":"string"}}}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/usage":{"get":{"description":"Paid-call spend per UTC day, application and service. Defaults to the last 30 days.","parameters":[{"schema":{"format":"date-time","type":"string"},"in":"query","name":"from","required":false},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"to","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["usage"],"properties":{"usage":{"type":"array","items":{"type":"object","required":["day","tenantId","service","calls","priceMicroUSD"],"properties":{"day":{"description":"UTC day, YYYY-MM-DD.","type":"string"},"tenantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"service":{"type":"string"},"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}}}}}}}}}},"/v1/billing/usage/users":{"get":{"description":"The payer's settled AirRouter charges by application, environment and app user. A null user groups unattributed calls. Totals cover the whole selected month and optional application.","parameters":[{"schema":{"pattern":"^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"},"in":"query","name":"month","required":false,"description":"UTC settlement month (YYYY-MM)."},{"schema":{"minimum":1,"maximum":100,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"after","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["month","totals","users","next"],"properties":{"month":{"pattern":"^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$","description":"UTC settlement month (YYYY-MM).","type":"string"},"totals":{"type":"object","required":["calls","priceMicroUSD"],"properties":{"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}},"users":{"type":"array","items":{"type":"object","required":["tenantId","environment","user","calls","priceMicroUSD"],"properties":{"tenantId":{"format":"uuid","type":"string"},"environment":{"type":"string"},"user":{"anyOf":[{"minLength":1,"maxLength":128,"type":"string"},{"type":"null"}]},"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}},"next":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/usage/charges":{"get":{"description":"Read the settled charges for one app user. Omit user for unattributed calls. Pass next as before to read older charges.","parameters":[{"schema":{"pattern":"^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"},"in":"query","name":"month","required":false,"description":"UTC settlement month (YYYY-MM)."},{"schema":{"minimum":1,"maximum":100,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"minLength":1,"maxLength":63,"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"minLength":1,"maxLength":128,"type":"string"},"in":"query","name":"user","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"before","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["month","charges","next"],"properties":{"month":{"pattern":"^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$","description":"UTC settlement month (YYYY-MM).","type":"string"},"charges":{"type":"array","items":{"type":"object","required":["id","requestId","occurredAt","service","apiPath","priceMicroUSD"],"properties":{"id":{"format":"uuid","type":"string"},"requestId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"occurredAt":{"format":"date-time","type":"string"},"service":{"type":"string"},"apiPath":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}},"next":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/tenants":{"get":{"description":"Applications whose paid calls this account pays for.","security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenants"],"properties":{"tenants":{"type":"array","items":{"type":"object","required":["tenantId"],"properties":{"tenantId":{"type":"string"}}}}}}}}}}}},"/v1/billing/topups":{"post":{"description":"Start a Stripe Checkout top-up for a whole number of dollars. Open `checkoutUrl` in a browser; the balance moves when Stripe confirms payment. With `returnTo: \"airbuild\"` Checkout returns to `/billing/return`, which hands over to the AirBuild app.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amountMicroUSD"],"properties":{"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"returnTo":{"type":"string","enum":["airbuild"]}}}}}},"security":[{"billingToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","amountMicroUSD","status","checkoutUrl","checkoutExpiresAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"status":{"type":"string","enum":["pending"]},"checkoutUrl":{"type":"string"},"checkoutExpiresAt":{"format":"date-time","type":"string"}}}}}}}},"get":{"description":"The account's top-ups, newest first (pending, paid or expired, with any refund). Stripe emails the receipts.","parameters":[{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["topups"],"properties":{"topups":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","status","discountMicroUSD","refundedMicroUSD","createdAt","paidAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["paid"]},{"type":"string","enum":["expired"]}]},"discountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"refundedMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}}},"/v1/billing/topups/{topup}":{"get":{"description":"A top-up's status; the return page polls this after Checkout.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"topup","required":true}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","amountMicroUSD","status","discountMicroUSD","refundedMicroUSD","createdAt","paidAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"status":{"anyOf":[{"type":"string","enum":["pending"]},{"type":"string","enum":["paid"]},{"type":"string","enum":["expired"]}]},"discountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"refundedMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/billing/links":{"post":{"description":"Mint a one-time link that opens the console's Billing page for this account in a browser, without signing in again. The link works once, for 60 seconds.","security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["url","expiresAt"],"properties":{"url":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}}}}},"/v1/billing/links/exchange":{"post":{"description":"Exchange a billing link's code for a billing token. No credential: the code is the credential. A used, expired or unknown code answers 410 `link_expired`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":16,"maxLength":128,"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["token","expiresAt"],"properties":{"token":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}}}}},"/v1/billing/status":{"get":{"description":"Whether this application's paid calls are currently admitted, and its own paid-call spend over the last 30 days. Balances belong to the payer and are not shown.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["payable","reason","last30Days"],"properties":{"payable":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["billing_account_required"]},{"type":"string","enum":["billing_account_closed"]},{"type":"string","enum":["payment_required"]},{"type":"null"}]},"last30Days":{"type":"object","required":["calls","priceMicroUSD"],"properties":{"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}}}}}}}}},"/v1/admin/billing-accounts/by-ref/{ref}":{"put":{"description":"Get or create the billing account for an integrator reference. The Stripe mode is fixed when the account is created.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["stripeMode"],"properties":{"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"displayName":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"minLength":1,"maxLength":128,"type":"string"},"in":"path","name":"ref","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/billing-accounts":{"get":{"description":"List billing accounts newest first (then by id); the filters combine. One page of `limit` rows from `offset`, with `total`: every account the filters match.","parameters":[{"schema":{"type":"string"},"in":"query","name":"ref","required":false,"description":"Exactly this integrator reference."},{"schema":{"minimum":1,"maximum":200,"default":50,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"minimum":0,"default":0,"type":"integer"},"in":"query","name":"offset","required":false},{"schema":{"minLength":1,"maxLength":128,"type":"string"},"in":"query","name":"refPrefix","required":false,"description":"The reference starts with this, matched literally (`%` and `_` are plain characters)."},{"schema":{"minLength":1,"maxLength":200,"type":"string"},"in":"query","name":"q","required":false,"description":"Case-insensitive substring of the reference or the display name, matched literally."},{"schema":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"in":"query","name":"status","required":false}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accounts","total","limit","offset"],"properties":{"accounts":{"type":"array","items":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}},"total":{"description":"Every account the filters match.","type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}}}}},"/v1/admin/billing/daily":{"get":{"description":"The platform's money per UTC day, across every live-mode billing account (test mode is never counted; a manager token bound to an environment reads the test-mode accounts instead): cash topped up net of promo discounts, the discounts (given as grants), cash refunded, and paid calls sold against their upstream cost, per service. Days are `[from, to)`, dense, oldest first; at most 93.","parameters":[{"schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"in":"query","name":"from","required":true,"description":"First UTC day, `YYYY-MM-DD`."},{"schema":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"in":"query","name":"to","required":true,"description":"The UTC day after the last, `YYYY-MM-DD`."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["days"],"properties":{"days":{"type":"array","items":{"type":"object","required":["day","topups","topupCashMicroUSD","discountMicroUSD","refundMicroUSD","usagePriceMicroUSD","usageCostMicroUSD","usagePaidByGrantMicroUSD","services"],"properties":{"day":{"type":"string"},"topups":{"description":"Top-ups paid in cash that day.","type":"integer"},"topupCashMicroUSD":{"description":"Cash those top-ups brought in (face value − discount).","type":"integer"},"discountMicroUSD":{"description":"Promo discounts, credited as grants.","type":"integer"},"refundMicroUSD":{"description":"Cash refunded, positive.","type":"integer"},"usagePriceMicroUSD":{"description":"Paid calls sold, at their price.","type":"integer"},"usageCostMicroUSD":{"description":"Sum of reported upstream costs. Services identify calls with unreported cost.","type":"integer"},"usagePaidByGrantMicroUSD":{"description":"The part of the price grants paid.","type":"integer"},"services":{"type":"array","items":{"type":"object","required":["service","calls","priceMicroUSD","costMicroUSD"],"properties":{"service":{"type":"string"},"calls":{"type":"integer"},"priceMicroUSD":{"type":"integer"},"costMicroUSD":{"type":"integer"},"unreportedCostCalls":{"type":"integer"}}}}}}}}}}}}}}},"/v1/admin/billing-accounts/{account}":{"get":{"description":"Any billing account.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/billing-accounts/{account}/gateway-models":{"get":{"description":"Read one billing account's Claude Gateway model allowlist (empty means /gateway is hidden and disabled).","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accountId","allowedModels"],"properties":{"accountId":{"type":"string"},"allowedModels":{"type":"array","items":{"type":"string"}}}}}}}}},"put":{"description":"Set one billing account's Claude Gateway model allowlist (exact model ids or prefix* wildcards; [] disables /gateway).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["allowedModels"],"properties":{"allowedModels":{"maxItems":100,"type":"array","items":{"minLength":1,"maxLength":200,"type":"string"}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accountId","allowedModels"],"properties":{"accountId":{"type":"string"},"allowedModels":{"type":"array","items":{"type":"string"}}}}}}}}}},"/v1/admin/billing-accounts/{account}/ledger":{"get":{"description":"Any billing account's ledger.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["entries","next"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["id","kind","bucket","amountMicroUSD","grantId","usageId","topupId","note","createdAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"bucket":{"anyOf":[{"type":"string","enum":["cash"]},{"type":"string","enum":["grant"]}]},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"usageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"topupId":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/billing-accounts/{account}/usage":{"get":{"description":"Any billing account's paid-call spend.","parameters":[{"schema":{"format":"date-time","type":"string"},"in":"query","name":"from","required":false},{"schema":{"format":"date-time","type":"string"},"in":"query","name":"to","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["usage"],"properties":{"usage":{"type":"array","items":{"type":"object","required":["day","tenantId","service","calls","priceMicroUSD"],"properties":{"day":{"description":"UTC day, YYYY-MM-DD.","type":"string"},"tenantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"service":{"type":"string"},"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}}}}}}}}}},"/v1/admin/billing-accounts/{account}/tokens":{"post":{"description":"Mint a billing token for one account (at most 900 seconds).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ttl":{"minimum":60,"maximum":900,"type":"integer"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["token","baseUrl","expiresAt"],"properties":{"token":{"type":"string"},"baseUrl":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}}}}},"/v1/admin/billing-accounts/{account}/grants":{"post":{"description":"Grant credit. Grants are spent before cash, soonest-expiring first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amountMicroUSD","reason"],"properties":{"amountMicroUSD":{"minimum":1,"type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"maxLength":500,"type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}}}}}}},"/v1/admin/billing-accounts/{account}/grants/{grant}/revoke":{"post":{"description":"Forfeit what is left of a grant.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"maxLength":500,"type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"grant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revokedMicroUSD"],"properties":{"revokedMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}}}}}}},"/v1/admin/billing-accounts/{account}/adjustments":{"post":{"description":"Correct the cash balance by a signed amount. `externalRef` makes a retried correction apply once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amountMicroUSD","note"],"properties":{"amountMicroUSD":{"type":"integer"},"note":{"minLength":1,"maxLength":500,"type":"string"},"externalRef":{"minLength":1,"maxLength":128,"type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}}},"/v1/admin/billing-accounts/{account}/close":{"post":{"description":"Close an account: paid calls and top-ups stop and unspent grants are forfeited. Remaining cash is refunded by hand in Stripe.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"account","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","externalRef","displayName","stripeMode","status","cashBalanceMicroUSD","grantBalanceMicroUSD","availableMicroUSD","gatewayAllowedModels","topupsEnabled","grants","createdAt","closedAt"],"properties":{"id":{"type":"string"},"externalRef":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeMode":{"anyOf":[{"type":"string","enum":["live"]},{"type":"string","enum":["test"]}]},"status":{"anyOf":[{"type":"string","enum":["active"]},{"type":"string","enum":["closed"]}]},"cashBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"grantBalanceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"availableMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"gatewayAllowedModels":{"type":"array","items":{"type":"string"}},"topupsEnabled":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","required":["id","amountMicroUSD","remainingMicroUSD","expiresAt","reason","createdAt"],"properties":{"id":{"type":"string"},"amountMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"remainingMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"reason":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"closedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/tenants/{tenant}/billing-account":{"get":{"description":"Which billing account pays for this application's paid calls.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accountId"],"properties":{"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"put":{"description":"Set or clear (null) who pays for this application's paid calls.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["accountId"],"properties":{"accountId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["accountId"],"properties":{"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/router/exa/pending":{"get":{"description":"Searches requiring provider outcome reconciliation.","security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["requests"],"properties":{"requests":{"type":"array","items":{"type":"object","required":["id","accountId","keyId","createdAt","status"],"properties":{"id":{"format":"uuid","type":"string"},"accountId":{"format":"uuid","type":"string"},"keyId":{"description":"Legacy inventory ID, or null for shared-key searches.","anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"status":{"type":"string"}}}}}}}}}}}},"/v1/admin/router/exa/requests/{id}/resolve":{"post":{"description":"Settle one confirmed successful search or release a confirmed unsuccessful search.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["succeeded"],"properties":{"succeeded":{"type":"boolean"},"providerRequestId":{"minLength":1,"maxLength":200,"type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["resolved"],"properties":{"resolved":{"type":"boolean"}}}}}}}}},"/v1/router/keys":{"get":{"description":"List this environment's router keys; secrets are never returned.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"object","required":["id","label","suffix","createdAt","lastUsedAt"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"suffix":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}},"post":{"description":"Issue a router key for calling the router from outside this platform. It can only spend this environment's money; the secret is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"minLength":1,"maxLength":100,"type":"string"}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["id","label","suffix","createdAt","lastUsedAt"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"suffix":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}]}}}}}}},"/v1/router/keys/{id}":{"delete":{"description":"Revoke a router key immediately.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/router/settings":{"get":{"description":"This environment's daily spend limit and what it spent today (UTC).","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["dailyLimitUSD","spentTodayUSD"],"properties":{"dailyLimitUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"spentTodayUSD":{"description":"US dollars, six decimals","type":"string"}}}}}}}},"put":{"description":"Set this environment's daily spend limit in US dollars (UTC day); null removes it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["dailyLimitUSD"],"properties":{"dailyLimitUSD":{"type":"number","nullable":true,"minimum":0,"maximum":1000000}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["dailyLimitUSD","spentTodayUSD"],"properties":{"dailyLimitUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"spentTodayUSD":{"description":"US dollars, six decimals","type":"string"}}}}}}}}},"/v1/router/usage":{"get":{"description":"This environment's router calls and spend over the last `days` UTC days (today included): per day, per provider and per app user, with today's spend against the daily limit and whether paid calls are admitted. Shows no balance.","parameters":[{"schema":{"minimum":1,"maximum":90,"type":"integer"},"in":"query","name":"days","required":false},{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"userLimit","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["days","providers","users","totals","today","settings","status"],"properties":{"days":{"description":"One row per UTC day of the window, oldest first, zeros included.","type":"array","items":{"type":"object","required":["day","calls","failed","costUSD"],"properties":{"day":{"description":"UTC day, YYYY-MM-DD.","type":"string"},"calls":{"type":"integer"},"failed":{"type":"integer"},"costUSD":{"description":"US dollars, six decimals","type":"string"}}}},"providers":{"type":"array","items":{"type":"object","required":["provider","calls","costUSD"],"properties":{"provider":{"type":"string"},"calls":{"type":"integer"},"costUSD":{"description":"US dollars, six decimals","type":"string"}}}},"users":{"description":"App users (`x-router-user`) by cost, highest first.","type":"array","items":{"type":"object","required":["user","calls","costUSD","lastAt"],"properties":{"user":{"type":"string"},"calls":{"type":"integer"},"costUSD":{"description":"US dollars, six decimals","type":"string"},"lastAt":{"format":"date-time","type":"string"}}}},"totals":{"type":"object","required":["calls","failed","costUSD","users"],"properties":{"calls":{"type":"integer"},"failed":{"type":"integer"},"costUSD":{"description":"US dollars, six decimals","type":"string"},"users":{"type":"integer"}}},"today":{"type":"object","required":["calls","costUSD"],"properties":{"calls":{"type":"integer"},"costUSD":{"description":"US dollars, six decimals","type":"string"}}},"settings":{"type":"object","required":["dailyLimitUSD","spentTodayUSD"],"properties":{"dailyLimitUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"spentTodayUSD":{"description":"US dollars, six decimals","type":"string"}}},"status":{"type":"object","required":["payable","reason","availableUSD"],"properties":{"payable":{"type":"boolean"},"reason":{"description":"Why paid calls are refused: router_disabled, payment_required, billing_account_required, billing_account_closed or spend_limit_reached.","anyOf":[{"type":"string"},{"type":"null"}]},"availableUSD":{"description":"The paying account's balance (funds plus credits); null when no account pays for this application.","anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]}}}}}}}}}}},"/v1/router/requests":{"get":{"description":"Recent router calls in this environment, newest first.","parameters":[{"schema":{"format":"date-time","type":"string"},"in":"query","name":"before","required":false},{"schema":{"minimum":1,"maximum":200,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"minLength":1,"maxLength":128,"type":"string"},"in":"query","name":"user","required":false,"description":"Only this app user (`x-router-user`)."},{"schema":{"minLength":1,"maxLength":64,"type":"string"},"in":"query","name":"provider","required":false},{"schema":{"anyOf":[{"type":"string","enum":["succeeded"]},{"type":"string","enum":["failed"]},{"type":"string","enum":["running"]}]},"in":"query","name":"status","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["requests"],"properties":{"requests":{"type":"array","items":{"type":"object","required":["id","provider","method","path","mode","status","costUSD","worker","user","upstreamStatus","model","error","createdAt","finishedAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"mode":{"type":"string"},"status":{"type":"string"},"costUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"worker":{"anyOf":[{"type":"string"},{"type":"null"}]},"user":{"anyOf":[{"type":"string"},{"type":"null"}]},"upstreamStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"model":{"description":"The request body's top-level `model`; fal: the endpoint id.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"description":"The router's own `x-router-error` code when it refused or failed the call.","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}}},"/v1/router/requests/{id}":{"get":{"description":"One router call of this environment.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","provider","method","path","mode","status","costUSD","worker","user","upstreamStatus","model","error","createdAt","finishedAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"mode":{"type":"string"},"status":{"type":"string"},"costUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"worker":{"anyOf":[{"type":"string"},{"type":"null"}]},"user":{"anyOf":[{"type":"string"},{"type":"null"}]},"upstreamStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"model":{"description":"The request body's top-level `model`; fal: the endpoint id.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"description":"The router's own `x-router-error` code when it refused or failed the call.","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"/v1/admin/router/prices":{"get":{"description":"List AirRouter Gateway model pricing and routing rules.","parameters":[{"schema":{"minLength":1,"maxLength":64,"type":"string"},"in":"query","name":"routeGroup","required":false}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["id","routeGroup","model","upstreamTarget","upstreamModel","inputPerMtok","outputPerMtok","cacheReadPerMtok","cacheWrite5mPerMtok","cacheWrite1hPerMtok","longContextThreshold","longContextMultiplierBps","sellMultiplierBps","costMultiplierBps","enabled","updatedAt"],"properties":{"id":{"type":"string"},"routeGroup":{"type":"string"},"model":{"type":"string"},"upstreamTarget":{"anyOf":[{"type":"string","enum":["airrelay:claude"]},{"type":"string","enum":["sub2api:anthropic"]}]},"upstreamModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"inputPerMtok":{"minimum":0,"type":"integer"},"outputPerMtok":{"minimum":0,"type":"integer"},"cacheReadPerMtok":{"minimum":0,"type":"integer"},"cacheWrite5mPerMtok":{"minimum":0,"type":"integer"},"cacheWrite1hPerMtok":{"minimum":0,"type":"integer"},"longContextThreshold":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}]},"longContextMultiplierBps":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"sellMultiplierBps":{"minimum":0,"type":"integer"},"costMultiplierBps":{"minimum":0,"type":"integer"},"enabled":{"type":"boolean"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}}}},"put":{"description":"Batch upsert AirRouter Gateway model pricing and routing rules.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","required":["routeGroup","model","upstreamTarget","inputPerMtok","outputPerMtok"],"properties":{"routeGroup":{"minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_-]*$","type":"string"},"model":{"minLength":1,"maxLength":200,"type":"string"},"upstreamTarget":{"anyOf":[{"type":"string","enum":["airrelay:claude"]},{"type":"string","enum":["sub2api:anthropic"]}]},"upstreamModel":{"anyOf":[{"minLength":1,"maxLength":200,"type":"string"},{"type":"null"}]},"inputPerMtok":{"minimum":0,"type":"integer"},"outputPerMtok":{"minimum":0,"type":"integer"},"cacheReadPerMtok":{"minimum":0,"type":"integer"},"cacheWrite5mPerMtok":{"minimum":0,"type":"integer"},"cacheWrite1hPerMtok":{"minimum":0,"type":"integer"},"longContextThreshold":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}]},"longContextMultiplierBps":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"sellMultiplierBps":{"minimum":0,"type":"integer"},"costMultiplierBps":{"minimum":0,"type":"integer"},"enabled":{"type":"boolean"}}}}}}}}},"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["id","routeGroup","model","upstreamTarget","upstreamModel","inputPerMtok","outputPerMtok","cacheReadPerMtok","cacheWrite5mPerMtok","cacheWrite1hPerMtok","longContextThreshold","longContextMultiplierBps","sellMultiplierBps","costMultiplierBps","enabled","updatedAt"],"properties":{"id":{"type":"string"},"routeGroup":{"type":"string"},"model":{"type":"string"},"upstreamTarget":{"anyOf":[{"type":"string","enum":["airrelay:claude"]},{"type":"string","enum":["sub2api:anthropic"]}]},"upstreamModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"inputPerMtok":{"minimum":0,"type":"integer"},"outputPerMtok":{"minimum":0,"type":"integer"},"cacheReadPerMtok":{"minimum":0,"type":"integer"},"cacheWrite5mPerMtok":{"minimum":0,"type":"integer"},"cacheWrite1hPerMtok":{"minimum":0,"type":"integer"},"longContextThreshold":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}]},"longContextMultiplierBps":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"sellMultiplierBps":{"minimum":0,"type":"integer"},"costMultiplierBps":{"minimum":0,"type":"integer"},"enabled":{"type":"boolean"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}}}}},"/v1/admin/router/prices/{id}":{"delete":{"description":"Delete one AirRouter Gateway model pricing rule.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/admin/router/upstreams":{"get":{"description":"Configuration summary of AirRouter upstreams.","security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["airrelay","sub2api","openrouter","elevenlabs","fal","aisa"],"properties":{"airrelay":{"type":"object","required":["configured","baseUrl","useIam"],"properties":{"configured":{"type":"boolean"},"baseUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"useIam":{"type":"boolean"}}},"sub2api":{"type":"object","required":["configured","baseUrl"],"properties":{"configured":{"type":"boolean"},"baseUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"openrouter":{"type":"object","required":["configured"],"properties":{"configured":{"type":"boolean"}}},"elevenlabs":{"type":"object","required":["configured"],"properties":{"configured":{"type":"boolean"}}},"fal":{"type":"object","required":["configured"],"properties":{"configured":{"type":"boolean"}}},"aisa":{"type":"object","required":["configured"],"properties":{"configured":{"type":"boolean"}}}}}}}}}}},"/v1/billing/router/status":{"get":{"description":"Account balance, AirRouter availability across providers, optional per-account Claude model restriction, and whether paid calls are admitted.","security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","allowedModels","payable","reason","availableUSD","providers"],"properties":{"enabled":{"type":"boolean"},"allowedModels":{"type":"array","items":{"type":"string"}},"payable":{"type":"boolean"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"availableUSD":{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},"providers":{"type":"object","required":["claude-code","openrouter","fal","elevenlabs","aisa"],"properties":{"claude-code":{"type":"boolean"},"openrouter":{"type":"boolean"},"fal":{"type":"boolean"},"elevenlabs":{"type":"boolean"},"aisa":{"type":"boolean"}}}}}}}}}}},"/v1/billing/router/keys":{"get":{"description":"List account-level AirRouter API keys; secrets are never returned.","security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"type":"object","required":["id","label","prefix","suffix","routeGroup","spendLimitUSD","spentUSD","disabled","createdAt","lastUsedAt"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string"},"suffix":{"type":"string"},"routeGroup":{"type":"string"},"spendLimitUSD":{"anyOf":[{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},{"type":"null"}]},"spentUSD":{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},"disabled":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}},"post":{"description":"Create an account-level AirRouter API key (`sk-air-…`) usable across all AirRouter providers without needing an application tenant. The secret is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"minLength":1,"maxLength":100,"type":"string"},"routeGroup":{"minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_-]*$","type":"string"},"spendLimitUSD":{"type":"number","nullable":true,"minimum":0,"maximum":1000000}}}}}},"security":[{"billingToken":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","allOf":[{"type":"object","required":["id","label","prefix","suffix","routeGroup","spendLimitUSD","spentUSD","disabled","createdAt","lastUsedAt"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string"},"suffix":{"type":"string"},"routeGroup":{"type":"string"},"spendLimitUSD":{"anyOf":[{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},{"type":"null"}]},"spentUSD":{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},"disabled":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}]}}}}}}},"/v1/billing/router/keys/usage":{"get":{"description":"Settled spend per account-level API key over the last `days` days (default 30, at most 90). A revoked key has a null label.","parameters":[{"schema":{"minimum":1,"maximum":90,"type":"integer"},"in":"query","name":"days","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["usage"],"properties":{"usage":{"type":"array","items":{"type":"object","required":["keyId","label","calls","priceMicroUSD"],"properties":{"keyId":{"type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"calls":{"type":"integer"},"priceMicroUSD":{"description":"Micro-USD (1 USD = 1,000,000).","type":"integer"}}}}}}}}}}}},"/v1/billing/router/keys/{id}":{"patch":{"description":"Update an account-level AirRouter API key's label, status, route group, or spend limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"minLength":1,"maxLength":100,"type":"string"},"routeGroup":{"minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9_-]*$","type":"string"},"disabled":{"type":"boolean"},"spendLimitUSD":{"type":"number","nullable":true,"minimum":0,"maximum":1000000}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","label","prefix","suffix","routeGroup","spendLimitUSD","spentUSD","disabled","createdAt","lastUsedAt"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string"},"suffix":{"type":"string"},"routeGroup":{"type":"string"},"spendLimitUSD":{"anyOf":[{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},{"type":"null"}]},"spentUSD":{"pattern":"^-?[0-9]+\\.[0-9]{6}$","type":"string"},"disabled":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"delete":{"description":"Revoke and delete an account-level AirRouter API key.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"id","required":true}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/v1/billing/router/models":{"get":{"description":"Enabled `claude-code` models and public per-1M token rates (synced from sub2api when configured).","parameters":[{"schema":{"minLength":1,"maxLength":64,"type":"string"},"in":"query","name":"routeGroup","required":false}],"security":[{"billingToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["models"],"properties":{"models":{"type":"array","items":{"type":"object","required":["routeGroup","model","inputPerMtokMicroUSD","outputPerMtokMicroUSD","cacheReadPerMtokMicroUSD","cacheWrite5mPerMtokMicroUSD","cacheWrite1hPerMtokMicroUSD","longContextThreshold","longContextMultiplierBps"],"properties":{"routeGroup":{"type":"string"},"model":{"type":"string"},"inputPerMtokMicroUSD":{"type":"integer"},"outputPerMtokMicroUSD":{"type":"integer"},"cacheReadPerMtokMicroUSD":{"type":"integer"},"cacheWrite5mPerMtokMicroUSD":{"type":"integer"},"cacheWrite1hPerMtokMicroUSD":{"type":"integer"},"longContextThreshold":{"anyOf":[{"type":"integer"},{"type":"null"}]},"longContextMultiplierBps":{"anyOf":[{"type":"integer"},{"type":"null"}]}}}}}}}}}}}},"/v1/workers/{name}/logs":{"get":{"description":"Live SSE logs. A later viewer replaces the previous viewer; no logs are retained.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/workers/{name}/logs":{"get":{"description":"Live SSE logs. A later viewer replaces the previous viewer; no logs are retained.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/authorize":{"get":{"description":"Start a sign-in: validates the app, then redirects the browser to the provider. Every sign-in carries a mandatory S256 PKCE code_challenge. Native clients pass their own plus native_redirect (a custom URI scheme); the grant then returns to that scheme instead of the app's /_auth/callback. Browser sign-ins get theirs from the app's /_auth/login, bound to a login cookie on the app's host.","parameters":[{"schema":{"type":"string"},"in":"query","name":"app","required":true},{"schema":{"type":"string"},"in":"query","name":"provider","required":false},{"schema":{"type":"string"},"in":"query","name":"return_to","required":false},{"schema":{"type":"string"},"in":"query","name":"native_redirect","required":false},{"schema":{"minLength":43,"maxLength":128,"type":"string"},"in":"query","name":"code_challenge","required":false},{"schema":{"type":"string","enum":["S256"]},"in":"query","name":"code_challenge_method","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/grants/exchange":{"post":{"description":"Consume a one-time login grant for a session token and the first identity token. Called by the dispatch worker for browser logins (with the verifier from the login cookie); native clients call it directly with the code_verifier matching their PKCE challenge. A grant minted without a challenge refuses any code_verifier.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grant","app"],"properties":{"grant":{"type":"string"},"app":{"type":"string"},"code_verifier":{"minLength":43,"maxLength":128,"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["token","tokenTtlSeconds","session","sessionTtlSeconds"],"properties":{"token":{"type":"string"},"tokenTtlSeconds":{"type":"integer"},"session":{"type":"string"},"sessionTtlSeconds":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/sessions/refresh":{"post":{"description":"Refresh an identity token from a session, sliding the session expiry. Called by the dispatch worker.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["session","app"],"properties":{"session":{"type":"string"},"app":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["token","tokenTtlSeconds","sessionTtlSeconds"],"properties":{"token":{"type":"string"},"tokenTtlSeconds":{"type":"integer"},"sessionTtlSeconds":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/sessions/revoke":{"post":{"description":"Revoke a session (logout).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean","enum":[true]}}}}}}}}},"/users/delete":{"post":{"description":"Delete the signed-in user's account: their membership in the app and every session, plus their global identity when this was their last app. Called by the dispatch worker from POST /_auth/delete after the app's own deleteUser hook succeeded; the session token is the credential.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["session","app"],"properties":{"session":{"type":"string"},"app":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/users":{"get":{"description":"List this app's signed-in users (newest first).","parameters":[{"schema":{"minimum":1,"maximum":500,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"minimum":0,"type":"integer"},"in":"query","name":"offset","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"type":"object","required":["id","provider","email","emailVerified","name","banned","createdAt","lastLoginAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailVerified":{"type":"boolean"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastLoginAt":{"format":"date-time","type":"string"}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/users/summary":{"get":{"description":"The App Users dashboard over every user in this environment; days count new users.","parameters":[{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["total","activeToday","activeThisWeek","newThisWeek","days"],"properties":{"total":{"type":"integer"},"activeToday":{"description":"Signed in during the last 24 hours.","type":"integer"},"activeThisWeek":{"description":"Signed in during the last 7 × 24 hours.","type":"integer"},"newThisWeek":{"description":"First signed in during the last 7 × 24 hours.","type":"integer"},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"format":"date","type":"string"},"count":{"type":"integer"}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/users/test-session":{"post":{"description":"Mint a session for a synthetic test user (provider \"test\") so an agent can verify backend behavior with real bearer tokens. The user shows up in the normal user list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["worker"],"properties":{"worker":{"type":"string"},"label":{"minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$","type":"string"},"grant":{"type":"boolean"}}}}}},"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["user"],"properties":{"token":{"type":"string"},"tokenTtlSeconds":{"type":"integer"},"session":{"type":"string"},"sessionTtlSeconds":{"type":"integer"},"grant":{"type":"string"},"grantTtlSeconds":{"type":"integer"},"user":{"type":"object","required":["id","provider","email","emailVerified","name","banned","createdAt","lastLoginAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailVerified":{"type":"boolean"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastLoginAt":{"format":"date-time","type":"string"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/users/{userId}":{"patch":{"description":"Ban or unban a user. Banning revokes their sessions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["banned"],"properties":{"banned":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"userId","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","provider","email","emailVerified","name","banned","createdAt","lastLoginAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailVerified":{"type":"boolean"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastLoginAt":{"format":"date-time","type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete a user's account in this app: their membership, every session, and their global identity when this was their last app. The app's own rows for the user are not touched — that is what the user-initiated POST /_auth/delete does through the app's deleteUser export; this route is for operators.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"userId","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/users":{"get":{"description":"List any app's users.","parameters":[{"schema":{"minimum":1,"maximum":500,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"minimum":0,"type":"integer"},"in":"query","name":"offset","required":false},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"type":"object","required":["id","provider","email","emailVerified","name","banned","createdAt","lastLoginAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailVerified":{"type":"boolean"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastLoginAt":{"format":"date-time","type":"string"}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/users/summary":{"get":{"description":"Any app's App Users dashboard numbers.","parameters":[{"schema":{"type":"string"},"in":"query","name":"tz","required":false,"description":"IANA time zone for the daily buckets, e.g. Asia/Shanghai. Default UTC."},{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"type":"string"},"in":"query","name":"environment","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["total","activeToday","activeThisWeek","newThisWeek","days"],"properties":{"total":{"type":"integer"},"activeToday":{"description":"Signed in during the last 24 hours.","type":"integer"},"activeThisWeek":{"description":"Signed in during the last 7 × 24 hours.","type":"integer"},"newThisWeek":{"description":"First signed in during the last 7 × 24 hours.","type":"integer"},"days":{"description":"The last 30 calendar days in tz, oldest first, today last, zero-filled.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"format":"date","type":"string"},"count":{"type":"integer"}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/users/{userId}":{"patch":{"description":"Ban or unban any app's user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["banned"],"properties":{"banned":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"userId","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","provider","email","emailVerified","name","banned","createdAt","lastLoginAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailVerified":{"type":"boolean"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"lastLoginAt":{"format":"date-time","type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete any app's user (membership, sessions, orphaned identity).","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"userId","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/workers/{name}":{"put":{"description":"Deploy a worker from a tar.gz source archive. The first successful deploy claims the name.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"header","name":"x-worker-database","required":false}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","url","deploymentId","fileCount","hasAssets"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"deploymentId":{"type":"string"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete a worker and retained sources; preserve databases and app users.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/workers":{"get":{"description":"List this tenant's workers.","security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["workers"],"properties":{"workers":{"type":"array","items":{"type":"object","required":["name","url","tenantId","environment","database","createdAt","lastDeployedAt","lastDeployment"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"tenantId":{"type":"string"},"environment":{"type":"string"},"database":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"lastDeployedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastDeployment":{"anyOf":[{"type":"object","required":["id","sizeBytes","fileCount","hasAssets","createdAt"],"properties":{"id":{"type":"string"},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"}}},{"type":"null"}]}}}}}}}}}}}},"/v1/workers/{name}/source":{"get":{"description":"Download the currently deployed source archive (tar.gz).","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/databases/{name}/query":{"post":{"description":"Run SQL against a named database in the credential's environment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sql"],"properties":{"sql":{"minLength":1,"type":"string"},"params":{"type":"array","items":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["result"],"properties":{"result":{"type":"array","items":{}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/tenants/{tenant}/tokens":{"post":{"description":"Mint a short-lived tenant token. The tenant id is an opaque UUID chosen by the integrating application.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"minLength":1,"maxLength":63,"pattern":"^[a-z0-9][a-z0-9_-]*$","type":"string"},"maxWorkers":{"minimum":0,"type":"integer"},"ttl":{"minimum":60,"maximum":3600,"type":"integer"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["token","baseUrl","expiresAt"],"properties":{"token":{"type":"string"},"baseUrl":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/tenants/{tenant}/services":{"put":{"description":"Switch an environment's services on or off: AirRouter (`router`) and AirKnowledge (`knowledge`). Unknown tenants and environments are remembered; a never-switched one has AirRouter on and AirKnowledge off, and leaving `knowledge` out keeps its value. Router off answers relay calls 403 `router_disabled`; knowledge off answers apps' Workers 403 `knowledge_disabled` (the tenant routes keep working). AirHost is always on and has no switch. Idempotent. A manager token bound to an environment switches only that environment, of a tenant it may act on as a whole (see the managerToken scheme; 403 manager_scope_denied otherwise).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment","router"],"properties":{"environment":{"pattern":"^[a-z0-9][a-z0-9_-]{0,62}$","type":"string"},"router":{"type":"boolean"},"knowledge":{"type":"boolean"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenant","environment","router","knowledge"],"properties":{"tenant":{"type":"string"},"environment":{"type":"string"},"router":{"description":"AirRouter: relay calls are accepted.","type":"boolean"},"knowledge":{"description":"AirKnowledge: apps' Workers may call the knowledge MCP server.","type":"boolean"}}}}}}}},"get":{"description":"An environment's service switches.","parameters":[{"schema":{"pattern":"^[a-z0-9][a-z0-9_-]{0,62}$","type":"string"},"in":"query","name":"environment","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["tenant","environment","router","knowledge"],"properties":{"tenant":{"type":"string"},"environment":{"type":"string"},"router":{"description":"AirRouter: relay calls are accepted.","type":"boolean"},"knowledge":{"description":"AirKnowledge: apps' Workers may call the knowledge MCP server.","type":"boolean"}}}}}}}}},"/v1/tenants/{tenant}":{"delete":{"description":"Delete a tenant and all of its environments and resources. A manager token bound to an environment may delete only a tenant it may act on as a whole (see the managerToken scheme; 403 manager_scope_denied otherwise).","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"tenant","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deletedWorkers"],"properties":{"deletedWorkers":{"type":"integer"}}}}}}}}},"/v1/admin/workers":{"get":{"description":"List workers; the filters combine. With `limit`, one page (1 to 100 rows, a larger limit is clamped) ordered by the last deploy (else the claim) newest first, then by name, with the filter's `total`. Without `limit` (deprecated: kept for older integrator builds), every matching worker, newest claim first.","parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":false},{"schema":{"type":"string"},"in":"query","name":"environment","required":false},{"schema":{"type":"string"},"in":"query","name":"name","required":false,"description":"Exactly this worker."},{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Case-insensitive substring of the name, the address, the tenant id or the database name; trimmed, at most 200 characters are used."},{"schema":{"type":"integer"},"in":"query","name":"limit","required":false,"description":"Page size, clamped to 1 to 100. Absent: every row (deprecated)."},{"schema":{"type":"integer"},"in":"query","name":"offset","required":false,"description":"Rows to skip with `limit`; below 0 counts as 0."}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["workers"],"properties":{"workers":{"type":"array","items":{"type":"object","required":["name","url","tenantId","environment","database","createdAt","lastDeployedAt","lastDeployment"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"tenantId":{"type":"string"},"environment":{"type":"string"},"database":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"lastDeployedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastDeployment":{"anyOf":[{"type":"object","required":["id","sizeBytes","fileCount","hasAssets","createdAt"],"properties":{"id":{"type":"string"},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"}}},{"type":"null"}]}}}},"total":{"description":"With `limit`: every worker the filters match.","type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}}}}},"/v1/admin/workers/{name}":{"get":{"description":"Any worker's summary, as the list shows it.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","url","tenantId","environment","database","createdAt","lastDeployedAt","lastDeployment"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"tenantId":{"type":"string"},"environment":{"type":"string"},"database":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"lastDeployedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastDeployment":{"anyOf":[{"type":"object","required":["id","sizeBytes","fileCount","hasAssets","createdAt"],"properties":{"id":{"type":"string"},"sizeBytes":{"type":"integer"},"fileCount":{"type":"integer"},"hasAssets":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"}}},{"type":"null"}]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Force-delete any worker.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/workers/{name}/source":{"get":{"description":"Download any worker's currently deployed source archive.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/databases/{name}/query":{"post":{"description":"Run SQL against a named database in the specified tenant and environment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sql"],"properties":{"sql":{"minLength":1,"type":"string"},"params":{"type":"array","items":{"type":"string"}}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"query","name":"tenant","required":true},{"schema":{"type":"string"},"in":"query","name":"environment","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["result"],"properties":{"result":{"type":"array","items":{}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/workers/{name}/crons/{job}":{"put":{"description":"Create or replace a cron schedule (five-field cron expression, UTC). Setting a cron resets its failure circuit breaker.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schedule"],"properties":{"schedule":{"minLength":1,"type":"string"},"enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"job","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","schedule","enabled","nextRunAt","suspendedUntil","consecutiveFailures","lastRun"],"properties":{"name":{"type":"string"},"schedule":{"type":"string"},"enabled":{"type":"boolean"},"nextRunAt":{"format":"date-time","type":"string"},"suspendedUntil":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"consecutiveFailures":{"type":"integer"},"lastRun":{"anyOf":[{"type":"object","required":["status","scheduledFor","startedAt","finishedAt","httpStatus","error"],"properties":{"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"startedAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"httpStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete a cron schedule.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"job","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/workers/{name}/crons":{"get":{"description":"List a worker's cron schedules with their latest run.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"tenantToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["crons"],"properties":{"crons":{"type":"array","items":{"type":"object","required":["name","schedule","enabled","nextRunAt","suspendedUntil","consecutiveFailures","lastRun"],"properties":{"name":{"type":"string"},"schedule":{"type":"string"},"enabled":{"type":"boolean"},"nextRunAt":{"format":"date-time","type":"string"},"suspendedUntil":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"consecutiveFailures":{"type":"integer"},"lastRun":{"anyOf":[{"type":"object","required":["status","scheduledFor","startedAt","finishedAt","httpStatus","error"],"properties":{"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"startedAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"httpStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/workers/{name}/crons/{job}":{"put":{"description":"Create or replace a cron schedule on any worker.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schedule"],"properties":{"schedule":{"minLength":1,"type":"string"},"enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"job","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["name","schedule","enabled","nextRunAt","suspendedUntil","consecutiveFailures","lastRun"],"properties":{"name":{"type":"string"},"schedule":{"type":"string"},"enabled":{"type":"boolean"},"nextRunAt":{"format":"date-time","type":"string"},"suspendedUntil":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"consecutiveFailures":{"type":"integer"},"lastRun":{"anyOf":[{"type":"object","required":["status","scheduledFor","startedAt","finishedAt","httpStatus","error"],"properties":{"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"startedAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"httpStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}},"delete":{"description":"Delete a cron schedule on any worker.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"job","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"boolean","enum":[true]}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/admin/workers/{name}/crons":{"get":{"description":"List any worker's cron schedules.","parameters":[{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"security":[{"managerToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["crons"],"properties":{"crons":{"type":"array","items":{"type":"object","required":["name","schedule","enabled","nextRunAt","suspendedUntil","consecutiveFailures","lastRun"],"properties":{"name":{"type":"string"},"schedule":{"type":"string"},"enabled":{"type":"boolean"},"nextRunAt":{"format":"date-time","type":"string"},"suspendedUntil":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"consecutiveFailures":{"type":"integer"},"lastRun":{"anyOf":[{"type":"object","required":["status","scheduledFor","startedAt","finishedAt","httpStatus","error"],"properties":{"status":{"type":"string"},"scheduledFor":{"format":"date-time","type":"string"},"startedAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"httpStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","code","reason"],"properties":{"error":{"type":"boolean","enum":[true]},"code":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/router/exa/search":{"post":{"description":"Each confirmed standard search (up to ten results) charges $0.0084 to the project's AirRouter balance. Reuse Idempotency-Key when retrying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["query"],"properties":{"query":{"minLength":1,"maxLength":4000,"type":"string"},"type":{"type":"string","enum":["auto"]},"numResults":{"minimum":1,"maximum":10,"type":"integer"},"category":{"type":"string","enum":["news"]},"userLocation":{"pattern":"^[A-Z]{2}$","type":"string"},"startPublishedDate":{"format":"date-time","type":"string"},"endPublishedDate":{"format":"date-time","type":"string"}}}}}},"security":[{"routerKey":[]},{"tenantToken":[]}],"responses":{"200":{"description":"Default Response"}}}},"/router/_router/status":{"get":{"description":"Whether paid router calls are admitted for the calling environment, its balance and today's spend.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["payable","reason","availableUSD","dailyLimitUSD","spentTodayUSD","freeModel","freeDailyUSD","freeSpentTodayUSD"],"properties":{"payable":{"type":"boolean"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"availableUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"dailyLimitUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"spentTodayUSD":{"description":"US dollars, six decimals","type":"string"},"freeModel":{"description":"The `model` of the platform-paid free preset; null when there is none.","anyOf":[{"type":"string"},{"type":"null"}]},"freeDailyUSD":{"description":"Upstream cost the platform pays for the free preset per application per UTC day.","type":"string"},"freeSpentTodayUSD":{"description":"What this application's free-preset calls cost today.","type":"string"}}}}}}}}},"/router/_router/requests/{id}":{"get":{"description":"One router call of the calling environment, with its final cost once settled (streams and tasks settle after the response).","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","provider","method","path","mode","status","costUSD","worker","user","upstreamStatus","model","error","createdAt","finishedAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"mode":{"type":"string"},"status":{"type":"string"},"costUSD":{"anyOf":[{"description":"US dollars, six decimals","type":"string"},{"type":"null"}]},"worker":{"anyOf":[{"type":"string"},{"type":"null"}]},"user":{"anyOf":[{"type":"string"},{"type":"null"}]},"upstreamStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"model":{"description":"The request body's top-level `model`; fal: the endpoint id.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"description":"The router's own `x-router-error` code when it refused or failed the call.","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}}}}