{"openapi":"3.1.0","info":{"title":"Tangibool public API","version":"1.0.0","description":"Programs and AI assistants act for a person, within their scopes and the person’s role. Verdicts are holds, violated, or unknown; witnesses are replayed; results are bound to their revision, logic digest, and engine and semantics versions. Confirming meaning and expected results, approving merge requests, and creating approved baselines stay with a person in the app. Within v1, changes are additive only. Every error has a stable code; `x-error-codes` on an error response lists the codes the route answers under that status."},"servers":[{"url":"https://api.tangibool.com"}],"externalDocs":{"description":"The guide and the API reference.","url":"https://api.tangibool.com/docs"},"tags":[{"name":"Meta"},{"name":"Account"},{"name":"Models"},{"name":"History"},{"name":"Edits"},{"name":"Branches and tags"},{"name":"Merges"},{"name":"Analyses"},{"name":"Jobs"},{"name":"Exports"},{"name":"Discussion"},{"name":"Webhooks"}],"paths":{"/v1/openapi.json":{"get":{"operationId":"getOpenapiJson","summary":"This specification.","tags":["Meta"],"security":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"openapi":{"type":"string","const":"3.1.0"}},"required":["openapi"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/secret-scanning/reports":{"post":{"operationId":"postSecretScanningReports","summary":"Report leaked tokens (secret-scanning partners). Each live token reported is revoked and its user is told.","tags":["Meta"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"},"source":{"type":"string"}},"required":["token"]}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"token_raw":{"type":"string"},"token_type":{"type":"string"},"label":{"type":"string","enum":["true_positive","false_positive"]}},"required":["token_raw","token_type","label"],"additionalProperties":false}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"operationId":"getMe","summary":"The program’s user and the program itself.","tags":["Account"],"security":[{"bearer":[]},{"oauth2":[]}],"x-required-scopes":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string"},"plan":{"type":"string","enum":["free","basic","pro","team"]}},"required":["id","displayName","email","plan"],"additionalProperties":{}},"client":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["models:read","models:write","analyses","exports","discussion","webhooks"]}}},"required":["kind","id","name","scopes"],"additionalProperties":{}},{"type":"null"}]}},"required":["user","client"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams":{"get":{"operationId":"getTeams","summary":"Teams the user belongs to, oldest first by creation (an order a rename cannot change).","tags":["Models"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; every team without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["viewer","commenter","editor","admin","owner"]}},"required":["id","name","role"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["teams","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{teamId}":{"get":{"operationId":"getTeamsByTeamId","summary":"One team.","tags":["Models"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["viewer","commenter","editor","admin","owner"]}},"required":["id","name","role"],"additionalProperties":{}}},"required":["team"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models":{"get":{"operationId":"getModels","summary":"Models the user can read, newest first by creation (an order an update cannot change).","tags":["Models"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; every model without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"role":{"type":"string","enum":["viewer","commenter","editor","admin","owner"]},"teamId":{"type":["string","null"]},"defaultBranch":{"type":"string"},"updatedAt":{"type":"string","description":"ISO 8601, UTC."}},"required":["id","title","role","teamId","defaultBranch","updatedAt"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["models","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postModels","summary":"Create a model from plain inputs: categories, scales, and quantities; inputs with threshold, category, or scale definitions; formulas as text; source text; glossary; assumptions; and tests (FR-34).","tags":["Models"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}},"title":{"type":"string","minLength":1,"maxLength":200},"teamId":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},{"type":"null"}]},"contentLanguage":{"type":"string","enum":["en","fr","de","es"]},"sourceText":{"type":"string","maxLength":4000},"glossary":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":200},"meaning":{"type":"string","maxLength":2000}},"required":["target","meaning"],"additionalProperties":false}},"tests":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["scenario","property"]},"assignments":{"description":"Input values by input ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"quantities":{"description":"Numbers, levels, values, or sets by quantity ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"maxItems":2000,"type":"array","items":{"type":"string","maxLength":100}}]}},"expected":{"description":"Expected values by formula ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"expectedLabels":{"description":"Expected outcome label (ID or name) by outcome set (ID or name).","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"property":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["satisfiable","tautology","falsifiable","contradiction"]},"formulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"equivalent"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300},"otherText":{"type":"string","maxLength":20000}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["validity","premises-consistent","consistency"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["relevant","irrelevant"]},"formulaId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","varId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"at-least-as-strict"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","otherFormulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"monotone"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"setId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300},"quantityId":{"type":"string","minLength":1,"maxLength":300},"direction":{"type":"string","enum":["never-true-to-false","never-false-to-true","never-earlier","never-later"]}},"required":["kind","direction"],"additionalProperties":false}]},"expectHolds":{"type":"boolean"},"notes":{"type":"string","maxLength":10000},"tags":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}},"source":{"description":"Expectation source; user-confirmed is a person’s act and is refused (422 trusted-record).","type":"string","enum":["user-authored","user-confirmed","ai-proposed","copied-from-formula","counterexample","feedback","imported"]}},"required":["name"],"additionalProperties":false}},"draft":{"default":false,"type":"boolean"},"message":{"type":"string","maxLength":2000},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"teamId":{"type":["string","null"]},"ownerId":{"type":["string","null"]},"defaultBranch":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"updatedAt":{"type":"string","description":"ISO 8601, UTC."}},"required":["id","title","teamId","ownerId","defaultBranch","labels","createdAt","updatedAt"],"additionalProperties":{}},"role":{"type":"string","enum":["viewer","commenter","editor","admin","owner"]},"permissions":{"type":"array","items":{"type":"string"}},"refs":{"type":"object","properties":{"branches":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"head":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"protected":{"type":"boolean"}},"required":["name","head","protected"],"additionalProperties":{}}},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","pattern":"^[0-9a-f]{64}$"},"kind":{"type":"string","enum":["ordinary","approved-baseline"]}},"required":["name","target","kind"],"additionalProperties":{}}}},"required":["branches","tags"],"additionalProperties":{}},"created":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["variable","quantity","formula","assumption","test","category","list","scale"],"x-extensible-enum":true},"name":{"type":"string"},"id":{"type":"string"}},"required":["kind","name","id"],"additionalProperties":false}},"diagnostics":{"type":"array","items":{"type":"object","properties":{"formulaId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"diagnostics":{"type":"array","items":{}}},"required":["formulaId","name","status","diagnostics"],"additionalProperties":{}}},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string"},"message":{"type":"string"}},"required":["severity","message"],"additionalProperties":{}}}},"required":["valid","issues"],"additionalProperties":{}}},"required":["model","role","permissions","refs","created","diagnostics","validation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","compute-limit","invalid-change","invalid-logic","invalid-model","trusted-record"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}":{"get":{"operationId":"getModelsByModelId","summary":"A model; with view=outline, the outline of a revision (rev, the default branch by default).","tags":["Models"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"view","in":"query","required":false,"schema":{"type":"string","enum":["outline"]}},{"name":"rev","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"model":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"teamId":{"type":["string","null"]},"ownerId":{"type":["string","null"]},"defaultBranch":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"updatedAt":{"type":"string","description":"ISO 8601, UTC."}},"required":["id","title","teamId","ownerId","defaultBranch","labels","createdAt","updatedAt"],"additionalProperties":{}},"role":{"type":"string","enum":["viewer","commenter","editor","admin","owner"]},"permissions":{"type":"array","items":{"type":"string"}},"refs":{"type":"object","properties":{"branches":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"head":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"protected":{"type":"boolean"}},"required":["name","head","protected"],"additionalProperties":{}}},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","pattern":"^[0-9a-f]{64}$"},"kind":{"type":"string","enum":["ordinary","approved-baseline"]}},"required":["name","target","kind"],"additionalProperties":{}}}},"required":["branches","tags"],"additionalProperties":{}}},"required":["model","role","permissions","refs"],"additionalProperties":{}},{"type":"object","properties":{"modelId":{"type":"string"},"commit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"outline":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.outline/1"},"mode":{"type":"string","enum":["decision","argument"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":["string","null"]}},"required":["id","name","definition"],"additionalProperties":{}}},"formulas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["output","premise","conclusion"]},"text":{"type":"string"}},"required":["id","name","role","text"],"additionalProperties":{}}},"tests":{"type":"object","properties":{"total":{"type":"number"},"confirmed":{"type":"number"}},"required":["total","confirmed"],"additionalProperties":{}},"source":{"type":"object","properties":{"interpretation":{"type":"string","enum":["not-needed","unconfirmed","confirmed","invalidated"]}},"required":["interpretation"],"additionalProperties":{}}},"required":["schema","mode","inputs","formulas","tests","source"],"additionalProperties":{}}},"required":["modelId","commit","outline"],"additionalProperties":{}}]}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","empty-branch","missing-objects","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/refs":{"get":{"operationId":"getModelsByModelIdRefs","summary":"Branches and tags.","tags":["History"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"branches":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"head":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"protected":{"type":"boolean"}},"required":["name","head","protected"],"additionalProperties":{}}},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","pattern":"^[0-9a-f]{64}$"},"kind":{"type":"string","enum":["ordinary","approved-baseline"]}},"required":["name","target","kind"],"additionalProperties":{}}}},"required":["branches","tags"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/commits":{"get":{"operationId":"getModelsByModelIdCommits","summary":"History of a branch, newest first (children before parents).","tags":["History"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"query","required":false,"schema":{"description":"The branch; the default branch when absent.","type":"string"}},{"name":"commit","in":"query","required":false,"schema":{"description":"Start from this commit instead of a branch head.","type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"description":"Commits to skip; not with `cursor`.","type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"description":"Commits on a page, at most 500; 100 by default.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque. Later pages continue the history the first page started from, however the branch moves meanwhile; send the same filters.","type":"string","maxLength":1000}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"author","in":"query","required":false,"schema":{"type":"string"}},{"name":"changed","in":"query","required":false,"schema":{"description":"Comma-separated changed domains.","type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"commits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}}},"total":{"type":"number"},"hasMore":{"type":"boolean"},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["commits","total","hasMore","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found","commit-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-filter"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/commits/{commitId}":{"get":{"operationId":"getModelsByModelIdCommitsByCommitId","summary":"One commit.","tags":["History"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"commitId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"commit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}}},"required":["commit"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","commit-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/snapshots/{commitId}":{"get":{"operationId":"getModelsByModelIdSnapshotsByCommitId","summary":"The native snapshot of a commit.","tags":["History"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"commitId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"commitId":{"type":"string","pattern":"^[0-9a-f]{64}$"},"commit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"snapshot":{"type":"object","properties":{"artifacts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["artifacts"],"additionalProperties":{}}},"required":["commitId","commit","snapshot"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","commit-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["missing-objects"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/comparisons":{"post":{"operationId":"postModelsByModelIdComparisons","summary":"Text, structure, and behaviour differences between two revisions (FR-20).","tags":["History"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"behaviour":{"type":"boolean"}},"required":["from","to"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"to":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"diff":{},"behaviour":{"anyOf":[{},{"type":"null"}]}},"required":["from","to","diff","behaviour"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","empty-branch","missing-objects","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/changes":{"post":{"operationId":"postModelsByModelIdChanges","summary":"Apply an ordered change set to a branch against its expected head; dryRun stores nothing (FR-34).","tags":["Edits"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"branch":{"type":"string","minLength":1,"maxLength":100},"expectedHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"message":{"default":"","type":"string","maxLength":2000},"edits":{"minItems":1,"maxItems":500,"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"setFormulaText"},"formula":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"text":{"type":"string","maxLength":20000}},"required":["op","formula","text"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"addFormula"},"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["op","text"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"renameFormula"},"formula":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["op","formula","name"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"removeFormula"},"formula":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."}},"required":["op","formula"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"addVariable"},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["op","name"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"renameVariable"},"variable":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["op","variable","name"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"removeVariable"},"variable":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"replaceWith":{"anyOf":[{"type":"boolean"},{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."}]}},"required":["op","variable"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"setThreshold"},"variable":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"quantity":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal"]},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40},"clear":{"type":"boolean"}},"required":["op","variable"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"setSourceText"},"text":{"type":"string","maxLength":4000},"language":{"type":"string","enum":["en","fr","de","es"]}},"required":["op","text"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"setGlossaryMeaning"},"target":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"meaning":{"type":"string","maxLength":2000},"language":{"type":"string","enum":["en","fr","de","es"]}},"required":["op","target","meaning"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"addAssumption"},"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["op","text"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"removeAssumption"},"assumption":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."}},"required":["op","assumption"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"addTest"},"test":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["scenario","property"]},"assignments":{"description":"Input values by input ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"quantities":{"description":"Numbers, levels, values, or sets by quantity ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"maxItems":2000,"type":"array","items":{"type":"string","maxLength":100}}]}},"expected":{"description":"Expected values by formula ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"expectedLabels":{"description":"Expected outcome label (ID or name) by outcome set (ID or name).","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"property":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["satisfiable","tautology","falsifiable","contradiction"]},"formulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"equivalent"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300},"otherText":{"type":"string","maxLength":20000}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["validity","premises-consistent","consistency"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["relevant","irrelevant"]},"formulaId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","varId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"at-least-as-strict"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","otherFormulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"monotone"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"setId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300},"quantityId":{"type":"string","minLength":1,"maxLength":300},"direction":{"type":"string","enum":["never-true-to-false","never-false-to-true","never-earlier","never-later"]}},"required":["kind","direction"],"additionalProperties":false}]},"expectHolds":{"type":"boolean"},"notes":{"type":"string","maxLength":10000},"tags":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}},"source":{"description":"Expectation source; user-confirmed is a person’s act and is refused (422 trusted-record).","type":"string","enum":["user-authored","user-confirmed","ai-proposed","copied-from-formula","counterexample","feedback","imported"]}},"required":["name"],"additionalProperties":false}},"required":["op","test"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"updateTest"},"test":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."},"changes":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["scenario","property"]},"assignments":{"description":"Input values by input ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"quantities":{"description":"Numbers, levels, values, or sets by quantity ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"anyOf":[{"type":"string","maxLength":100},{"maxItems":2000,"type":"array","items":{"type":"string","maxLength":100}}]}},"expected":{"description":"Expected values by formula ID or name.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"}},"expectedLabels":{"description":"Expected outcome label (ID or name) by outcome set (ID or name).","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"string","minLength":1,"maxLength":300}},"property":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["satisfiable","tautology","falsifiable","contradiction"]},"formulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"equivalent"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300},"otherText":{"type":"string","maxLength":20000}},"required":["kind","formulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["validity","premises-consistent","consistency"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["relevant","irrelevant"]},"formulaId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","varId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"at-least-as-strict"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"otherFormulaId":{"type":"string","minLength":1,"maxLength":300}},"required":["kind","formulaId","otherFormulaId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"monotone"},"formulaId":{"type":"string","minLength":1,"maxLength":300},"setId":{"type":"string","minLength":1,"maxLength":300},"varId":{"type":"string","minLength":1,"maxLength":300},"quantityId":{"type":"string","minLength":1,"maxLength":300},"direction":{"type":"string","enum":["never-true-to-false","never-false-to-true","never-earlier","never-later"]}},"required":["kind","direction"],"additionalProperties":false}]},"expectHolds":{"type":"boolean"},"notes":{"type":"string","maxLength":10000},"tags":{"maxItems":50,"type":"array","items":{"type":"string","maxLength":100}},"source":{"description":"Expectation source; user-confirmed is a person’s act and is refused (422 trusted-record).","type":"string","enum":["user-authored","user-confirmed","ai-proposed","copied-from-formula","counterexample","feedback","imported"]}},"additionalProperties":false}},"required":["op","test","changes"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"removeTest"},"test":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}],"description":"An object by its stable ID ({ \"id\" }) or by its name ({ \"name\" })."}},"required":["op","test"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"replaceLogic"},"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{},"description":"A whole tangibool.logic/1 model."}},"required":["op","logic"],"additionalProperties":false}]}},"dryRun":{"default":false,"type":"boolean"},"draft":{"default":false,"type":"boolean"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["branch","expectedHead","edits"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dryRun":{"type":"boolean","const":true},"created":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["variable","quantity","formula","assumption","test","category","list","scale"],"x-extensible-enum":true},"name":{"type":"string"},"id":{"type":"string"}},"required":["kind","name","id"],"additionalProperties":false}},"diagnostics":{"type":"array","items":{"type":"object","properties":{"formulaId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"diagnostics":{"type":"array","items":{}}},"required":["formulaId","name","status","diagnostics"],"additionalProperties":{}}},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string"},"message":{"type":"string"}},"required":["severity","message"],"additionalProperties":{}}}},"required":["valid","issues"],"additionalProperties":{}},"outline":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.outline/1"},"mode":{"type":"string","enum":["decision","argument"]},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":["string","null"]}},"required":["id","name","definition"],"additionalProperties":{}}},"formulas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["output","premise","conclusion"]},"text":{"type":"string"}},"required":["id","name","role","text"],"additionalProperties":{}}},"tests":{"type":"object","properties":{"total":{"type":"number"},"confirmed":{"type":"number"}},"required":["total","confirmed"],"additionalProperties":{}},"source":{"type":"object","properties":{"interpretation":{"type":"string","enum":["not-needed","unconfirmed","confirmed","invalidated"]}},"required":["interpretation"],"additionalProperties":{}}},"required":["schema","mode","inputs","formulas","tests","source"],"additionalProperties":{}},"diff":{"anyOf":[{},{"type":"null"}]},"behaviour":{"anyOf":[{},{"type":"null"}]}},"required":["dryRun","created","diagnostics","validation","outline","diff","behaviour"],"additionalProperties":{}}}}},"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"head":{"type":"string","pattern":"^[0-9a-f]{64}$"},"previousHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"commit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"created":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["variable","quantity","formula","assumption","test","category","list","scale"],"x-extensible-enum":true},"name":{"type":"string"},"id":{"type":"string"}},"required":["kind","name","id"],"additionalProperties":false}},"diagnostics":{"type":"array","items":{"type":"object","properties":{"formulaId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"diagnostics":{"type":"array","items":{}}},"required":["formulaId","name","status","diagnostics"],"additionalProperties":{}}},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string"},"message":{"type":"string"}},"required":["severity","message"],"additionalProperties":{}}}},"required":["valid","issues"],"additionalProperties":{}},"dryRun":{"type":"boolean","const":false}},"required":["head","previousHead","commit","diagnostics","validation","dryRun"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden","branch-protected","proposal-branches-only"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","head-mismatch"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","invalid-change","invalid-logic","invalid-model","trusted-record","checks-failed","missing-objects","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/branches/{name}/snapshot":{"put":{"operationId":"putModelsByModelIdBranchesByNameSnapshot","summary":"Write a whole native snapshot to a branch; the server builds the revision (FR-34).","tags":["Edits"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"expectedHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"message":{"default":"","type":"string","maxLength":2000},"snapshot":{"type":"object","properties":{"artifacts":{"type":"object","propertyNames":{"type":"string","maxLength":300},"additionalProperties":{"type":"object","properties":{"id":{"type":"string","maxLength":300},"kind":{"type":"string","maxLength":40},"content":{}},"required":["id","kind","content"],"additionalProperties":false}}},"required":["artifacts"],"additionalProperties":false},"draft":{"default":false,"type":"boolean"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["expectedHead","snapshot"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"head":{"type":"string","pattern":"^[0-9a-f]{64}$"},"previousHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"commit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"parents":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"manifest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"committer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},"authoredAt":{"type":"string"},"receivedAt":{"type":"string","description":"ISO 8601, UTC."},"receivedBy":{"type":["string","null"]},"authorVerified":{"type":"boolean"},"imported":{"type":"boolean"},"message":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."}},"required":["id","parents","manifest","author","committer","authoredAt","receivedAt","receivedBy","authorVerified","imported","message","kind","state","via"],"additionalProperties":{}},"created":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["variable","quantity","formula","assumption","test","category","list","scale"],"x-extensible-enum":true},"name":{"type":"string"},"id":{"type":"string"}},"required":["kind","name","id"],"additionalProperties":false}},"diagnostics":{"type":"array","items":{"type":"object","properties":{"formulaId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"diagnostics":{"type":"array","items":{}}},"required":["formulaId","name","status","diagnostics"],"additionalProperties":{}}},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string"},"message":{"type":"string"}},"required":["severity","message"],"additionalProperties":{}}}},"required":["valid","issues"],"additionalProperties":{}}},"required":["head","previousHead","commit","diagnostics","validation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden","branch-protected","proposal-branches-only"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","head-mismatch"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","invalid-change","invalid-logic","invalid-model","trusted-record","checks-failed","missing-objects","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/branches":{"post":{"operationId":"postModelsByModelIdBranches","summary":"Create a branch.","tags":["Branches and tags"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"},"from":{"type":["string","null"]},"description":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["name"]}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"branch":{"type":"object","properties":{"name":{"type":"string"},"head":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"protected":{"type":"boolean"}},"required":["name","head","protected"],"additionalProperties":{}}},"required":["branch"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","branch-exists"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-ref-name"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/branches/{name}":{"delete":{"operationId":"deleteModelsByModelIdBranchesByName","summary":"Delete a branch (its commits stay reachable).","tags":["Branches and tags"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true},"head":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]}},"required":["deleted","head"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["default-branch"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/tags":{"post":{"operationId":"postModelsByModelIdTags","summary":"Create an ordinary tag. Approved baselines stay with a person (403 person-required).","tags":["Branches and tags"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"},"kind":{"type":"string","enum":["ordinary","approved-baseline"]},"message":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["name","target"]}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tag":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string","pattern":"^[0-9a-f]{64}$"},"kind":{"type":"string","enum":["ordinary","approved-baseline"]}},"required":["name","target","kind"],"additionalProperties":{}}},"required":["tag"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden","person-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","tag-exists"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-ref-name"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merges/preview":{"post":{"operationId":"postModelsByModelIdMergesPreview","summary":"Preview the merge of two branches with resolutions.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"resolutions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["ours","theirs","base","both"]}}},"required":["source","target"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sourceHead":{"type":"string","pattern":"^[0-9a-f]{64}$"},"targetHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"fastForward":{"type":"boolean"},"conflicts":{"type":"array","items":{}}},"required":["sourceHead","targetHead","fastForward","conflicts"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found","commit-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","compute-limit","empty-branch","missing-objects"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merges":{"post":{"operationId":"postModelsByModelIdMerges","summary":"Merge a branch; for a program the server builds the merge commit.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targetBranch":{"type":"string"},"sourceBranch":{"type":"string"},"expectedTargetHead":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$"},{"type":"null"}]},"expectedSourceHead":{"type":"string","pattern":"^[0-9a-f]{64}$"},"resolutions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["ours","theirs","base","both"]}},"mergeRequestId":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["targetBranch","sourceBranch","expectedTargetHead","expectedSourceHead"]}}}},"responses":{"200":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"merge":{"type":"object","properties":{"head":{"type":"string","pattern":"^[0-9a-f]{64}$"},"fastForward":{"type":"boolean"}},"required":["head","fastForward"],"additionalProperties":{}}},"required":["merge"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden","branch-protected","approval-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found","commit-not-found","merge-request-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","stale-merge","nothing-to-merge","not-fast-forward","fast-forward-disabled","merge-request-closed","head-mismatch"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","compute-limit","same-branch","unresolved-conflicts","merge-request-mismatch","invalid-merge-commit","checks-failed","missing-objects"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merge-requests":{"post":{"operationId":"postModelsByModelIdMergeRequests","summary":"Open a merge request (approval stays in the app).","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["title","sourceBranch","targetBranch"]}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mergeRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"state":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"}},"required":["id","number","state","sourceBranch","targetBranch"],"additionalProperties":{}}},"required":["mergeRequest"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","branch-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","same-branch"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"getModelsByModelIdMergeRequests","summary":"Merge requests, the newest first.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"description":"`open` by default.","type":"string","enum":["open","closed","merged","all"]}},{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; 500 without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mergeRequests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"state":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"}},"required":["id","number","state","sourceBranch","targetBranch"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["mergeRequests","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merge-requests/{mrId}":{"get":{"operationId":"getModelsByModelIdMergeRequestsByMrId","summary":"One merge request.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:read"]}],"x-required-scopes":["models:read"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"mrId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mergeRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"state":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"}},"required":["id","number","state","sourceBranch","targetBranch"],"additionalProperties":{}}},"required":["mergeRequest"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","merge-request-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merge-requests/{mrId}/close":{"post":{"operationId":"postModelsByModelIdMergeRequestsByMrIdClose","summary":"Close a merge request.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"mrId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mergeRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"state":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"}},"required":["id","number","state","sourceBranch","targetBranch"],"additionalProperties":{}}},"required":["mergeRequest"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","merge-request-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["merge-request-merged","no-change"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/merge-requests/{mrId}/reopen":{"post":{"operationId":"postModelsByModelIdMergeRequestsByMrIdReopen","summary":"Reopen a merge request.","tags":["Merges"],"security":[{"bearer":[]},{"oauth2":["models:write"]}],"x-required-scopes":["models:write"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"mrId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mergeRequest":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"state":{"type":"string"},"sourceBranch":{"type":"string"},"targetBranch":{"type":"string"}},"required":["id","number","state","sourceBranch","targetBranch"],"additionalProperties":{}}},"required":["mergeRequest"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","merge-request-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["merge-request-merged","no-change"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analyses":{"post":{"operationId":"postAnalyses","summary":"One exact check of a stored revision (or of a snapshot sent with the request).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string"},"snapshot":{},"query":{"type":"object","properties":{"kind":{"type":"string"}},"required":["kind"],"additionalProperties":{}},"crossCheck":{"type":"boolean"}},"required":["query"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"type":"object","properties":{"verdict":{"type":"string","enum":["holds","violated","unknown"]}},"required":["verdict"],"additionalProperties":{},"description":"Transport status is separate from the verdict: an exhausted budget is `unknown` with its reason, never an HTTP error."}},"required":["result"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["revision-not-found","not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","empty-branch","missing-objects","compute-limit","invalid-model"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/parse":{"post":{"operationId":"postLogicParse","summary":"Diagnostics with positions and repairs, the canonical text, and the literal reading (FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":20000},"context":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"language":{"type":"string","enum":["en","fr","de","es"]}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string"},"diagnostics":{"type":"array","items":{}},"canonicalText":{"type":["string","null"]}},"required":["status","diagnostics","canonicalText"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/evaluate":{"post":{"operationId":"postLogicEvaluate","summary":"Outputs and the evaluation trace of one case (FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"assignment":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"},"description":"Input values by input ID or name."},"language":{"type":"string","enum":["en","fr","de","es"]}},"required":["logic","assignment"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"complete":{"type":"boolean"},"formulas":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}}},"required":["complete","formulas"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/check":{"post":{"operationId":"postLogicCheck","summary":"One exact property of logic sent as text (FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"query":{"type":"object","properties":{"kind":{"type":"string","enum":["consistency","satisfiable","tautology","falsifiable","contradiction","equivalence","validity","premises-consistent"]},"formula":{"description":"The formula, by ID or name.","type":"string","minLength":1,"maxLength":300},"otherFormula":{"type":"string","minLength":1,"maxLength":300},"otherText":{"type":"string","maxLength":20000}},"required":["kind"],"additionalProperties":false}},"required":["logic","query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":{}},"description":"The inputs by ID and name: cases name inputs by ID, and logic sent as text has no IDs of its own."},"result":{"type":"object","properties":{"verdict":{"type":"string","enum":["holds","violated","unknown"]}},"required":["verdict"],"additionalProperties":{},"description":"Transport status is separate from the verdict: an exhausted budget is `unknown` with its reason, never an HTTP error."}},"required":["inputs","result"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/compare":{"post":{"operationId":"postLogicCompare","summary":"Equivalent, at least as strict, looser, or incomparable, with a replayed case for each direction that fails (FR-31, FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"a":{"type":"string","minLength":1,"maxLength":300,"description":"A formula by ID or name."},"b":{"type":"string","minLength":1,"maxLength":300}},"required":["logic","a","b"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"inputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":{}},"description":"The inputs by ID and name: cases name inputs by ID, and logic sent as text has no IDs of its own."},"result":{"type":"object","properties":{"relation":{"type":"string"},"aWithinB":{"type":"string","enum":["holds","violated","unknown"]},"bWithinA":{"type":"string","enum":["holds","violated","unknown"]}},"required":["relation","aWithinB","bWithinA"],"additionalProperties":{}}},"required":["inputs","result"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/truth-table":{"post":{"operationId":"postLogicTruthTable","summary":"One page of the truth table: row 0 is all FALSE and the first input is the most significant bit (FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"page":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"pageSize":{"default":256,"type":"integer","minimum":1,"maximum":1024}},"required":["logic"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"rowCount":{"type":"number"},"pages":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"inputs":{"type":"array","items":{"type":"boolean"}},"values":{"type":"array","items":{"type":"boolean"}}},"required":["row","inputs","values"],"additionalProperties":{}}}},"required":["rowCount","pages","rows"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit","limit-exceeded"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/reasons":{"post":{"operationId":"postLogicReasons","summary":"Why a case got its result: necessary conditions, ways to qualify, a reason, and the smallest changes (FR-30, FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"formula":{"type":"string","minLength":1,"maxLength":300},"value":{"type":"boolean"},"assignment":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":300},"additionalProperties":{"type":"boolean"},"description":"Input values by input ID or name."},"fixed":{"maxItems":64,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["logic","formula"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"necessary":{},"waysToQualify":{}},"required":["necessary","waysToQualify"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logic/code":{"post":{"operationId":"postLogicCode","summary":"Python, PostgreSQL, or SMT-LIB generated from logic sent with a request (FR-22, FR-35).","tags":["Analyses"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logic":{"anyOf":[{"type":"object","properties":{"text":{"type":"object","properties":{"mode":{"type":"string","enum":["decision","argument"]},"categories":{"description":"Categories with their values and lists (FR-26).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"minItems":1,"maxItems":2000,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}]},"description":"Its values in order: names (identifiers), or names with display labels."},"lists":{"description":"Named lists of its values, which membership tests and formulas use (`plan IN Paid`).","maxItems":500,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"values":{"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Values of the category, by name."}},"required":["name","values"],"additionalProperties":false}}},"required":["name","values"],"additionalProperties":false}},"scales":{"description":"Ordered scales with their levels (FR-27).","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"levels":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"Level labels, from the lowest to the highest."},"outside":{"description":"Values on no level, such as \"Not rated\": they meet no comparison.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["name","levels"],"additionalProperties":false}},"quantities":{"description":"What inputs are defined on, and what formulas test by name (`plan IN Paid`). A threshold on a quantity not listed here creates a number.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","enum":["integer","decimal","category","set","scale"],"description":"A number, one value of a category, a set of its values, or a level of a scale."},"category":{"description":"For `category` and `set`: the category, by name.","type":"string","minLength":1,"maxLength":200},"scale":{"description":"For `scale`: the scale, by name.","type":"string","minLength":1,"maxLength":200}},"required":["name","domain"],"additionalProperties":false}},"inputs":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"threshold":{"description":"A quantity compared with a number, or with a level of its scale (FR-25, FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"bound":{"type":"string","maxLength":40,"description":"A number; on a scale quantity, the label of a level."},"domain":{"description":"When the threshold creates its quantity: whole numbers or decimals (by default, as the bound is written).","type":"string","enum":["integer","decimal"]}},"required":["quantity","comparator","bound"],"additionalProperties":false},"membership":{"description":"A membership test (FR-26): `plan IN Paid`, `country IN {DE, FR}`, `activities HAS ANY Excluded`.","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200,"description":"A category or set-valued quantity, by name."},"test":{"description":"`in` on a category quantity (the default there); `any` (the default there), `all`, or `none` on a set-valued one.","type":"string","enum":["in","any","all","none"]},"values":{"description":"Values of the category, by name. Send these or `list`.","minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"list":{"description":"A list of the category, by name. Send this or `values`.","type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false},"comparison":{"description":"Two quantities on one scale compared, such as `product_risk <= client_risk` (FR-27); an outside value on either side makes it FALSE.","type":"object","properties":{"left":{"type":"string","minLength":1,"maxLength":200},"comparator":{"type":"string","enum":["<","<=",">",">="]},"right":{"type":"string","minLength":1,"maxLength":200}},"required":["left","comparator","right"],"additionalProperties":false},"rated":{"description":"The rated test of a scale quantity: TRUE when its value is a level rather than an outside value (FR-27).","type":"object","properties":{"quantity":{"type":"string","minLength":1,"maxLength":200}},"required":["quantity"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}},"formulas":{"description":"Outputs in decision mode; premises in argument mode.","maxItems":64,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":20000}},"required":["text"],"additionalProperties":false}},"conclusion":{"type":"string","maxLength":20000},"assumptions":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":20000},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["text"],"additionalProperties":false}}},"additionalProperties":false}},"required":["text"],"additionalProperties":false},{"type":"object","properties":{"logic":{"type":"object","properties":{"schema":{"type":"string","const":"tangibool.logic/1"}},"required":["schema"],"additionalProperties":{}}},"required":["logic"],"additionalProperties":false}]},"target":{"type":"string","enum":["python","postgresql","smt-lib"]}},"required":["logic","target"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"logicDigest":{"type":"string"},"engineVersion":{"type":"string"},"semanticsVersion":{"type":"string"},"target":{"type":"string","enum":["python","postgresql","smt-lib"]},"code":{"type":"string"},"provenance":{"type":"string"}},"required":["target","code","provenance"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","consent-required"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","invalid-model","invalid-change","unknown-formula","unknown-input","compute-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["compute-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test-runs":{"post":{"operationId":"postTestRuns","summary":"Run the saved tests of a revision.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=25"]},"description":"`wait=<seconds>` (RFC 7240), at most 25: wait for the job and answer `200` with the finished operation when it ends in time."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string","description":"A branch, a tag, or a commit ID."},"options":{"description":"The options of a test-run job.","type":"object","properties":{"testIds":{"maxItems":1000,"type":"array","items":{"type":"string","maxLength":200}},"budgetMs":{"type":"integer","minimum":100,"maximum":60000},"perQueryBudgetMs":{"type":"integer","minimum":10,"maximum":10000}},"additionalProperties":false},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["modelId","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"The job ended within the time asked for with `Prefer: wait`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"202":{"description":"Accepted: the job runs in the background. Read it at `GET /v1/operations/{operationId}`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-model","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","too-many-operations","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["jobs-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test-runs/{operationId}":{"get":{"operationId":"getTestRunsByOperationId","summary":"A test run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteTestRunsByOperationId","summary":"Cancel a test run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/coverage-runs":{"post":{"operationId":"postCoverageRuns","summary":"Coverage of a revision’s tests.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=25"]},"description":"`wait=<seconds>` (RFC 7240), at most 25: wait for the job and answer `200` with the finished operation when it ends in time."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string","description":"A branch, a tag, or a commit ID."},"options":{"description":"The options of a coverage-run job.","type":"object","properties":{"includeExploratory":{"type":"boolean"},"budgetMs":{"type":"integer","minimum":100,"maximum":60000},"perQueryBudgetMs":{"type":"integer","minimum":10,"maximum":10000}},"additionalProperties":false},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["modelId","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"The job ended within the time asked for with `Prefer: wait`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"202":{"description":"Accepted: the job runs in the background. Read it at `GET /v1/operations/{operationId}`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-model","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","too-many-operations","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["jobs-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/coverage-runs/{operationId}":{"get":{"operationId":"getCoverageRunsByOperationId","summary":"A coverage run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteCoverageRunsByOperationId","summary":"Cancel a coverage run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/mutation-runs":{"post":{"operationId":"postMutationRuns","summary":"Mutation testing of a revision.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=25"]},"description":"`wait=<seconds>` (RFC 7240), at most 25: wait for the job and answer `200` with the finished operation when it ends in time."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string","description":"A branch, a tag, or a commit ID."},"options":{"description":"The options of a mutation-run job.","type":"object","properties":{"seed":{"type":"integer","minimum":0,"maximum":2147483647},"maxMutants":{"type":"integer","minimum":1,"maximum":500},"operators":{"minItems":1,"maxItems":22,"type":"array","items":{"type":"string","enum":["and-or-swap","xor-or-swap","xor-xnor-swap","implication-reversal","negation-removal","operand-removal","negation-insertion","constant-replacement","input-substitution","threshold-comparator","threshold-bound","count-bound","count-kind","list-member","list-substitution","scale-comparison","points-cutoff","points-weight","points-row-removal","outcome-swap","row-removal","row-order"]}},"independentOnly":{"type":"boolean"},"budgetMs":{"type":"integer","minimum":100,"maximum":30000},"perQueryBudgetMs":{"type":"integer","minimum":10,"maximum":10000}},"additionalProperties":false},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["modelId","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"The job ended within the time asked for with `Prefer: wait`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"202":{"description":"Accepted: the job runs in the background. Read it at `GET /v1/operations/{operationId}`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-model","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","too-many-operations","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["jobs-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/mutation-runs/{operationId}":{"get":{"operationId":"getMutationRunsByOperationId","summary":"A mutation run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteMutationRunsByOperationId","summary":"Cancel a mutation run.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses"]}],"x-required-scopes":["analyses"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operations/{operationId}":{"get":{"operationId":"getOperationsByOperationId","summary":"Status and result of any job.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses","exports"]}],"x-required-scopes":["analyses","exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteOperationsByOperationId","summary":"Cancel any job.","tags":["Jobs"],"security":[{"bearer":[]},{"oauth2":["analyses","exports"]}],"x-required-scopes":["analyses","exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/exports":{"post":{"operationId":"postExports","summary":"Export a revision (snapshot export).","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=25"]},"description":"`wait=<seconds>` (RFC 7240), at most 25: wait for the job and answer `200` with the finished operation when it ends in time."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string","description":"A branch, a tag, or a commit ID."},"options":{"type":"object","properties":{"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["model-report","source","glossary","formulas","explanation","truth-table","tests","test-report","diagram","formula-card","kmap","strictness-map","venn","mapping-diagram","notes","discussion","snapshot"]},"format":{"type":"string","enum":["md","txt","py","json","sql","tex","smt2","png","jpg","jpeg","csv","svg","xml"]},"options":{"type":"object","properties":{"formulaId":{"type":"string","maxLength":200},"noteIds":{"maxItems":1000,"type":"array","items":{"type":"string","maxLength":300}},"rowsPerPage":{"type":"integer","minimum":4,"maximum":256},"intermediateColumns":{"type":"boolean"},"fragment":{"type":"boolean"},"includeGetModel":{"type":"boolean"},"includePropertyTests":{"type":"boolean"},"ruleIds":{"minItems":2,"maxItems":12,"type":"array","items":{"type":"string","maxLength":200}},"listIds":{"minItems":2,"maxItems":3,"type":"array","items":{"type":"string","maxLength":200}},"quantityId":{"type":"string","maxLength":200},"mappingId":{"type":"string","maxLength":200}},"additionalProperties":false}},"required":["target","format"],"additionalProperties":false}},"theme":{"default":"light","type":"string","enum":["light","dark"]},"scale":{"default":2,"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":4}]},"width":{"type":"integer","minimum":16,"maximum":8192},"background":{"type":"string","pattern":"^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$"},"jpegQuality":{"default":90,"type":"integer","minimum":1,"maximum":100},"transparent":{"default":false,"type":"boolean"},"cleanImage":{"default":false,"type":"boolean"},"asciiOperators":{"default":false,"type":"boolean"},"notation":{"type":"string","enum":["words","programming","mathematical","algebra"]},"level":{"default":"intermediate","type":"string","enum":["beginner","intermediate","advanced"]},"archive":{"default":true,"type":"boolean"}},"required":["items"],"additionalProperties":false,"description":"The options of a export job."},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["modelId","revision","options"],"additionalProperties":false}}}},"responses":{"200":{"description":"The job ended within the time asked for with `Prefer: wait`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"202":{"description":"Accepted: the job runs in the background. Read it at `GET /v1/operations/{operationId}`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-model","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","too-many-operations","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["jobs-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/exports/{operationId}":{"get":{"operationId":"getExportsByOperationId","summary":"An export.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteExportsByOperationId","summary":"Cancel an export.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/exports/{operationId}/download":{"get":{"operationId":"getExportsByOperationIdDownload","summary":"Download an export package.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","no-download"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["not-ready"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/history-exports":{"post":{"operationId":"postHistoryExports","summary":"Export the full history.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","examples":["wait=25"]},"description":"`wait=<seconds>` (RFC 7240), at most 25: wait for the job and answer `200` with the finished operation when it ends in time."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string"},"revision":{"type":"string","description":"A branch, a tag, or a commit ID."},"options":{"description":"The options of a history-export job.","type":"object","properties":{"branches":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"items":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["history","history-summary","history-graph","visual-diff"]},"format":{"type":"string","enum":["md","txt","py","json","sql","tex","smt2","png","jpg","jpeg","csv","svg","xml"]},"options":{"type":"object","properties":{"historyLimit":{"type":"integer","minimum":1,"maximum":100000},"compareCommit":{"type":"string","pattern":"^[0-9a-f]{64}$"},"rowsPerPage":{"type":"integer","minimum":4,"maximum":256},"fragment":{"type":"boolean"}},"additionalProperties":false}},"required":["target","format"],"additionalProperties":false}},"theme":{"default":"light","type":"string","enum":["light","dark"]},"scale":{"default":2,"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":4}]},"width":{"type":"integer","minimum":16,"maximum":8192},"background":{"type":"string","pattern":"^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$"},"jpegQuality":{"default":90,"type":"integer","minimum":1,"maximum":100},"transparent":{"default":false,"type":"boolean"},"cleanImage":{"default":false,"type":"boolean"},"asciiOperators":{"default":false,"type":"boolean"},"notation":{"type":"string","enum":["words","programming","mathematical","algebra"]},"level":{"default":"intermediate","type":"string","enum":["beginner","intermediate","advanced"]}},"additionalProperties":false},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["modelId","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"The job ended within the time asked for with `Prefer: wait`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"202":{"description":"Accepted: the job runs in the background. Read it at `GET /v1/operations/{operationId}`.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"A limit of the plan of the account the model counts toward (`plan-limit`). Do not retry it automatically.","x-error-codes":["plan-limit"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","revision-not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","empty-branch","missing-objects","invalid-model","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited","too-many-operations","compute-quota"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The server is busy (`compute-busy`, `jobs-busy`), with `Retry-After`.","x-error-codes":["jobs-busy"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/history-exports/{operationId}":{"get":{"operationId":"getHistoryExportsByOperationId","summary":"A history export.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteHistoryExportsByOperationId","summary":"Cancel a history export.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","timed-out"],"x-extensible-enum":true},"modelId":{"type":"string"},"requestedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name"],"additionalProperties":{}},{"type":"null"}]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["token","app","assistant"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["kind","id","name"],"additionalProperties":false},{"type":"null"}],"description":"The token, app, or assistant a program acted through; null for changes made in the app."},"createdAt":{"type":"string","description":"ISO 8601, UTC."},"finishedAt":{"anyOf":[{"type":"string","description":"ISO 8601, UTC."},{"type":"null"}]}},"required":["id","kind","status","modelId","requestedBy","via","createdAt","finishedAt"],"additionalProperties":{}}},"required":["operation"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/history-exports/{operationId}/download":{"get":{"operationId":"getHistoryExportsByOperationIdDownload","summary":"Download a history package.","tags":["Exports"],"security":[{"bearer":[]},{"oauth2":["exports"]}],"x-required-scopes":["exports"],"parameters":[{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found","no-download"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["not-ready"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/threads":{"get":{"operationId":"getModelsByModelIdThreads","summary":"Discussion threads of a model, the newest first.","tags":["Discussion"],"security":[{"bearer":[]},{"oauth2":["discussion"]}],"x-required-scopes":["discussion"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"description":"`all` by default.","type":"string","enum":["open","resolved","all"]}},{"name":"include","in":"query","required":false,"schema":{"description":"`messages` adds the messages and events of the threads on the page.","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 1000; every thread without it.","type":"integer","minimum":1,"maximum":1000}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["open","resolved"]}},"required":["id","title","state"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["threads","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postModelsByModelIdThreads","summary":"Start a thread.","tags":["Discussion"],"security":[{"bearer":[]},{"oauth2":["discussion"]}],"x-required-scopes":["discussion"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"anchor":{},"label":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["body"],"additionalProperties":{}}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["open","resolved"]}},"required":["id","title","state"],"additionalProperties":{}}},"required":["thread"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","limit-exceeded","anchor-too-large","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/threads/{threadId}":{"get":{"operationId":"getThreadsByThreadId","summary":"A thread with its messages.","tags":["Discussion"],"security":[{"bearer":[]},{"oauth2":["discussion"]}],"x-required-scopes":["discussion"],"parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["open","resolved"]}},"required":["id","title","state"],"additionalProperties":{}}},"required":["thread"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/threads/{threadId}/messages":{"post":{"operationId":"postThreadsByThreadIdMessages","summary":"Reply in a thread.","tags":["Discussion"],"security":[{"bearer":[]},{"oauth2":["discussion"]}],"x-required-scopes":["discussion"],"parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string"},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["body"],"additionalProperties":{}}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"}},"required":["id","body"],"additionalProperties":{}}},"required":["message"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","limit-exceeded","invalid-parent","unsupported-content"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/webhooks":{"get":{"operationId":"getModelsByModelIdWebhooks","summary":"Webhook subscriptions of a model, the oldest first.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; every subscription without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"paused":{"type":"boolean"}},"required":["id","url","events","paused"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["webhooks","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postModelsByModelIdWebhooks","summary":"Subscribe to a model’s events; the signing secret is shown once, and again only to a retry with the same idempotency key (FR-38).","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"modelId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"paused":{"type":"boolean"}},"required":["id","url","events","paused"],"additionalProperties":{}},"secret":{"type":"string"}},"required":["webhook","secret"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","too-many-webhooks"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","invalid-webhook-url"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{teamId}/webhooks":{"get":{"operationId":"getTeamsByTeamIdWebhooks","summary":"Webhook subscriptions of a team, the oldest first.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; every subscription without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"paused":{"type":"boolean"}},"required":["id","url","events","paused"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["webhooks","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"postTeamsByTeamIdWebhooks","summary":"Subscribe to a team’s events; the signing secret is shown once, and again only to a retry with the same idempotency key (FR-38).","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"},"description":"Makes the create safe to retry. For 24 hours, a retry of the same request with the same key gets the first answer again, with `Idempotent-Replayed: true` (for a thread or a message: what it created as it is now, for as long as the message exists). The same key with another request is `422 idempotency-key-reused`, and a retry while the first is still running `409 request-in-progress`; a failed attempt leaves no record. Keys are per user, and per model or team on their routes. The body field `idempotencyKey` is the same key; when both are sent they must agree."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"idempotencyKey":{"description":"The Idempotency-Key header as a body field; when both are sent they must agree.","type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7e]+$"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Success.","headers":{"Idempotent-Replayed":{"description":"`true` when this is the first answer to the same request with the same idempotency key, replayed.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"paused":{"type":"boolean"}},"required":["id","url","events","paused"],"additionalProperties":{}},"secret":{"type":"string"}},"required":["webhook","secret"],"additionalProperties":{}}}}},"400":{"description":"The body is not valid JSON (`invalid-json`).","x-error-codes":["invalid-json"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","x-error-codes":["request-in-progress","too-many-webhooks"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is larger than this route’s limit (`payload-too-large`).","x-error-codes":["payload-too-large"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Send the body as `application/json` (`unsupported-media-type`).","x-error-codes":["unsupported-media-type"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request","idempotency-key-reused","idempotency-key-mismatch","invalid-webhook-url"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{webhookId}":{"delete":{"operationId":"deleteWebhooksByWebhookId","summary":"Delete a webhook subscription.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{webhookId}/deliveries":{"get":{"operationId":"getWebhooksByWebhookIdDeliveries","summary":"Deliveries of the last 7 days, the newest first.","tags":["Webhooks"],"security":[{"bearer":[]},{"oauth2":["webhooks"]}],"x-required-scopes":["webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"description":"Rows on a page, at most 500; 200 without it.","type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"description":"The `nextCursor` of the previous page. Opaque.","type":"string","maxLength":1000}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"status":{"type":"string"}},"required":["id","event","status"],"additionalProperties":{}}},"nextCursor":{"description":"The cursor of the next page, in the same order; null on the last page.","type":["string","null"]}},"required":["deliveries","nextCursor"],"additionalProperties":{}}}}},"401":{"description":"No valid credential (`WWW-Authenticate: Bearer`).","x-error-codes":["unauthenticated"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient-scope`, `session-required`, `person-required`, or a role that does not allow the action.","x-error-codes":["insufficient-scope","forbidden"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, not visible to the user, outside the token’s limit, or not part of the public API.","x-error-codes":["not-found"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`head-mismatch` and other preconditions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request (`invalid-request`, `invalid-change`, `invalid-logic`, `trusted-record`, …).","x-error-codes":["invalid-request"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate-limited`, `compute-quota`, or `too-many-operations`, with `Retry-After`.","x-error-codes":["rate-limited"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Every error: a stable code, a message for people, optional details."}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A personal access token (`tb_pat_…`) made in the app, or an OAuth access token."},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://app.tangibool.com/oauth/authorize","tokenUrl":"https://app.tangibool.com/oauth/token","scopes":{"models:read":"The models:read scope.","models:write":"The models:write scope.","analyses":"The analyses scope.","exports":"The exports scope.","discussion":"The discussion scope.","webhooks":"The webhooks scope."}}}}}}}