{"openapi":"3.1.0","info":{"title":"Scanro API","version":"0.1.0","description":"Every request sends Scanro-Protocol: 1. Fixture responses carry provider \"fixture\"."},"components":{"securitySchemes":{"FirebaseIdToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"LabToken":{"type":"http","scheme":"bearer"}},"schemas":{},"parameters":{}},"paths":{"/healthz":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"providers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["ok","providers"]}}}}}}},"/lab/reports":{"post":{"security":[{"LabToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[1]},"runId":{"type":"string","pattern":"^[A-Z0-9]{6,12}$"},"experiment":{"type":"string"},"build":{"type":"object","properties":{"appVersion":{"type":"string"},"buildNumber":{"type":"string"},"gitSha":{"type":"string"},"flavor":{"type":"string","enum":["lab","store"]},"mode":{"type":"string","enum":["debug","profile","release"]}},"required":["appVersion","buildNumber","gitSha","flavor","mode"]},"device":{"type":"object","properties":{"platform":{"type":"string","enum":["ios","android"]},"model":{"type":"string"},"osVersion":{"type":"string"},"webViewVersion":{"type":["string","null"]}},"required":["platform","model","osVersion","webViewVersion"]},"network":{"type":["string","null"]},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"t":{"type":"number"},"ok":{"type":["boolean","null"]},"data":{"type":"object","additionalProperties":{}}},"required":["name","t","ok","data"]}},"metrics":{"type":"object","additionalProperties":{"type":"number"}},"verdict":{"type":"string","enum":["pass","fail","blocked","inconclusive","aborted"]},"note":{"type":["string","null"],"maxLength":2000},"errors":{"type":"array","items":{"type":"string"}},"console":{"type":"array","items":{"type":"string"}},"recoveredFromJournal":{"type":"boolean"}},"required":["schemaVersion","runId","experiment","build","device","network","startedAt","finishedAt","steps","metrics","verdict","errors","console","recoveredFromJournal"]}}}},"responses":{"201":{"description":"Stored","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"runId":{"type":"string"},"key":{"type":"string"},"store":{"type":"string"}},"required":["accepted","runId","key","store"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/lab/manifest":{"get":{"security":[{"LabToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/lab/scripts/{file}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"file","in":"path"}],"responses":{"200":{"description":"Script","content":{"application/javascript":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/lab/runs/{runId}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Z0-9]{6,12}$"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"reports":{"type":"array","items":{}}},"required":["runId","reports"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Not the owner","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/lab/dashboard":{"get":{"security":[{"FirebaseIdToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Not the owner","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/scenes":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[1]},"snapshotRevision":{"type":"integer","minimum":0},"documentId":{"type":"string"},"capturedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"scan":{"type":"object","properties":{"entryId":{"type":"string"},"rawValueRef":{"type":"string"},"contentClass":{"type":"string","enum":["web_https","web_http","payment_emv","payment_link","wifi","vcard","tel","sms","email","geo","app_link","blocked","text"]},"format":{"type":"string"},"source":{"type":"string","enum":["camera","gallery","manual","share","open_with","paste"]},"scannedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"redirectHosts":{"type":"array","items":{"type":"string"}},"finalHost":{"type":"string"},"registrableDomain":{"type":"string"}},"required":["entryId","rawValueRef","contentClass","format","source","scannedAt","redirectHosts"]},"context":{"type":"object","properties":{"taskId":{"type":"string"},"sceneType":{"type":"string","enum":["dining","guide","booking","coupon","unknown"]},"brandId":{"type":"string"},"venueId":{"type":"string"},"serviceObjectHash":{"type":"string"},"language":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"sessionId":{"type":"string"},"platform":{"type":"string"},"platformAuthorised":{"type":"boolean"}},"required":["taskId","sceneType","language","sessionId","platformAuthorised"]},"entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"attributes":{"type":"object","additionalProperties":{}},"relations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"targetId":{"type":"string"}},"required":["type","targetId"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}}},"required":["id","type","name","attributes","relations","evidence"]}},"states":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string"},"key":{"type":"string"},"value":{},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"validUntil":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"revision":{"type":"integer","minimum":0}},"required":["entityId","key","observedAt","revision"]}},"actions":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string"},"semantic":{"type":"string","enum":["add_to_cart","remove_from_cart","set_quantity","choose_option","open_item","open_cart","submit_order","open_category","load_more","login","pay","claim_coupon","book","navigate"]},"targetEntityId":{"type":"string"},"inputSchema":{"type":"object","additionalProperties":{}},"preconditions":{"type":"array","items":{"type":"string"}},"bindingRef":{"type":"string"},"impact":{"type":"string","enum":["read","local_change","external_commit"]},"requiresConfirmation":{"type":"boolean"},"postconditions":{"type":"array","items":{"type":"string"}},"capability":{"type":"string","enum":["discovered","verified","unavailable"]}},"required":["actionId","semantic","preconditions","impact","requiresConfirmation","postconditions","capability"]}},"constraints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"appliesTo":{"type":"string"},"kind":{"type":"string","enum":["required","choice_count","quantity","time","amount","user_limit"]},"min":{"type":"number"},"max":{"type":"number"},"values":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["merchant","user","platform","inferred"]}},"required":["id","appliesTo","kind","source"]}},"coverage":{"type":"object","properties":{"status":{"type":"string","enum":["complete","partial","unknown"]},"categoriesSeen":{"type":"integer","minimum":0},"categoriesLoaded":{"type":"integer","minimum":0},"paginationDone":{"type":"boolean"},"unopenedOptionDialogs":{"type":"integer","minimum":0},"missingFields":{"type":"array","items":{"type":"string"}},"opaqueFrames":{"type":"integer","minimum":0},"transportUnknown":{"type":"boolean"},"sources":{"type":"array","items":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]}}},"required":["status","categoriesSeen","categoriesLoaded","paginationDone","unopenedOptionDialogs","missingFields","opaqueFrames","transportUnknown","sources"]},"extensions":{"type":"object","properties":{"dining/v1":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"loaded":{"type":"boolean"},"itemCount":{"type":"integer"}},"required":["id","name","loaded"]}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"categoryId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"kind":{"type":"string","enum":["food","drink","other","unknown"]},"price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"soldOut":{"type":"boolean"},"optionGroups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"},"minChoices":{"type":"integer","minimum":0},"maxChoices":{"type":"integer","exclusiveMinimum":0},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priceDelta":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"soldOut":{"type":"boolean"},"allergens":{"type":"array","items":{"type":"object","properties":{"allergen":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]},"state":{"type":"string","enum":["declared_contains","declared_may_contain","ai_estimated_may_contain","not_declared"]},"evidence":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}},"required":["allergen","state","evidence"]}}},"required":["id","name","priceDelta","soldOut","allergens"]}},"complete":{"type":"boolean"}},"required":["id","name","required","minChoices","maxChoices","options","complete"]}},"allergens":{"type":"array","items":{"type":"object","properties":{"allergen":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]},"state":{"type":"string","enum":["declared_contains","declared_may_contain","ai_estimated_may_contain","not_declared"]},"evidence":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}},"required":["allergen","state","evidence"]}},"halal":{"type":"object","properties":{"state":{"type":"string","enum":["muis_certified","merchant_claimed","unknown"]},"evidence":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}},"required":["state","evidence"]},"diet":{"type":"object","additionalProperties":{"type":"string","enum":["declared","claimed","unknown"]}},"alcohol":{"type":"object","properties":{"state":{"type":"string","enum":["alcoholic","non_alcoholic","unknown"]},"evidence":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}},"required":["state","evidence"]},"nutriGrade":{"type":"string","enum":["A","B","C","D"]},"imageRef":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}}},"required":["id","categoryId","name","kind","price","soldOut","optionGroups","allergens","halal","diet","alcohol","evidence"]}},"cart":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"lineKey":{"type":"string"},"itemId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","exclusiveMinimum":0},"optionIds":{"type":"array","items":{"type":"string"}},"unitPrice":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"lineTotal":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"owner":{"type":"string","enum":["scanro","manual","preexisting"]},"subject":{"type":"string","enum":["self","companion","unknown"]},"shared":{"type":"boolean"}},"required":["lineKey","itemId","name","quantity","optionIds","unitPrice","lineTotal","owner","subject","shared"]}},"subtotal":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"fees":{"type":"object","properties":{"serviceChargeBp":{"type":"integer","minimum":0},"gstBp":{"type":"integer","minimum":0},"pending":{"type":"boolean"}},"required":["pending"]},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"observedAt":{"type":"string"}},"required":["lines","subtotal","fees","observedAt"]},"paymentMode":{"type":"string","enum":["pay_first","pay_later","pay_at_counter","unknown"]},"tableLabel":{"type":"string"},"minimumSpend":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"orderStatus":{"type":"object","properties":{"orderRef":{"type":"string"},"status":{"type":"string"},"observedAt":{"type":"string"}},"required":["orderRef","status","observedAt"]}},"required":["categories","items","paymentMode"]},"guide/v1":{"type":"object","properties":{"venueName":{"type":"string"},"exhibits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"location":{"type":"string"},"summary":{"type":"string"},"audioRef":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["fact","inference","unknown"]},"source":{"type":"string","enum":["network_json","dom","aria","ocr","model","user","merchant_claim","api"]},"observedAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ref":{"type":"string","maxLength":200},"basis":{"type":"string","maxLength":300}},"required":["kind","source","observedAt"]}}},"required":["id","title","evidence"]}},"languages":{"type":"array","items":{"type":"string"}}},"required":["venueName","exhibits","languages"]}},"additionalProperties":{}}},"required":["schemaVersion","snapshotRevision","documentId","capturedAt","scan","context","entities","states","actions","constraints","coverage","extensions"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"documentId":{"type":"string"},"snapshotRevision":{"type":"integer"},"brandId":{"type":["string","null"]},"venueId":{"type":["string","null"]},"contactPoints":{"type":"object","properties":{"public":{"type":"integer"},"withheld":{"type":"integer"}},"required":["public","withheld"]},"serviceEndpoints":{"type":"integer"},"venueMatchCandidates":{"type":"integer"},"userVenueRelationUpdated":{"type":"boolean"}},"required":["accepted","documentId","snapshotRevision","brandId","venueId","contactPoints","serviceEndpoints","venueMatchCandidates","userVenueRelationUpdated"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/annotations":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetLanguage":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"category":{"type":"string"}},"required":["itemId","name","description","category"]},"maxItems":400},"merchantId":{"type":["string","null"],"maxLength":128},"platformAuthorised":{"type":"boolean"},"taskId":{"type":["string","null"],"maxLength":128}},"required":["targetLanguage","items","merchantId","platformAuthorised","taskId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"annotations":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"translatedName":{"type":["string","null"]},"explanation":{"type":["string","null"]},"estimatedAllergens":{"type":"array","items":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]}},"likelyAlcoholic":{"type":["boolean","null"]}},"required":["itemId","translatedName","explanation","estimatedAllergens","likelyAlcoholic"]}},"provider":{"type":"string"},"model":{"type":"string"},"cached":{"type":"boolean"},"menuHash":{"type":"string"},"dropped":{"type":"integer"}},"required":["annotations","provider","model","cached","menuHash","dropped"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/menu/from-image":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetLanguage":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"currencyHint":{"type":"string"},"taskId":{"type":["string","null"],"maxLength":128},"image":{"type":"object","properties":{"mediaType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]},"data":{"type":"string","minLength":16,"maxLength":8388608,"pattern":"^[A-Za-z0-9+/=]+$"}},"required":["mediaType","data"]}},"required":["targetLanguage","currencyHint","taskId","image"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"isMenu":{"type":"boolean"},"currency":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"translatedName":{"type":["string","null"]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"priceMinor":{"type":["integer","null"]},"printedAllergens":{"type":"array","items":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]}},"photo":{"type":["object","null"],"properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"drink":{"type":["boolean","null"]},"alcoholic":{"type":["boolean","null"]}},"required":["name","translatedName","description","category","priceMinor","printedAllergens","photo"]}},"provider":{"type":"string"},"model":{"type":"string"}},"required":["isMenu","currency","items","provider","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/menu/photo/{fingerprint}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"required":true,"name":"fingerprint","in":"path"},{"schema":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"required":true,"name":"language","in":"query"},{"schema":{"type":"string","enum":["direct1","direct2","direct3","page_data","page_img","shot","variant","given"]},"required":false,"name":"src","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tiles":{"type":"array","items":{"type":["object","null"],"properties":{"isMenu":{"type":"boolean"},"currency":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"translatedName":{"type":["string","null"]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"priceMinor":{"type":["integer","null"]},"printedAllergens":{"type":"array","items":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]}},"photo":{"type":["object","null"],"properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"drink":{"type":["boolean","null"]},"alcoholic":{"type":["boolean","null"]}},"required":["name","translatedName","description","category","priceMinor","printedAllergens","photo"]}}},"required":["isMenu","currency","items"]}},"complete":{"type":"boolean"},"cached":{"type":"boolean"},"provider":{"type":"string"},"model":{"type":"string"}},"required":["tiles","complete","cached","provider","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/menu/photo":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetLanguage":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"currencyHint":{"type":"string"},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"aliases":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{64}$"},"maxItems":3},"src":{"type":"string","enum":["direct1","direct2","direct3","page_data","page_img","shot","variant","given"]},"taskId":{"type":["string","null"],"maxLength":128},"tiles":{"type":"array","items":{"type":"object","properties":{"mediaType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]},"data":{"type":"string","minLength":16,"maxLength":8388608,"pattern":"^[A-Za-z0-9+/=]+$"}},"required":["mediaType","data"]},"minItems":1,"maxItems":12}},"required":["targetLanguage","currencyHint","fingerprint","taskId","tiles"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tiles":{"type":"array","items":{"type":["object","null"],"properties":{"isMenu":{"type":"boolean"},"currency":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"translatedName":{"type":["string","null"]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"priceMinor":{"type":["integer","null"]},"printedAllergens":{"type":"array","items":{"type":"string","enum":["peanut","tree_nut","milk","egg","fish","shellfish","crustacean","mollusc","soy","wheat","gluten","sesame","mustard","celery","lupin","sulphite"]}},"photo":{"type":["object","null"],"properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"drink":{"type":["boolean","null"]},"alcoholic":{"type":["boolean","null"]}},"required":["name","translatedName","description","category","priceMinor","printedAllergens","photo"]}}},"required":["isMenu","currency","items"]}},"complete":{"type":"boolean"},"cached":{"type":"boolean"},"provider":{"type":"string"},"model":{"type":"string"}},"required":["tiles","complete","cached","provider","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/recommendations":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"partySize":{"type":"integer","exclusiveMinimum":0},"budgetMinor":{"type":["integer","null"]},"currency":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"priceMinor":{"type":"integer"},"requiredOptionGroups":{"type":"array","items":{"type":"object","properties":{"groupId":{"type":"string"},"allowedOptionIds":{"type":"array","items":{"type":"string"}},"minChoices":{"type":"integer"}},"required":["groupId","allowedOptionIds","minChoices"]}}},"required":["itemId","name","category","priceMinor","requiredOptionGroups"]},"maxItems":400},"softPreferences":{"type":"array","items":{"type":"string"},"maxItems":20},"userText":{"type":["string","null"],"maxLength":500},"taskId":{"type":"string","minLength":1,"maxLength":128},"sessionId":{"type":"string","minLength":1,"maxLength":128},"snapshotRevision":{"type":"integer","minimum":0},"controlEpoch":{"type":"integer","minimum":0},"planVersion":{"type":"integer","minimum":0}},"required":["language","partySize","budgetMinor","currency","candidates","softPreferences","userText","taskId","sessionId","snapshotRevision","controlEpoch","planVersion"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string"},"sessionId":{"type":"string"},"snapshotRevision":{"type":"integer"},"controlEpoch":{"type":"integer"},"planVersion":{"type":"integer"},"provider":{"type":"string"},"model":{"type":"string"},"latencyMs":{"type":"integer"},"proposal":{"type":"object","properties":{"combos":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"optionIds":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"}},"required":["itemId","optionIds","quantity"]}},"userNote":{"type":"string"}},"required":["title","lines","userNote"]}}},"required":["combos"]}},"required":["taskId","sessionId","snapshotRevision","controlEpoch","planVersion","provider","model","latencyMs","proposal"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/tweaks":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string","minLength":1,"maxLength":128},"language":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"text":{"type":"string","minLength":1,"maxLength":500},"currentLines":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","exclusiveMinimum":0}},"required":["itemId","name","quantity"]},"maxItems":50},"candidates":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"}},"required":["itemId","name","category"]},"maxItems":400}},"required":["taskId","language","text","currentLines","candidates"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"adjustments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["replace_item","remove_item","add_item","change_quantity","set_budget","less_spicy","more_spicy","cheaper","other"]},"itemId":{"type":["string","null"]},"value":{"type":["string","null"]}},"required":["kind","itemId","value"]}},"provider":{"type":"string"},"model":{"type":"string"},"dropped":{"type":"integer"}},"required":["adjustments","provider","model","dropped"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/decide":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string"},"candidates":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"label":{"type":"string"},"role":{"type":"string"},"context":{"type":"string"}},"required":["index","label","role","context"]},"maxItems":255},"pageKind":{"type":["string","null"],"enum":["menu","item_detail","cart","checkout","login","captcha","payment","order_status","error","other",null]},"questionFromUser":{"type":"boolean","default":false},"taskId":{"type":["string","null"],"maxLength":128},"snapshotRevision":{"type":["integer","null"],"minimum":0},"controlEpoch":{"type":["integer","null"],"minimum":0}},"required":["question","candidates","pageKind","taskId","snapshotRevision","controlEpoch"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"candidateIndex":{"type":["integer","null"]},"probability":{"type":["number","null"]},"provider":{"type":"string"},"model":{"type":"string"},"latencyMs":{"type":"integer"},"taskId":{"type":["string","null"]},"snapshotRevision":{"type":["integer","null"]},"controlEpoch":{"type":["integer","null"]}},"required":["candidateIndex","probability","provider","model","latencyMs","taskId","snapshotRevision","controlEpoch"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/page-kind":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"headings":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":30},"controls":{"type":"array","items":{"type":"string","maxLength":80},"maxItems":60},"hasPasswordField":{"type":"boolean"},"hasCardField":{"type":"boolean"}},"required":["title","headings","controls","hasPasswordField","hasCardField"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["menu","item_detail","cart","checkout","login","captcha","payment","order_status","error","other"]},"probability":{"type":["number","null"]},"provider":{"type":"string"},"model":{"type":"string"}},"required":["kind","probability","provider","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/page-suggestions/cached":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":20},"host":{"type":"string","maxLength":253},"path":{"type":"string","maxLength":200}},"required":["locale","host","path"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":40},"goal":{"type":"string","minLength":1,"maxLength":200},"send":{"type":"boolean"}},"required":["label","goal","send"]},"maxItems":3},"intent":{"type":"object","properties":{"intent":{"type":"string","enum":["order_food","view_menu","reserve_table","book_appointment","register_event","fill_form","survey_feedback","contact_merchant","pay","pay_bill","ticket_checkin","product_info","app_download","follow_social","public_service","wifi_join","save_contact","add_calendar","read_document","donate","navigate","link_hub","shop_online","read_info","sign_up","play_game","create_content"]},"confidence":{"type":"number","minimum":0,"maximum":1},"state":{"type":"string","enum":["ok","unavailable","expired","gone","blocked"]},"mainAction":{"type":["string","null"],"maxLength":80}},"required":["intent","confidence","state","mainAction"]},"hit":{"type":"boolean"}},"required":["suggestions","hit"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/page-suggestions":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","minLength":2,"maxLength":20},"host":{"type":"string","maxLength":253},"title":{"type":"string","maxLength":200},"headings":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":20},"controls":{"type":"array","items":{"type":"string","maxLength":80},"maxItems":40},"text":{"type":"string","maxLength":2000},"hasForm":{"type":"boolean"},"hasSearch":{"type":"boolean"},"hasChat":{"type":"boolean"},"path":{"type":"string","maxLength":200}},"required":["locale","host","title","headings","controls","text","hasForm","hasSearch","hasChat"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":40},"goal":{"type":"string","minLength":1,"maxLength":200},"send":{"type":"boolean"}},"required":["label","goal","send"]},"maxItems":3},"intent":{"type":"object","properties":{"intent":{"type":"string","enum":["order_food","view_menu","reserve_table","book_appointment","register_event","fill_form","survey_feedback","contact_merchant","pay","pay_bill","ticket_checkin","product_info","app_download","follow_social","public_service","wifi_join","save_contact","add_calendar","read_document","donate","navigate","link_hub","shop_online","read_info","sign_up","play_game","create_content"]},"confidence":{"type":"number","minimum":0,"maximum":1},"state":{"type":"string","enum":["ok","unavailable","expired","gone","blocked"]},"mainAction":{"type":["string","null"],"maxLength":80}},"required":["intent","confidence","state","mainAction"]},"provider":{"type":"string"},"model":{"type":"string"},"cached":{"type":"boolean"}},"required":["suggestions","provider","model"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/url-check":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":"string","enum":["safe","unsafe","unverified"]},"threatTypes":{"type":"array","items":{"type":"string"}},"provider":{"type":"string"},"cached":{"type":"boolean"}},"required":["verdict","threatTypes","provider","cached"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/constraints":{"get":{"security":[{"FirebaseIdToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"put":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["allergen","halal","dietary","avoid_ingredient","alcohol","budget","language","spice","portion"]},"key":{"type":"string","minLength":1,"maxLength":100},"value":{"anyOf":[{"type":"array","items":{"type":"string","maxLength":100},"maxItems":50},{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}]},"strength":{"type":"string","enum":["hard","soft"]},"scope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["global"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["brand"]},"brandId":{"type":"string"}},"required":["kind","brandId"]},{"type":"object","properties":{"kind":{"type":"string","enum":["venue"]},"venueId":{"type":"string"}},"required":["kind","venueId"]}]}},"required":["domain","key","value","scope"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/preferences":{"get":{"security":[{"FirebaseIdToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{}}},"required":["preferences"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/items":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"What Scanro keeps for the person in Pouchy (Companion API 1.14.0 list, newest first; migration plan phase 1). 503 not_enabled until POUCHY_TAGGED is on; anonymous memory stays in Scanro and has none.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["pouchy"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"type":{"type":"string"},"updatedAt":{"type":["string","null"]}},"required":["id","content","type","updatedAt"]}}},"required":["source","items"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/preferences/{id}/correct":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["reject"]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","enum":["replace"]},"statement":{"type":"string","minLength":1,"maxLength":500},"polarity":{"type":"string","enum":["like","dislike","neutral"]}},"required":["action","statement","polarity"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/{kind}/{id}":{"delete":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","enum":["constraint","preference"]},"required":true,"name":"kind","in":"path"},{"schema":{"type":"string","maxLength":100},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/events":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"type":{"type":"string","enum":["order_completed","feedback_submitted","item_rejected","preference_stated","scan_recorded","task_finished","habit_corrected"]},"occurredAt":{"type":"string"},"taskId":{"type":["string","null"]},"venueId":{"type":["string","null"]},"brandId":{"type":["string","null"]},"orderRef":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"name":{"type":"string"},"optionNames":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"subject":{"type":"string","enum":["self","companion","unknown"]}},"required":["itemId","name","optionNames","quantity","subject"]}},"feedback":{"type":["object","null"],"properties":{"rating":{"type":["integer","null"],"minimum":1,"maximum":5},"text":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["too_spicy","too_salty","too_sweet","too_oily","small_portion","large_portion"]},"maxItems":6}},"required":["rating","text"]},"verified":{"type":"boolean"},"task":{"type":"object","properties":{"intent":{"type":"string","enum":["order_food","view_menu","reserve_table","book_appointment","register_event","fill_form","survey_feedback","contact_merchant","pay","pay_bill","ticket_checkin","product_info","app_download","follow_social","public_service","wifi_join","save_contact","add_calendar","read_document","donate","navigate","link_hub","shop_online","read_info","sign_up","play_game","create_content"]},"site":{"type":"string","minLength":3,"maxLength":100,"pattern":"^(?=.*\\.)[a-z0-9-]+(\\.[a-z0-9-]+)+$"},"outcome":{"type":"string","enum":["completed","abandoned","failed","outcome_unknown"]},"slots":{"type":"object","properties":{"party_size":{"type":"integer","minimum":1,"maximum":20},"time_of_day":{"type":"string","enum":["morning","afternoon","evening"]},"day_type":{"type":"string","enum":["weekday","weekend"]},"channel":{"type":"string","enum":["web","whatsapp","telegram","phone","email"]},"game_style":{"type":"string","enum":["tight","normal","aggressive","teach"]}},"additionalProperties":false}},"required":["intent","site","outcome","slots"],"additionalProperties":false},"correction":{"type":"object","properties":{"intent":{"type":"string","enum":["order_food","view_menu","reserve_table","book_appointment","register_event","fill_form","survey_feedback","contact_merchant","pay","pay_bill","ticket_checkin","product_info","app_download","follow_social","public_service","wifi_join","save_contact","add_calendar","read_document","donate","navigate","link_hub","shop_online","read_info","sign_up","play_game","create_content"]},"site":{"type":"string","minLength":3,"maxLength":100,"pattern":"^(?=.*\\.)[a-z0-9-]+(\\.[a-z0-9-]+)+$"},"slots":{"type":"object","properties":{"party_size":{"type":"integer","minimum":1,"maximum":20},"time_of_day":{"type":"string","enum":["morning","afternoon","evening"]},"day_type":{"type":"string","enum":["weekday","weekend"]},"channel":{"type":"string","enum":["web","whatsapp","telegram","phone","email"]},"game_style":{"type":"string","enum":["tight","normal","aggressive","teach"]}},"additionalProperties":false},"forever":{"type":"boolean"}},"required":["intent","site","slots","forever"],"additionalProperties":false}},"required":["eventId","type","occurredAt","taskId","venueId","brandId","orderRef","items","feedback","verified"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/erase":{"post":{"security":[{"FirebaseIdToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/export":{"get":{"security":[{"FirebaseIdToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/consent":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Whether long-term memory is on for the caller: always for a signed-in account; for an anonymous user only once they turned it on.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"basis":{"type":"string","enum":["account","consent"]},"decided":{"type":"boolean"},"retentionDays":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["enabled","basis","decided","retentionDays"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"put":{"security":[{"FirebaseIdToken":[]}],"description":"Anonymous users turn long-term memory on or off. Off erases what was remembered. Kept only in Scanro's own database (never Pouchy) and erased after 90 days without activity. A signed-in account gets 409 consent_follows_account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"basis":{"type":"string","enum":["account","consent"]},"decided":{"type":"boolean"},"retentionDays":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["enabled","basis","decided","retentionDays"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/merge-anonymous":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"After switching this phone to an account that already used Scanro: brings the explicit memories the person gave while signed out (the anonymous identity, proven by its own ID token) to the account, then erases the anonymous memory. Form of address: the newer wins. Habits and places learned from finished tasks come along (unless the account turned learning off); taste derived from orders is not moved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"anonymousIdToken":{"type":"string","minLength":20,"maxLength":4096}},"required":["anonymousIdToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"merged":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"erased":{"type":"boolean"}},"required":["merged","skipped","erased"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/habits":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"The intent card's prefill: the caller's learned habits for an intent (this site's first) and whether they did it on this site before.","parameters":[{"schema":{"type":"string","enum":["order_food","view_menu","reserve_table","book_appointment","register_event","fill_form","survey_feedback","contact_merchant","pay","pay_bill","ticket_checkin","product_info","app_download","follow_social","public_service","wifi_join","save_contact","add_calendar","read_document","donate","navigate","link_hub","shop_online","read_info","sign_up","play_game","create_content"]},"required":true,"name":"intent","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":100,"pattern":"^(?=.*\\.)[a-z0-9-]+(\\.[a-z0-9-]+)+$"},"required":true,"name":"site","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"habits":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["party_size","time_of_day","day_type","channel","game_style"]},"value":{"type":"string","maxLength":20},"site":{"type":"boolean"}},"required":["slot","value","site"]},"maxItems":5},"visited":{"type":"boolean"},"lastVisitAt":{"type":["string","null"]}},"required":["habits","visited"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/learning":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"\"Learn from my use\": whether habits and visits are learned from finished tasks (on by default).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"habits":{"type":"boolean"}},"required":["habits"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"put":{"security":[{"FirebaseIdToken":[]}],"description":"Turns \"learn from my use\" on or off. Off deletes the habits and visits learned so far (and their Pouchy copies) and the task events behind them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"habits":{"type":"boolean"}},"required":["habits"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"habits":{"type":"boolean"}},"required":["habits"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/devices/attestation-challenge":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"A one-use nonce (5 minutes) for the device to set as the Keystore attestation challenge when it creates its signing key (Android Key Attestation; iOS App Attest later).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"expires_at":{"type":"string"}},"required":["challenge","expires_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/devices/keys":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Registers the device signing key (public P-256 JWK). With `attestation`, the server verifies it (chain to a Google hardware root, fresh challenge, TEE/StrongBox, Scanro package and signing certificate, EC P-256 SIGN, same public key) and records the verdict on the key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string","pattern":"^[A-Za-z0-9._-]{8,120}$"},"jwk":{"type":"object","additionalProperties":{}},"attestation":{"oneOf":[{"type":"object","properties":{"format":{"type":"string","enum":["android_key"]},"challenge":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"chain":{"type":"array","items":{"type":"string","maxLength":16000,"pattern":"^[A-Za-z0-9+/=]+$"},"minItems":1,"maxItems":10}},"required":["format","challenge","chain"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","enum":["apple_app_attest"]},"challenge":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"key_id":{"type":"string","pattern":"^[A-Za-z0-9+/=]{40,48}$"},"attestation_object":{"type":"string","maxLength":20000,"pattern":"^[A-Za-z0-9+/=]+$"}},"required":["format","challenge","key_id","attestation_object"],"additionalProperties":false}]},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["key_id","jwk"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string"},"attestation":{"type":"object","properties":{"status":{"type":"string","enum":["verified","failed","none"]},"platform":{"type":["string","null"]},"security_level":{"type":["string","null"]},"reasons":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["status","platform","security_level","reasons","warnings"]}},"required":["key_id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/devices/push-token":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Registers this install's FCM token for the caller. Notifications are generic (no menu items or page text).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":4096,"pattern":"^[A-Za-z0-9_:.-]+$"},"platform":{"type":"string","enum":["android","ios"]},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["token","platform","locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"sending":{"type":"boolean"}},"required":["ok","sending"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/devices/locale":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"The person changed the app language (Settings) or the phone's. Negotiates the tag (explicit field, else Accept-Language, else en), stores it for the user, and re-labels this install's push token (`token`) or, without one, every token of the caller and the named device key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"token":{"type":"string","minLength":20,"maxLength":4096,"pattern":"^[A-Za-z0-9_:.-]+$"},"key_id":{"type":"string","pattern":"^[A-Za-z0-9._-]{8,120}$"}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"changed":{"type":"boolean"},"push_tokens":{"type":"integer"}},"required":["locale","changed","push_tokens"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/devices/push-token/delete":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Forgets one token (or, without `token`, every token of the caller): notifications turned off in Settings.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":4096,"pattern":"^[A-Za-z0-9_:.-]+$"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"integer"}},"required":["removed"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/me/usage":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"This week's Scanro-allowance calls (Monday 00:00 Asia/Singapore reset) for the Settings usage card. Counted per server instance. Calls answered by the person's own model key are not counted. `tier` is anonymous or signed_in; `limits` lists both tiers (D24) so the app can say what signing in adds.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"week_start":{"type":"string"},"resets_at":{"type":"string"},"tier":{"type":"string","enum":["anonymous","signed_in"]},"model":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"},"percent":{"type":"number"}},"required":["used","limit","percent"]},"agent":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"},"percent":{"type":"number"}},"required":["used","limit","percent"]},"limits":{"type":"object","properties":{"anonymous":{"type":"object","properties":{"model":{"type":"integer"},"agent":{"type":"integer"}},"required":["model","agent"]},"signed_in":{"type":"object","properties":{"model":{"type":"integer"},"agent":{"type":"integer"}},"required":["model","agent"]}},"required":["anonymous","signed_in"]}},"required":["week_start","resets_at","tier","model","agent","limits"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/model-providers/subscriptions":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Subscription sign-in providers enabled on this server (owner decision D26): the ChatGPT / Claude / Gemini accounts the person can sign in with so their subscription allowance powers model calls. Each entry carries the OAuth client id, endpoints and redirect from server config, merged with the catalogue display fields; the client secret and the model API base are never returned. A provider with no server config is omitted, so nothing is offered unless the owner enabled it. Anonymous users may call it.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","pattern":"^[a-z0-9_]+$"},"name":{"type":"string"},"flow":{"type":"string","enum":["loopback_pkce","device_code"]},"authorizeUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"clientId":{"type":"string","minLength":1},"agentNameHint":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"resource":{"type":["string","null"]},"apiBaseUrl":{"type":"string","format":"uri"},"suggestedModels":{"type":"object","properties":{"fast":{"type":"array","items":{"type":"string"}},"strong":{"type":"array","items":{"type":"string"}}},"required":["fast","strong"]},"capabilities":{"type":"object","properties":{"tools":{"type":"boolean"},"jsonSchema":{"type":"boolean"},"vision":{"type":"boolean"},"pdf":{"type":"boolean"}},"required":["tools","jsonSchema","vision","pdf"]},"dataRegion":{"type":"string","enum":["global","us","eu","cn","sg","user_defined"]},"unverified":{"type":"boolean"}},"required":["provider","name","flow","authorizeUrl","tokenUrl","clientId","agentNameHint","scopes","resource","apiBaseUrl","suggestedModels","capabilities","dataRegion","unverified"],"additionalProperties":false}}},"required":["providers"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/model-keys/test":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Tests one model key before the phone saves it: lists the provider's models (max 200), picks the fast and strong models, probes a tiny JSON call and a tiny tool call. Anonymous users may call it. The key is used for this request only and never logged or stored. A key that fails answers 200 with ok=false and a failure code. Own rate limit: 10 tests, then 30 per hour (429 quota_exceeded).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","pattern":"^[a-z0-9_]+$"},"key":{"type":"string","minLength":8,"maxLength":4096},"kind":{"type":"string","enum":["api_key","oauth"],"default":"api_key"},"baseUrl":{"type":"string","maxLength":300,"format":"uri"},"fastModel":{"type":"string","minLength":1,"maxLength":200},"strongModel":{"type":"string","minLength":1,"maxLength":200}},"required":["provider","key"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"provider":{"type":"string"},"fastModel":{"type":["string","null"]},"strongModel":{"type":["string","null"]},"capabilities":{"type":"object","properties":{"tools":{"type":"boolean"},"jsonSchema":{"type":"boolean"},"vision":{"type":"boolean"},"pdf":{"type":"boolean"}},"required":["tools","jsonSchema","vision","pdf"]},"models":{"type":"array","items":{"type":"string"},"maxItems":200},"failure":{"type":["string","null"],"enum":["auth","quota","rate_limited","timeout","unavailable","capability","invalid_output","bad_request",null]}},"required":["ok","provider","fastModel","strongModel","capabilities","models","failure"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/menu":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"menu.read through a connected merchant API. Items carry no allergen claims unless the merchant declares them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/web-plans":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"A plan the device read from a merchant web page (device-observed quote).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"host":{"type":"string","pattern":"^[a-z0-9.-]{1,253}$/i"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":20},"quantity":{"type":"integer","minimum":1,"maximum":20},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer","minimum":0}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price"]},"minItems":1,"maxItems":50},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer","minimum":0}},"required":["currency","minor"]},"snapshot_revision":{"type":"integer","minimum":0}},"required":["host","object_id","lines","total","snapshot_revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"audience":{"type":"string","maxLength":200},"action":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120}},"quantity":{"type":"integer","exclusiveMinimum":0},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price","note"]},"minItems":1},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"quote_id":{"type":"string","maxLength":80},"quote_version":{"type":"integer","minimum":0},"quote_expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"cancel_terms":{"type":"string","maxLength":300},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]}},"plan_hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["plan_id","task_id","object","audience","action","lines","total","quote_id","quote_version","quote_expires_at","cancel_terms","data_share","plan_hash"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/actions/{id}/claim":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Device executor: consume the grant right before the submit tap.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action_id":{"type":"string","pattern":"^act_[a-z0-9]{10,32}$"},"task_id":{"type":"string"},"plan_id":{"type":"string"},"grant_id":{"type":["string","null"]},"capability":{"type":"string"},"executor":{"type":"string","enum":["https_json","a2a","mcp","web_adapter"]},"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"version":{"type":"integer","minimum":0},"idempotency_key":{"type":"string","maxLength":120},"external_ref":{"type":["string","null"],"maxLength":120},"retry_safe":{"type":"boolean"},"dispatch_attempts":{"type":"integer","minimum":0},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]},"payment_evidence":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["merchant","psp"]},"ref":{"type":"string","minLength":1,"maxLength":120},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["source","ref","at"]},"compensations":{"type":"array","items":{"type":"object","properties":{"compensation_id":{"type":"string","pattern":"^cmp_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["item_removed","price_adjusted"]},"state":{"type":"string","enum":["reported","adjusted","failed"]},"removed":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]}},"amount_delta":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"evidence_ref":{"type":["string","null"],"maxLength":120},"reported_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"resolved_at":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["compensation_id","kind","state","removed","amount_delta","evidence_ref","reported_at","resolved_at"]}},"updated_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["action_id","task_id","plan_id","grant_id","capability","executor","state","version","idempotency_key","external_ref","retry_safe","dispatch_attempts","payment","payment_evidence","compensations","updated_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/actions/{id}/report":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Device executor: outcome read back from the merchant page.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["accepted","rejected","unknown"]},"external_ref":{"type":["string","null"],"maxLength":120}},"required":["outcome"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action_id":{"type":"string","pattern":"^act_[a-z0-9]{10,32}$"},"task_id":{"type":"string"},"plan_id":{"type":"string"},"grant_id":{"type":["string","null"]},"capability":{"type":"string"},"executor":{"type":"string","enum":["https_json","a2a","mcp","web_adapter"]},"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"version":{"type":"integer","minimum":0},"idempotency_key":{"type":"string","maxLength":120},"external_ref":{"type":["string","null"],"maxLength":120},"retry_safe":{"type":"boolean"},"dispatch_attempts":{"type":"integer","minimum":0},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]},"payment_evidence":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["merchant","psp"]},"ref":{"type":"string","minLength":1,"maxLength":120},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["source","ref","at"]},"compensations":{"type":"array","items":{"type":"object","properties":{"compensation_id":{"type":"string","pattern":"^cmp_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["item_removed","price_adjusted"]},"state":{"type":"string","enum":["reported","adjusted","failed"]},"removed":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]}},"amount_delta":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"evidence_ref":{"type":["string","null"],"maxLength":120},"reported_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"resolved_at":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["compensation_id","kind","state","removed","amount_delta","evidence_ref","reported_at","resolved_at"]}},"updated_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["action_id","task_id","plan_id","grant_id","capability","executor","state","version","idempotency_key","external_ref","retry_safe","dispatch_attempts","payment","payment_evidence","compensations","updated_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/plans":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"action":{"type":"string","enum":["order.submit"]},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":20},"quantity":{"type":"integer","minimum":1,"maximum":20},"note":{"type":["string","null"],"maxLength":200},"subject":{"type":"string","enum":["self","companion","unknown"]}},"required":["item_id","option_ids","quantity"],"additionalProperties":false},"minItems":1,"maxItems":50},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]},"maxItems":8}},"required":["object","action","lines","data_share"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"audience":{"type":"string","maxLength":200},"action":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120}},"quantity":{"type":"integer","exclusiveMinimum":0},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price","note"]},"minItems":1},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"quote_id":{"type":"string","maxLength":80},"quote_version":{"type":"integer","minimum":0},"quote_expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"cancel_terms":{"type":"string","maxLength":300},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]}},"plan_hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["plan_id","task_id","object","audience","action","lines","total","quote_id","quote_version","quote_expires_at","cancel_terms","data_share","plan_hash"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"FirebaseIdToken":[]}],"description":"Pending-approval inbox: the caller's plans with a live quote that are neither signed nor rejected (drafts from MCP, SDK or A2A clients).","parameters":[{"schema":{"type":"string","enum":["awaiting_grant"]},"required":true,"name":"state","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"audience":{"type":"string","maxLength":200},"action":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120}},"quantity":{"type":"integer","exclusiveMinimum":0},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price","note"]},"minItems":1},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"quote_id":{"type":"string","maxLength":80},"quote_version":{"type":"integer","minimum":0},"quote_expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"cancel_terms":{"type":"string","maxLength":300},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]}},"plan_hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["plan_id","task_id","object","audience","action","lines","total","quote_id","quote_version","quote_expires_at","cancel_terms","data_share","plan_hash"]},"state":{"type":"string","enum":["awaiting_grant"]},"created_at":{"type":"string"}},"required":["plan","state","created_at"]}}},"required":["plans"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Memory is off for this anonymous user (memory_consent_required)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Already approved","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/plans/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Reads one of the caller's plans, e.g. a draft another client (MCP, SDK) created for the user to review and approve on the device.","parameters":[{"schema":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"audience":{"type":"string","maxLength":200},"action":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120}},"quantity":{"type":"integer","exclusiveMinimum":0},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price","note"]},"minItems":1},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"quote_id":{"type":"string","maxLength":80},"quote_version":{"type":"integer","minimum":0},"quote_expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"cancel_terms":{"type":"string","maxLength":300},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]}},"plan_hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["plan_id","task_id","object","audience","action","lines","total","quote_id","quote_version","quote_expires_at","cancel_terms","data_share","plan_hash"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/grants":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Records a PlanGrant signed on the device (ES256, raw r||s, base64url) and starts the action.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action_id":{"type":"string","pattern":"^act_[a-z0-9]{10,32}$"},"task_id":{"type":"string"},"plan_id":{"type":"string"},"grant_id":{"type":["string","null"]},"capability":{"type":"string"},"executor":{"type":"string","enum":["https_json","a2a","mcp","web_adapter"]},"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"version":{"type":"integer","minimum":0},"idempotency_key":{"type":"string","maxLength":120},"external_ref":{"type":["string","null"],"maxLength":120},"retry_safe":{"type":"boolean"},"dispatch_attempts":{"type":"integer","minimum":0},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]},"payment_evidence":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["merchant","psp"]},"ref":{"type":"string","minLength":1,"maxLength":120},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["source","ref","at"]},"compensations":{"type":"array","items":{"type":"object","properties":{"compensation_id":{"type":"string","pattern":"^cmp_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["item_removed","price_adjusted"]},"state":{"type":"string","enum":["reported","adjusted","failed"]},"removed":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]}},"amount_delta":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"evidence_ref":{"type":["string","null"],"maxLength":120},"reported_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"resolved_at":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["compensation_id","kind","state","removed","amount_delta","evidence_ref","reported_at","resolved_at"]}},"updated_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["action_id","task_id","plan_id","grant_id","capability","executor","state","version","idempotency_key","external_ref","retry_safe","dispatch_attempts","payment","payment_evidence","compensations","updated_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/actions/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action_id":{"type":"string","pattern":"^act_[a-z0-9]{10,32}$"},"task_id":{"type":"string"},"plan_id":{"type":"string"},"grant_id":{"type":["string","null"]},"capability":{"type":"string"},"executor":{"type":"string","enum":["https_json","a2a","mcp","web_adapter"]},"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"version":{"type":"integer","minimum":0},"idempotency_key":{"type":"string","maxLength":120},"external_ref":{"type":["string","null"],"maxLength":120},"retry_safe":{"type":"boolean"},"dispatch_attempts":{"type":"integer","minimum":0},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]},"payment_evidence":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["merchant","psp"]},"ref":{"type":"string","minLength":1,"maxLength":120},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["source","ref","at"]},"compensations":{"type":"array","items":{"type":"object","properties":{"compensation_id":{"type":"string","pattern":"^cmp_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["item_removed","price_adjusted"]},"state":{"type":"string","enum":["reported","adjusted","failed"]},"removed":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]}},"amount_delta":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"evidence_ref":{"type":["string","null"],"maxLength":120},"reported_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"resolved_at":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["compensation_id","kind","state","removed","amount_delta","evidence_ref","reported_at","resolved_at"]}},"updated_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["action_id","task_id","plan_id","grant_id","capability","executor","state","version","idempotency_key","external_ref","retry_safe","dispatch_attempts","payment","payment_evidence","compensations","updated_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/actions/{id}/cancel":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action_id":{"type":"string","pattern":"^act_[a-z0-9]{10,32}$"},"task_id":{"type":"string"},"plan_id":{"type":"string"},"grant_id":{"type":["string","null"]},"capability":{"type":"string"},"executor":{"type":"string","enum":["https_json","a2a","mcp","web_adapter"]},"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"version":{"type":"integer","minimum":0},"idempotency_key":{"type":"string","maxLength":120},"external_ref":{"type":["string","null"],"maxLength":120},"retry_safe":{"type":"boolean"},"dispatch_attempts":{"type":"integer","minimum":0},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]},"payment_evidence":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["merchant","psp"]},"ref":{"type":"string","minLength":1,"maxLength":120},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["source","ref","at"]},"compensations":{"type":"array","items":{"type":"object","properties":{"compensation_id":{"type":"string","pattern":"^cmp_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["item_removed","price_adjusted"]},"state":{"type":"string","enum":["reported","adjusted","failed"]},"removed":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["item_id","quantity"]}},"amount_delta":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"evidence_ref":{"type":["string","null"],"maxLength":120},"reported_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"resolved_at":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["compensation_id","kind","state","removed","amount_delta","evidence_ref","reported_at","resolved_at"]}},"updated_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["action_id","task_id","plan_id","grant_id","capability","executor","state","version","idempotency_key","external_ref","retry_safe","dispatch_attempts","payment","payment_evidence","compensations","updated_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/resolutions":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Resolves a scanned value. The raw value is used once and never stored or logged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"carrier":{"type":"string","enum":["qr","nfc","barcode","link"]},"raw_value":{"type":"string","minLength":1,"maxLength":4096},"client_context":{"type":"object","properties":{"app_build":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":20}}}},"required":["carrier","raw_value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"resolution_id":{"type":"string","pattern":"^res_[a-z0-9]{10,32}$"},"kind":{"type":"string","enum":["publication","known_adapter","manifest","gs1_digital_link","unknown_web","local_only"]},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"},"type":{"type":"string","enum":["restaurant_venue","restaurant_table","product","device","facility","parking_site","charging_point","parcel_locker","exhibit","event_session","asset","other"]}},"required":["issuer","object_id","type"]},"publication":{"type":["object","null"],"properties":{"publication_id":{"type":"string"},"mode":{"type":"string","enum":["object_entry","task_handoff","result_lookup","table_group"]}},"required":["publication_id","mode"]},"context_ref":{"type":["string","null"],"pattern":"^ctx_[a-z0-9]{10,32}$"},"source_status":{"type":"string","enum":["unverified","domain_verified","business_linked","result_verifiable"]},"capabilities":{"type":"array","items":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"}},"display":{"type":"object","properties":{"host":{"type":["string","null"],"maxLength":253},"issuer_name":{"type":["string","null"],"maxLength":200}},"required":["host","issuer_name"]},"url_verdict":{"type":"string","enum":["safe","unsafe","unverified","not_applicable"]},"web_url":{"type":["string","null"],"maxLength":500,"pattern":"^https:\\/\\/[^?#]*$"},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"ucp":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["ucp_profile"]},"profile_version":{"type":"string","maxLength":40},"origin":{"type":"string","maxLength":300},"capabilities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"version":{"type":"string","maxLength":40},"extends":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"transports":{"type":"array","items":{"type":"string","enum":["rest","mcp","a2a","embedded","other"]},"maxItems":5},"status":{"type":"string","enum":["discovered"]},"executable":{"type":"boolean","enum":[false]}},"required":["name","version","extends","transports","status","executable"]},"maxItems":50},"rejected":{"type":"integer","minimum":0},"agent_card_url":{"type":["string","null"],"maxLength":300,"format":"uri"},"payment_handlers":{"type":"integer","minimum":0},"fetched_at":{"type":"string"}},"required":["source","profile_version","origin","capabilities","rejected","agent_card_url","payment_handlers","fetched_at"]}},"required":["resolution_id","kind","object","publication","context_ref","source_status","capabilities","display","url_verdict","web_url","expires_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/publications":{"post":{"security":[{"LabToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"},"object_type":{"type":"string","enum":["restaurant_venue","restaurant_table","product","device","facility","parking_site","charging_point","parcel_locker","exhibit","event_session","asset","other"]},"display_name":{"type":"string","minLength":1,"maxLength":120},"web_url":{"type":["string","null"],"maxLength":500,"pattern":"^https:\\/\\/[^?#]*$"},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["issuer","object_id","object_type","display_name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"LabToken":[]}],"description":"Lists object-entry codes (table codes), newest first. state filters on the effective state (a published code past expires_at is expired).","parameters":[{"schema":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"required":false,"name":"issuer","in":"query"},{"schema":{"type":"string","enum":["draft","published","paused","revoked","expired"]},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","enum":["object_entry","task_handoff","result_lookup","table_group"]},"required":false,"name":"mode","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"publications":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["publications"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/publications/{id}/revoke":{"post":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/publications/{id}/qr.svg":{"get":{"security":[{"LabToken":[]}],"description":"Printable QR image of the short link (error correction M). The code carries nothing but https://<host>/q/<publication_id>.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"SVG","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/handoffs":{"post":{"security":[{"FirebaseIdToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"party_size":{"type":"integer","minimum":1,"maximum":30},"budget":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"taste_directions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":8},"language":{"type":"string","maxLength":10},"share_fields":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]},"maxItems":8},"recipients":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["any_authenticated"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["issuer"]},"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"}},"required":["kind","issuer"]},{"type":"object","properties":{"kind":{"type":"string","enum":["subjects"]},"subjects":{"type":"array","items":{"type":"string","maxLength":120},"minItems":1,"maxItems":20}},"required":["kind","subjects"]}]},"ttl_minutes":{"type":"integer","minimum":5,"maximum":60,"default":30}},"required":["share_fields"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/handoffs/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(hof|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/handoffs/{id}/revoke":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(hof|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/handoffs/{id}/accept":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(hof|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/staff":{"post":{"security":[{"LabToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"uid":{"type":"string","minLength":1,"maxLength":128},"issuer":{"type":"string","maxLength":200}},"required":["uid","issuer"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"issuer","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"staff":{"type":"array","items":{"type":"object","properties":{"uid":{"type":"string"},"issuer":{"type":"string"},"created_at":{"type":"string"}},"required":["uid","issuer","created_at"]}}},"required":["staff"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Starts a table group: a short-lived (at most 2 hours) table_group code for the table the caller scanned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"ttl_minutes":{"type":"integer","minimum":10,"maximum":120,"default":90}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/join":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Joins by group or publication id. Seats are numbers; no names.","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/lines":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Replaces the caller's own lines: item ids, option ids and quantities only.","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1,"maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":20,"default":[]},"quantity":{"type":"integer","minimum":1,"maximum":20}},"required":["item_id","quantity"],"additionalProperties":false},"maxItems":30}},"required":["lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/unlock":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Initiator: reopen the table for changes before any order was confirmed.","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/close":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Initiator: end the session. Every participant's data is deleted.","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/revoke":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Initiator: withdraw the code. Every participant's data is deleted.","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/leave":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean","enum":[true]}},"required":["left"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/groups/{id}/plan":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Initiator: one merchant-quoted plan from everyone's lines; locks the table. Confirm it with a signed grant (POST /v1/grants).","parameters":[{"schema":{"type":"string","pattern":"^(grp|pub)_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"task_id":{"type":"string","pattern":"^tsk_[a-z0-9]{10,32}$"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"audience":{"type":"string","maxLength":200},"action":{"type":"string","maxLength":80,"pattern":"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"option_ids":{"type":"array","items":{"type":"string","maxLength":120}},"quantity":{"type":"integer","exclusiveMinimum":0},"unit_price":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"note":{"type":["string","null"],"maxLength":200}},"required":["item_id","option_ids","quantity","unit_price","note"]},"minItems":1},"total":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"quote_id":{"type":"string","maxLength":80},"quote_version":{"type":"integer","minimum":0},"quote_expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"cancel_terms":{"type":"string","maxLength":300},"data_share":{"type":"array","items":{"type":"string","enum":["party_size","budget","taste_directions","language","time_window","device_summary","service_scope"]}},"plan_hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"}},"required":["plan_id","task_id","object","audience","action","lines","total","quote_id","quote_version","quote_expires_at","cancel_terms","data_share","plan_hash"]},"group":{"type":"object","properties":{"group_id":{"type":"string","pattern":"^grp_[a-z0-9]{10,32}$"},"publication_id":{"type":"string"},"short_url":{"type":"string","format":"uri"},"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"state":{"type":"string","enum":["open","locked","ordered","closed","revoked","expired"]},"version":{"type":"integer","exclusiveMinimum":0},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"},"you_are_initiator":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"participant_id":{"type":"string","pattern":"^ptc_[a-z0-9]{10,32}$"},"label":{"type":"integer","minimum":1},"is_initiator":{"type":"boolean"},"you":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"option_ids":{"type":"array","items":{"type":"string"}},"quantity":{"type":"integer"},"unit_price":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["item_id","option_ids","quantity","unit_price"]}},"subtotal":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]}},"required":["participant_id","label","is_initiator","you","lines","subtotal"]}},"items_total":{"type":["object","null"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"integer"}},"required":["currency","minor"]},"plan_id":{"type":["string","null"]},"order":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["awaiting_grant","authorised","dispatching","accepted","rejected","outcome_unknown","fulfilled","cancel_requested","cancelled","cancel_failed","expired","revoked","partially_failed","adjusted","compensation_failed"]},"payment":{"type":"string","enum":["unknown","unpaid","payment_pending","paid","refunded"]}},"required":["state","payment"]}},"required":["group_id","publication_id","short_url","object","state","version","expires_at","you_are_initiator","participants","items_total","plan_id","order"]}},"required":["plan","group"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Starts an agent run on the page the device shows and returns the first step. The goal is screened; it is stored only as a hash and length. Attachments (images, video stills, PDF, plain text; not screened) go to the model for this run only and are never stored or logged. Bodies up to 16 MiB; 413 attachment_too_large / attachments_over_limit, 400 invalid_attachment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":4000},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"capability":{"type":"string","enum":["verified","unverified"]},"vaultAvailable":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"vaultConsented":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"actionId":{"type":["string","null"],"pattern":"^act_[a-z0-9]{10,32}$"},"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"view":{"type":"object","properties":{"documentId":{"type":"string"},"viewSeq":{"type":"integer","minimum":0},"url":{"type":"object","properties":{"host":{"type":"string"},"path":{"type":"string","maxLength":300}},"required":["host","path"]},"title":{"type":"string","maxLength":200},"dialogs":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"name":{"type":"string","maxLength":120}},"required":["ref","name"]}},"text":{"type":"string","maxLength":4000},"elements":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"role":{"type":"string","enum":["button","link","textbox","textarea","combobox","listbox","option","checkbox","radio","switch","slider","spinbutton","tab","menuitem","file","date","time","heading","dialog","img","other","frame"]},"name":{"type":"string","maxLength":120},"state":{"type":"object","properties":{"filled":{"type":["boolean","null"]},"checked":{"type":["boolean","null"]},"selected":{"type":["string","null"],"maxLength":120},"expanded":{"type":["boolean","null"]},"disabled":{"type":"boolean"},"required":{"type":"boolean"},"invalid":{"type":["string","null"],"maxLength":160}},"required":["filled","checked","selected","expanded","disabled","required","invalid"]},"options":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":40},"inputHint":{"type":["string","null"],"maxLength":40},"inViewport":{"type":"boolean"},"section":{"type":["string","null"],"maxLength":80},"sensitive":{"type":"string","enum":["none","submit","pay","file","login","password","captcha","wallet"]},"form":{"type":["object","null"],"properties":{"method":{"type":"string","enum":["get","post","dialog","none"]},"search":{"type":"boolean"},"personal":{"type":"boolean"},"fields":{"type":"integer","minimum":0,"maximum":999},"step":{"type":["object","null"],"properties":{"current":{"type":"integer","minimum":1,"maximum":99},"total":{"type":"integer","minimum":1,"maximum":99}},"required":["current","total"]},"codeRequest":{"type":"boolean"}},"required":["method","search","personal","fields","step"]}},"required":["ref","role","name","state","options","inputHint","inViewport","section","sensitive"]},"maxItems":400},"scroll":{"type":"object","properties":{"y":{"type":"number"},"h":{"type":"number"},"viewportH":{"type":"number"}},"required":["y","h","viewportH"]},"truncated":{"type":"boolean"},"needsUser":{"type":["string","null"],"enum":["login","captcha","payment",null]},"chat":{"type":["object","null"],"properties":{"surface":{"type":"string","enum":["page","widget"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^m\\d{1,5}$"},"sender":{"type":"string","enum":["me","bot","human","system","unknown"]},"name":{"type":["string","null"],"maxLength":60},"text":{"type":"string","maxLength":500},"time":{"type":["string","null"],"maxLength":24},"attachment":{"type":"boolean"}},"required":["id","sender","name","text","time","attachment"]},"maxItems":30},"total":{"type":"integer","minimum":0},"composer":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"send":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"attach":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"queue":{"type":["integer","null"],"minimum":0},"frameHost":{"type":["string","null"],"maxLength":253}},"required":["surface","messages","total","composer","send","attach","reception","queue"]},"lang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"chatFrame":{"type":["string","null"],"enum":["no_chat","unanswered",null]},"game":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["poker","blackjack","chess","xiangqi","go","gomoku","card","board","quiz","dice","unknown"]},"myTurn":{"type":["boolean","null"]},"mine":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"table":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"other":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":30},"pieces":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":64},"unreadable":{"type":"integer","minimum":0,"maximum":40},"numbers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","enum":["pot","stack","bet","small_blind","big_blind","score","opponent_score","balance","timer","round"]},"value":{"type":"number","minimum":0}},"required":["label","value"],"additionalProperties":false},"maxItems":12}},"required":["kind","myTurn","mine","table","other","pieces","unreadable","numbers"],"additionalProperties":false},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["documentId","viewSeq","url","title","dialogs","text","elements","scroll","truncated","needsUser"]},"attachments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["image","pdf","text"]},"mediaType":{"type":"string","enum":["image/jpeg","image/png","application/pdf","text/plain"]},"name":{"type":"string","maxLength":120},"data":{"type":"string","maxLength":5600000},"frame":{"type":["object","null"],"properties":{"index":{"type":"integer","minimum":0},"of":{"type":"integer","exclusiveMinimum":0},"atMs":{"type":"integer","minimum":0}},"required":["index","of","atMs"]}},"required":["kind","mediaType","name","data"],"additionalProperties":false},"maxItems":8},"replyTo":{"type":["string","null"],"maxLength":300},"brief":{"type":["string","null"],"minLength":1,"maxLength":8000},"plan":{"type":["object","null"],"properties":{"goal":{"type":"string","minLength":1,"maxLength":300},"scope":{"type":"string","minLength":1,"maxLength":300},"rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":30},"keyValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","minLength":1,"maxLength":300}},"required":["name","value"],"additionalProperties":false},"maxItems":40},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"doneWhen":{"type":"string","maxLength":300},"status":{"type":"string","enum":["todo","doing","done","blocked"]},"note":{"type":"string","maxLength":300}},"required":["title","doneWhen","status","note"],"additionalProperties":false},"minItems":1,"maxItems":40},"costs":{"type":"string","maxLength":300},"stops":{"type":"string","maxLength":300},"creditCap":{"type":"string","maxLength":300},"change":{"type":"string","minLength":1,"maxLength":200}},"required":["goal","scope","rules","keyValues","items","costs","stops","change"],"additionalProperties":false},"planApproved":{"type":"boolean"},"alcoholOk":{"type":"boolean"},"resume":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["failed","stuck","limits"]},"commitMayHaveSent":{"type":"boolean"},"previousRunId":{"type":["string","null"],"pattern":"^run_[a-z0-9]{10,32}$"}},"required":["reason","commitMayHaveSent","previousRunId"],"additionalProperties":false}},"required":["goal","locale","object","capability","vaultAvailable","view"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"step":{"type":"integer","minimum":0},"narration":{"type":"string","maxLength":200},"actions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"tool":{"type":"string","enum":["click"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"}},"required":["tool","ref"]},{"type":"object","properties":{"tool":{"type":"string","enum":["fill"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"value":{"type":["string","null"],"maxLength":500},"vault":{"type":["string","null"],"enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country",null]}},"required":["tool","ref","value","vault"]},{"type":"object","properties":{"tool":{"type":"string","enum":["select"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"option":{"type":"string","maxLength":120}},"required":["tool","ref","option"]},{"type":"object","properties":{"tool":{"type":"string","enum":["check"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"on":{"type":"boolean"}},"required":["tool","ref","on"]},{"type":"object","properties":{"tool":{"type":"string","enum":["scroll"]},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"direction":{"type":["string","null"],"enum":["up","down",null]}},"required":["tool","ref","direction"]},{"type":"object","properties":{"tool":{"type":"string","enum":["press"]},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"key":{"type":"string","enum":["Enter","Tab","Escape","ArrowDown","ArrowUp"]}},"required":["tool","ref","key"]},{"type":"object","properties":{"tool":{"type":"string","enum":["navigate"]},"url":{"type":"string","maxLength":500,"format":"uri"}},"required":["tool","url"]},{"type":"object","properties":{"tool":{"type":"string","enum":["back"]}},"required":["tool"]},{"type":"object","properties":{"tool":{"type":"string","enum":["wait_for"]},"text":{"type":["string","null"],"maxLength":120},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"timeoutMs":{"type":"integer","minimum":100,"maximum":10000}},"required":["tool","text","ref","timeoutMs"]},{"type":"object","properties":{"tool":{"type":"string","enum":["send_message"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"text":{"type":"string","minLength":1,"maxLength":500},"scope":{"type":["object","null"],"properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"gloss":{"type":["string","null"],"maxLength":500}},"required":["tool","ref","text","scope"]},{"type":"object","properties":{"tool":{"type":"string","enum":["look"]}},"required":["tool"]},{"type":"object","properties":{"tool":{"type":"string","enum":["click_point"]},"x":{"type":"integer","minimum":0,"maximum":4096},"y":{"type":"integer","minimum":0,"maximum":4096},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["tool","x","y","label"]},{"type":"object","properties":{"tool":{"type":"string","enum":["open_side"]},"goal":{"type":"string","minLength":1,"maxLength":200},"query":{"type":["string","null"],"minLength":1,"maxLength":200},"url":{"type":["string","null"],"maxLength":500,"format":"uri"},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["tool","goal","query","url"]},{"type":"object","properties":{"tool":{"type":"string","enum":["switch_tab"]},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["tool","tab"]},{"type":"object","properties":{"tool":{"type":"string","enum":["close_side"]},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"},"notes":{"type":"string","maxLength":1500},"sources":{"type":"array","items":{"type":"string","maxLength":500,"format":"uri"},"maxItems":5}},"required":["tool","tab","notes","sources"]},{"type":"object","properties":{"tool":{"type":"string","enum":["wait_reply"]},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000}},"required":["tool","timeoutMs"]},{"type":"object","properties":{"tool":{"type":"string","enum":["ask_user"]},"question":{"type":"string","maxLength":300},"choices":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":6}},"required":["tool","question","choices"]},{"type":"object","properties":{"tool":{"type":"string","enum":["ask_vault"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"minItems":1,"maxItems":6}},"required":["tool","fields"]},{"type":"object","properties":{"tool":{"type":"string","enum":["handoff"]},"reason":{"type":"string","enum":["login","captcha","payment","submit","file","ambiguous","stuck"]},"message":{"type":"string","maxLength":300}},"required":["tool","reason","message"]},{"type":"object","properties":{"tool":{"type":"string","enum":["done"]},"summary":{"type":"string","maxLength":2000},"evidence":{"type":["string","null"],"maxLength":300},"outcome":{"type":"string","enum":["completed","draft_ready","not_possible","answered"]},"followUps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":3},"picks":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"integer","minimum":1,"maximum":50}},"required":["name","quantity"]},"minItems":1,"maxItems":12}},"required":["title","lines"]},"maxItems":3}},"required":["tool","summary","evidence","outcome"]}]},"minItems":1,"maxItems":12},"model":{"type":"string"},"latencyMs":{"type":"integer"},"escalated":{"type":"boolean"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","null"]},"kind":{"type":"string","enum":["address_as","preference","fact"]},"statement":{"type":"string","maxLength":200},"status":{"type":"string","enum":["saved","duplicate","refused","consent_required"]},"reason":{"type":["string","null"],"enum":["not_requested","sensitive","personal_value","too_many","invalid",null]}},"required":["id","kind","statement","status","reason"]},"maxItems":3},"brief":{"type":"object","properties":{"text":{"type":"string","maxLength":8000},"change":{"type":"string","maxLength":200},"version":{"type":"integer","exclusiveMinimum":0}},"required":["text","change","version"]},"reaction":{"type":"string","enum":["👍","👌","🫡","💪","🙏","❤️","😄","😂","🤔","👀","🎉","🔥"]},"plan":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":300},"scope":{"type":"string","minLength":1,"maxLength":300},"rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":30},"keyValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","minLength":1,"maxLength":300}},"required":["name","value"],"additionalProperties":false},"maxItems":40},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"doneWhen":{"type":"string","maxLength":300},"status":{"type":"string","enum":["todo","doing","done","blocked"]},"note":{"type":"string","maxLength":300}},"required":["title","doneWhen","status","note"],"additionalProperties":false},"minItems":1,"maxItems":40},"costs":{"type":"string","maxLength":300},"stops":{"type":"string","maxLength":300},"creditCap":{"type":"string","maxLength":300},"change":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"integer","exclusiveMinimum":0},"approved":{"type":"boolean"}},"required":["goal","scope","rules","keyValues","items","costs","stops","change","version"],"additionalProperties":false},"pageKind":{"type":"string","enum":["content","merchant","record"]}},"required":["runId","step","narration","actions","model","latencyMs","escalated"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Run state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"413":{"description":"Body or attachments over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/steps":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Reports the outcomes of the last step with the new view or delta and returns the next step. userNote is a message the person sent while the run worked; attachments sent with it follow the same rules as on create. With ?stream=1 the answer is server-sent events: `narration` {text}, then one `action` {index, action} per action as soon as it passes the guard, then `step` (the full AgentStep), or `error` {code}.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["0","1"]},"required":false,"name":"stream","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcomes":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"status":{"type":"string","enum":["ok","no_effect","stale","not_found","not_actionable","blocked_by_guard","needs_user","skipped","error"]},"risk":{"anyOf":[{"type":"string","enum":["read","local_change","external_commit"]},{"type":"string","enum":["sensitive"]}]},"detail":{"type":["string","null"],"maxLength":200}},"required":["index","status","risk","detail"]},"maxItems":20},"view":{"type":["object","null"],"properties":{"documentId":{"type":"string"},"viewSeq":{"type":"integer","minimum":0},"url":{"type":"object","properties":{"host":{"type":"string"},"path":{"type":"string","maxLength":300}},"required":["host","path"]},"title":{"type":"string","maxLength":200},"dialogs":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"name":{"type":"string","maxLength":120}},"required":["ref","name"]}},"text":{"type":"string","maxLength":4000},"elements":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"role":{"type":"string","enum":["button","link","textbox","textarea","combobox","listbox","option","checkbox","radio","switch","slider","spinbutton","tab","menuitem","file","date","time","heading","dialog","img","other","frame"]},"name":{"type":"string","maxLength":120},"state":{"type":"object","properties":{"filled":{"type":["boolean","null"]},"checked":{"type":["boolean","null"]},"selected":{"type":["string","null"],"maxLength":120},"expanded":{"type":["boolean","null"]},"disabled":{"type":"boolean"},"required":{"type":"boolean"},"invalid":{"type":["string","null"],"maxLength":160}},"required":["filled","checked","selected","expanded","disabled","required","invalid"]},"options":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":40},"inputHint":{"type":["string","null"],"maxLength":40},"inViewport":{"type":"boolean"},"section":{"type":["string","null"],"maxLength":80},"sensitive":{"type":"string","enum":["none","submit","pay","file","login","password","captcha","wallet"]},"form":{"type":["object","null"],"properties":{"method":{"type":"string","enum":["get","post","dialog","none"]},"search":{"type":"boolean"},"personal":{"type":"boolean"},"fields":{"type":"integer","minimum":0,"maximum":999},"step":{"type":["object","null"],"properties":{"current":{"type":"integer","minimum":1,"maximum":99},"total":{"type":"integer","minimum":1,"maximum":99}},"required":["current","total"]},"codeRequest":{"type":"boolean"}},"required":["method","search","personal","fields","step"]}},"required":["ref","role","name","state","options","inputHint","inViewport","section","sensitive"]},"maxItems":400},"scroll":{"type":"object","properties":{"y":{"type":"number"},"h":{"type":"number"},"viewportH":{"type":"number"}},"required":["y","h","viewportH"]},"truncated":{"type":"boolean"},"needsUser":{"type":["string","null"],"enum":["login","captcha","payment",null]},"chat":{"type":["object","null"],"properties":{"surface":{"type":"string","enum":["page","widget"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^m\\d{1,5}$"},"sender":{"type":"string","enum":["me","bot","human","system","unknown"]},"name":{"type":["string","null"],"maxLength":60},"text":{"type":"string","maxLength":500},"time":{"type":["string","null"],"maxLength":24},"attachment":{"type":"boolean"}},"required":["id","sender","name","text","time","attachment"]},"maxItems":30},"total":{"type":"integer","minimum":0},"composer":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"send":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"attach":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"queue":{"type":["integer","null"],"minimum":0},"frameHost":{"type":["string","null"],"maxLength":253}},"required":["surface","messages","total","composer","send","attach","reception","queue"]},"lang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"chatFrame":{"type":["string","null"],"enum":["no_chat","unanswered",null]},"game":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["poker","blackjack","chess","xiangqi","go","gomoku","card","board","quiz","dice","unknown"]},"myTurn":{"type":["boolean","null"]},"mine":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"table":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"other":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":30},"pieces":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":64},"unreadable":{"type":"integer","minimum":0,"maximum":40},"numbers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","enum":["pot","stack","bet","small_blind","big_blind","score","opponent_score","balance","timer","round"]},"value":{"type":"number","minimum":0}},"required":["label","value"],"additionalProperties":false},"maxItems":12}},"required":["kind","myTurn","mine","table","other","pieces","unreadable","numbers"],"additionalProperties":false},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["documentId","viewSeq","url","title","dialogs","text","elements","scroll","truncated","needsUser"]},"delta":{"type":["object","null"],"properties":{"documentId":{"type":"string"},"baseSeq":{"type":"integer","minimum":0},"viewSeq":{"type":"integer","minimum":0},"added":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"role":{"type":"string","enum":["button","link","textbox","textarea","combobox","listbox","option","checkbox","radio","switch","slider","spinbutton","tab","menuitem","file","date","time","heading","dialog","img","other","frame"]},"name":{"type":"string","maxLength":120},"state":{"type":"object","properties":{"filled":{"type":["boolean","null"]},"checked":{"type":["boolean","null"]},"selected":{"type":["string","null"],"maxLength":120},"expanded":{"type":["boolean","null"]},"disabled":{"type":"boolean"},"required":{"type":"boolean"},"invalid":{"type":["string","null"],"maxLength":160}},"required":["filled","checked","selected","expanded","disabled","required","invalid"]},"options":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":40},"inputHint":{"type":["string","null"],"maxLength":40},"inViewport":{"type":"boolean"},"section":{"type":["string","null"],"maxLength":80},"sensitive":{"type":"string","enum":["none","submit","pay","file","login","password","captcha","wallet"]},"form":{"type":["object","null"],"properties":{"method":{"type":"string","enum":["get","post","dialog","none"]},"search":{"type":"boolean"},"personal":{"type":"boolean"},"fields":{"type":"integer","minimum":0,"maximum":999},"step":{"type":["object","null"],"properties":{"current":{"type":"integer","minimum":1,"maximum":99},"total":{"type":"integer","minimum":1,"maximum":99}},"required":["current","total"]},"codeRequest":{"type":"boolean"}},"required":["method","search","personal","fields","step"]}},"required":["ref","role","name","state","options","inputHint","inViewport","section","sensitive"]},"maxItems":400},"changed":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"role":{"type":"string","enum":["button","link","textbox","textarea","combobox","listbox","option","checkbox","radio","switch","slider","spinbutton","tab","menuitem","file","date","time","heading","dialog","img","other","frame"]},"name":{"type":"string","maxLength":120},"state":{"type":"object","properties":{"filled":{"type":["boolean","null"]},"checked":{"type":["boolean","null"]},"selected":{"type":["string","null"],"maxLength":120},"expanded":{"type":["boolean","null"]},"disabled":{"type":"boolean"},"required":{"type":"boolean"},"invalid":{"type":["string","null"],"maxLength":160}},"required":["filled","checked","selected","expanded","disabled","required","invalid"]},"options":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":40},"inputHint":{"type":["string","null"],"maxLength":40},"inViewport":{"type":"boolean"},"section":{"type":["string","null"],"maxLength":80},"sensitive":{"type":"string","enum":["none","submit","pay","file","login","password","captcha","wallet"]},"form":{"type":["object","null"],"properties":{"method":{"type":"string","enum":["get","post","dialog","none"]},"search":{"type":"boolean"},"personal":{"type":"boolean"},"fields":{"type":"integer","minimum":0,"maximum":999},"step":{"type":["object","null"],"properties":{"current":{"type":"integer","minimum":1,"maximum":99},"total":{"type":"integer","minimum":1,"maximum":99}},"required":["current","total"]},"codeRequest":{"type":"boolean"}},"required":["method","search","personal","fields","step"]}},"required":["ref","role","name","state","options","inputHint","inViewport","section","sensitive"]},"maxItems":400},"removed":{"type":"array","items":{"type":"string"},"maxItems":400},"newText":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":40},"dialogs":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"name":{"type":"string","maxLength":120}},"required":["ref","name"]}},"needsUser":{"type":["string","null"],"enum":["login","captcha","payment",null]},"chat":{"type":["object","null"],"properties":{"surface":{"type":"string","enum":["page","widget"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^m\\d{1,5}$"},"sender":{"type":"string","enum":["me","bot","human","system","unknown"]},"name":{"type":["string","null"],"maxLength":60},"text":{"type":"string","maxLength":500},"time":{"type":["string","null"],"maxLength":24},"attachment":{"type":"boolean"}},"required":["id","sender","name","text","time","attachment"]},"maxItems":30},"total":{"type":"integer","minimum":0},"composer":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"send":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"attach":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"queue":{"type":["integer","null"],"minimum":0},"frameHost":{"type":["string","null"],"maxLength":253}},"required":["surface","messages","total","composer","send","attach","reception","queue"]},"game":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["poker","blackjack","chess","xiangqi","go","gomoku","card","board","quiz","dice","unknown"]},"myTurn":{"type":["boolean","null"]},"mine":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"table":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":13},"other":{"type":"array","items":{"type":"string","pattern":"^[2-9TJQKA][shdc]$"},"maxItems":30},"pieces":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":64},"unreadable":{"type":"integer","minimum":0,"maximum":40},"numbers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","enum":["pot","stack","bet","small_blind","big_blind","score","opponent_score","balance","timer","round"]},"value":{"type":"number","minimum":0}},"required":["label","value"],"additionalProperties":false},"maxItems":12}},"required":["kind","myTurn","mine","table","other","pieces","unreadable","numbers"],"additionalProperties":false}},"required":["documentId","baseSeq","viewSeq","added","changed","removed","newText","dialogs","needsUser"]},"userReply":{"type":["string","null"],"maxLength":4000},"chatApproval":{"type":["object","null"],"properties":{"scope":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["scope","today","approvedAt","expiresAt"],"additionalProperties":false},"vaultConsented":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"vaultAvailable":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"actionId":{"type":["string","null"],"pattern":"^act_[a-z0-9]{10,32}$"},"userNote":{"type":["string","null"],"maxLength":4000},"attachments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["image","pdf","text"]},"mediaType":{"type":"string","enum":["image/jpeg","image/png","application/pdf","text/plain"]},"name":{"type":"string","maxLength":120},"data":{"type":"string","maxLength":5600000},"frame":{"type":["object","null"],"properties":{"index":{"type":"integer","minimum":0},"of":{"type":"integer","exclusiveMinimum":0},"atMs":{"type":"integer","minimum":0}},"required":["index","of","atMs"]}},"required":["kind","mediaType","name","data"],"additionalProperties":false},"maxItems":8},"pageShot":{"type":["object","null"],"properties":{"mediaType":{"type":"string","enum":["image/jpeg"]},"data":{"type":"string","maxLength":2100000,"pattern":"^[A-Za-z0-9+/=]+$"}},"required":["mediaType","data"]},"pageShots":{"type":["array","null"],"items":{"type":"object","properties":{"mediaType":{"type":"string","enum":["image/jpeg"]},"data":{"type":"string","maxLength":2100000,"pattern":"^[A-Za-z0-9+/=]+$"}},"required":["mediaType","data"]},"maxItems":8},"lookShot":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["viewport"]},"width":{"type":"integer","minimum":16,"maximum":4096},"height":{"type":"integer","minimum":16,"maximum":4096}},"required":["kind","width","height"]},"replyTo":{"type":["string","null"],"maxLength":300},"after":{"type":"integer","minimum":0},"personPath":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","maxLength":20},"name":{"type":"string","maxLength":60}},"required":["role","name"]},"maxItems":8}},"required":["outcomes","view","delta","userReply"],"additionalProperties":false}}}},"responses":{"200":{"description":"Next step","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"step":{"type":"integer","minimum":0},"narration":{"type":"string","maxLength":200},"actions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"tool":{"type":"string","enum":["click"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"}},"required":["tool","ref"]},{"type":"object","properties":{"tool":{"type":"string","enum":["fill"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"value":{"type":["string","null"],"maxLength":500},"vault":{"type":["string","null"],"enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country",null]}},"required":["tool","ref","value","vault"]},{"type":"object","properties":{"tool":{"type":"string","enum":["select"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"option":{"type":"string","maxLength":120}},"required":["tool","ref","option"]},{"type":"object","properties":{"tool":{"type":"string","enum":["check"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"on":{"type":"boolean"}},"required":["tool","ref","on"]},{"type":"object","properties":{"tool":{"type":"string","enum":["scroll"]},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"direction":{"type":["string","null"],"enum":["up","down",null]}},"required":["tool","ref","direction"]},{"type":"object","properties":{"tool":{"type":"string","enum":["press"]},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"key":{"type":"string","enum":["Enter","Tab","Escape","ArrowDown","ArrowUp"]}},"required":["tool","ref","key"]},{"type":"object","properties":{"tool":{"type":"string","enum":["navigate"]},"url":{"type":"string","maxLength":500,"format":"uri"}},"required":["tool","url"]},{"type":"object","properties":{"tool":{"type":"string","enum":["back"]}},"required":["tool"]},{"type":"object","properties":{"tool":{"type":"string","enum":["wait_for"]},"text":{"type":["string","null"],"maxLength":120},"ref":{"type":["string","null"],"pattern":"^e\\d{1,6}$"},"timeoutMs":{"type":"integer","minimum":100,"maximum":10000}},"required":["tool","text","ref","timeoutMs"]},{"type":"object","properties":{"tool":{"type":"string","enum":["send_message"]},"ref":{"type":"string","pattern":"^e\\d{1,6}$"},"text":{"type":"string","minLength":1,"maxLength":500},"scope":{"type":["object","null"],"properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"gloss":{"type":["string","null"],"maxLength":500}},"required":["tool","ref","text","scope"]},{"type":"object","properties":{"tool":{"type":"string","enum":["look"]}},"required":["tool"]},{"type":"object","properties":{"tool":{"type":"string","enum":["click_point"]},"x":{"type":"integer","minimum":0,"maximum":4096},"y":{"type":"integer","minimum":0,"maximum":4096},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["tool","x","y","label"]},{"type":"object","properties":{"tool":{"type":"string","enum":["open_side"]},"goal":{"type":"string","minLength":1,"maxLength":200},"query":{"type":["string","null"],"minLength":1,"maxLength":200},"url":{"type":["string","null"],"maxLength":500,"format":"uri"},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["tool","goal","query","url"]},{"type":"object","properties":{"tool":{"type":"string","enum":["switch_tab"]},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"}},"required":["tool","tab"]},{"type":"object","properties":{"tool":{"type":"string","enum":["close_side"]},"tab":{"type":"string","pattern":"^(main|s\\d{1,2})$"},"notes":{"type":"string","maxLength":1500},"sources":{"type":"array","items":{"type":"string","maxLength":500,"format":"uri"},"maxItems":5}},"required":["tool","tab","notes","sources"]},{"type":"object","properties":{"tool":{"type":"string","enum":["wait_reply"]},"timeoutMs":{"type":"integer","minimum":1000,"maximum":60000}},"required":["tool","timeoutMs"]},{"type":"object","properties":{"tool":{"type":"string","enum":["ask_user"]},"question":{"type":"string","maxLength":300},"choices":{"type":["array","null"],"items":{"type":"string","maxLength":80},"maxItems":6}},"required":["tool","question","choices"]},{"type":"object","properties":{"tool":{"type":"string","enum":["ask_vault"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"minItems":1,"maxItems":6}},"required":["tool","fields"]},{"type":"object","properties":{"tool":{"type":"string","enum":["handoff"]},"reason":{"type":"string","enum":["login","captcha","payment","submit","file","ambiguous","stuck"]},"message":{"type":"string","maxLength":300}},"required":["tool","reason","message"]},{"type":"object","properties":{"tool":{"type":"string","enum":["done"]},"summary":{"type":"string","maxLength":2000},"evidence":{"type":["string","null"],"maxLength":300},"outcome":{"type":"string","enum":["completed","draft_ready","not_possible","answered"]},"followUps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":3},"picks":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"integer","minimum":1,"maximum":50}},"required":["name","quantity"]},"minItems":1,"maxItems":12}},"required":["title","lines"]},"maxItems":3}},"required":["tool","summary","evidence","outcome"]}]},"minItems":1,"maxItems":12},"model":{"type":"string"},"latencyMs":{"type":"integer"},"escalated":{"type":"boolean"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","null"]},"kind":{"type":"string","enum":["address_as","preference","fact"]},"statement":{"type":"string","maxLength":200},"status":{"type":"string","enum":["saved","duplicate","refused","consent_required"]},"reason":{"type":["string","null"],"enum":["not_requested","sensitive","personal_value","too_many","invalid",null]}},"required":["id","kind","statement","status","reason"]},"maxItems":3},"brief":{"type":"object","properties":{"text":{"type":"string","maxLength":8000},"change":{"type":"string","maxLength":200},"version":{"type":"integer","exclusiveMinimum":0}},"required":["text","change","version"]},"reaction":{"type":"string","enum":["👍","👌","🫡","💪","🙏","❤️","😄","😂","🤔","👀","🎉","🔥"]},"plan":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":300},"scope":{"type":"string","minLength":1,"maxLength":300},"rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":30},"keyValues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"value":{"type":"string","minLength":1,"maxLength":300}},"required":["name","value"],"additionalProperties":false},"maxItems":40},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"doneWhen":{"type":"string","maxLength":300},"status":{"type":"string","enum":["todo","doing","done","blocked"]},"note":{"type":"string","maxLength":300}},"required":["title","doneWhen","status","note"],"additionalProperties":false},"minItems":1,"maxItems":40},"costs":{"type":"string","maxLength":300},"stops":{"type":"string","maxLength":300},"creditCap":{"type":"string","maxLength":300},"change":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"integer","exclusiveMinimum":0},"approved":{"type":"boolean"}},"required":["goal","scope","rules","keyValues","items","costs","stops","change","version"],"additionalProperties":false},"pageKind":{"type":"string","enum":["content","merchant","record"]}},"required":["runId","step","narration","actions","model","latencyMs","escalated"]}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Run state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"413":{"description":"Body or attachments over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/warm":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Warms the agent model's prompt cache when a page opens, before the person asks (latency). At most once per 50 minutes per instance; carries no page, goal or person data. Always 204.","responses":{"204":{"description":"Warmed, or nothing to do"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/transcribe":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Transcribes audio the person attached in the agent chat (an audio file, or a video's sound extracted on the phone) so it can go to the agent as a text attachment (owner decision 2026-11-01). Up to 10 MiB of audio; counts against the agent allowance. The audio and the transcript are kept in this request's memory only and never logged. 503 transcribe_unavailable when it is off.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mediaType":{"type":"string","enum":["audio/mp4","audio/aac","audio/mpeg","audio/wav","audio/ogg","audio/webm","audio/flac"]},"data":{"type":"string","minLength":4,"maxLength":13981018}},"required":["mediaType","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":100000},"noSpeech":{"type":"boolean"}},"required":["text","noSpeech"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"413":{"description":"Audio over the limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/events":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Run events from the phone (owner 2026-11-06): codes and counts only (start, end with its reason, app hidden/shown, a failed request with its code, a card shown, an automatic continue). Logged for tracing a run that stopped on the phone; nothing is stored.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["run_start","run_end","app_hidden","app_shown","paused","resumed","request_failed","reconnect","card_shown","handed_to_user","auto_continue","takeover","handback","view_failed"]},"code":{"type":["string","null"],"pattern":"^[a-z0-9_:-]{1,48}$"},"step":{"type":["integer","null"],"minimum":0},"ms":{"type":"integer","minimum":0,"maximum":604800000}},"required":["kind","code","step","ms"],"additionalProperties":false},"minItems":1,"maxItems":30}},"required":["events"],"additionalProperties":false}}}},"responses":{"204":{"description":"Logged"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/cancel":{"post":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"state":{"type":"string","enum":["running","waiting_user","waiting_reply","paused","completed","draft_ready","not_possible","answered","failed","cancelled"]},"capability":{"type":"string","enum":["verified","unverified"]},"startSite":{"type":"string"},"webRisk":{"type":"string","enum":["safe","unverified","unsafe"]},"step":{"type":"integer","minimum":0},"cost":{"type":"object","properties":{"steps":{"type":"integer"},"modelCalls":{"type":"integer"},"inputTokens":{"type":"integer"},"cachedInputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"actions":{"type":"integer"},"wallMs":{"type":"integer"},"route":{"type":"string","enum":["agent","template","api","local"]}},"required":["steps","modelCalls","inputTokens","cachedInputTokens","outputTokens","actions","wallMs","route"]},"intentId":{"type":["string","null"]},"chat":{"type":["object","null"],"properties":{"taskId":{"type":"string"},"state":{"type":"string"},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"messagesSent":{"type":"integer"},"businessRef":{"type":["string","null"]}},"required":["taskId","state","reception","messagesSent","businessRef"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"}},"required":["runId","state","capability","startSite","webRisk","step","cost","createdAt","updatedAt","version"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Run state and cost ledger (steps, model calls, input/cached/output tokens, actions, wall time, route). Never the goal or page content.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"state":{"type":"string","enum":["running","waiting_user","waiting_reply","paused","completed","draft_ready","not_possible","answered","failed","cancelled"]},"capability":{"type":"string","enum":["verified","unverified"]},"startSite":{"type":"string"},"webRisk":{"type":"string","enum":["safe","unverified","unsafe"]},"step":{"type":"integer","minimum":0},"cost":{"type":"object","properties":{"steps":{"type":"integer"},"modelCalls":{"type":"integer"},"inputTokens":{"type":"integer"},"cachedInputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"actions":{"type":"integer"},"wallMs":{"type":"integer"},"route":{"type":"string","enum":["agent","template","api","local"]}},"required":["steps","modelCalls","inputTokens","cachedInputTokens","outputTokens","actions","wallMs","route"]},"intentId":{"type":["string","null"]},"chat":{"type":["object","null"],"properties":{"taskId":{"type":"string"},"state":{"type":"string"},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"messagesSent":{"type":"integer"},"businessRef":{"type":["string","null"]}},"required":["taskId","state","reception","messagesSent","businessRef"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"}},"required":["runId","state","capability","startSite","webRisk","step","cost","createdAt","updatedAt","version"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/grants":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Records a SubmitGrant (D13: the person confirmed one form submit on the device card) or a PaymentGrant (D17: one system-wallet payment up to a cap), signed on the device (ES256, raw r||s, base64url). Verified against the registered device key; scope, lifetime (~2 min), single use and, after an outcome_unknown, the retry rule (D20) are checked. Field values never reach the server: only a salted digest.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"grant_id":{"type":"string"},"kind":{"type":"string","enum":["submit","payment"]},"run_id":{"type":"string"},"site":{"type":"string"},"state":{"type":"string","enum":["recorded","claimed","reported"]},"outcome":{"type":["string","null"],"enum":["confirmed","not_landed","progressed","outcome_unknown",null]},"expires_at":{"type":"string"}},"required":["grant_id","kind","run_id","site","state","outcome","expires_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown run","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/grants/{gid}/claim":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"The device executor, right before the one tap: what the live page shows now (field digest or amount, origin, document, epoch). Consumes the grant (single use); any difference is refused and the device does not tap.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^(sgr|pgr)_[a-z0-9]{10,32}$"},"required":true,"name":"gid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"grant_id":{"type":"string"},"kind":{"type":"string","enum":["submit","payment"]},"run_id":{"type":"string"},"site":{"type":"string"},"state":{"type":"string","enum":["recorded","claimed","reported"]},"outcome":{"type":["string","null"],"enum":["confirmed","not_landed","progressed","outcome_unknown",null]},"expires_at":{"type":"string"}},"required":["grant_id","kind","run_id","site","state","outcome","expires_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown grant","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/runs/{id}/grants/{gid}/report":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"The outcome the device read back after the tap: confirmed (page, history or email), not_landed (the page shows the form with an error), progressed, or outcome_unknown. outcome_unknown may later be settled by the re-check; it is never resubmitted automatically.","parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^(sgr|pgr)_[a-z0-9]{10,32}$"},"required":true,"name":"gid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["confirmed","not_landed","progressed","outcome_unknown"]},"source":{"type":"string","enum":["page","recheck_page","history","email"]},"business_ref":{"type":["string","null"],"maxLength":40}},"required":["outcome","source","business_ref"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"grant_id":{"type":"string"},"kind":{"type":"string","enum":["submit","payment"]},"run_id":{"type":"string"},"site":{"type":"string"},"state":{"type":"string","enum":["recorded","claimed","reported"]},"outcome":{"type":["string","null"],"enum":["confirmed","not_landed","progressed","outcome_unknown",null]},"expires_at":{"type":"string"}},"required":["grant_id","kind","run_id","site","state","outcome","expires_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown grant","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/standing-consents":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Registers a StandingSubmitConsent (D27: \"以后这个网站这类表单直接提交\" ticked on a confirmation card): registrable domain + form structure signature (no values), signed on the device. Verified against the registered device key and tied to the card's recorded submit grant. Never for money wording or password / card / one-time code / captcha / file fields. A SubmitGrant that names it (standing_consent_id) is recorded only while it is active and the domain and form signature match.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"consent_id":{"type":"string"},"site":{"type":"string"},"origin":{"type":"string"},"form_signature":{"type":"string"},"form_title":{"type":"string"},"target_name":{"type":"string"},"field_names":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"revoked_at":{"type":["string","null"]}},"required":["consent_id","site","origin","form_signature","form_title","target_name","field_names","created_at","revoked_at"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"FirebaseIdToken":[]}],"description":"The caller's active standing submit consents (Settings → 隐私与数据 → 直接提交的网站), newest first.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"consents":{"type":"array","items":{"type":"object","properties":{"consent_id":{"type":"string"},"site":{"type":"string"},"origin":{"type":"string"},"form_signature":{"type":"string"},"form_title":{"type":"string"},"target_name":{"type":"string"},"field_names":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"revoked_at":{"type":["string","null"]}},"required":["consent_id","site","origin","form_signature","form_title","target_name","field_names","created_at","revoked_at"],"additionalProperties":false}}},"required":["consents"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"delete":{"security":[{"FirebaseIdToken":[]}],"description":"Revokes every active standing consent of the caller.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"integer","minimum":0}},"required":["revoked"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/agent/standing-consents/{cid}":{"delete":{"security":[{"FirebaseIdToken":[]}],"description":"Revokes one standing consent at once: grants naming it are refused from now on (record and claim). Idempotent.","parameters":[{"schema":{"type":"string","pattern":"^scn_[a-z0-9]{10,32}$"},"required":true,"name":"cid","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"consent_id":{"type":"string"},"site":{"type":"string"},"origin":{"type":"string"},"form_signature":{"type":"string"},"form_title":{"type":"string"},"target_name":{"type":"string"},"field_names":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"revoked_at":{"type":["string","null"]}},"required":["consent_id","site","origin","form_signature","form_title","target_name","field_names","created_at","revoked_at"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown consent","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/intents":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Opens an intent: one per user goal, carried across channels. The goal is stored only as a hash and length.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":1000},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]}},"required":["goal","object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"state":{"type":"string","enum":["open","confirmed","closed"]},"goal_chars":{"type":"integer"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["intent_id","state","goal_chars","object","version","created_at","updated_at"]},"plans":{"type":"array","items":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"recipient":{"type":"object","properties":{"site":{"type":"string","maxLength":200},"tenant":{"type":["string","null"],"maxLength":120},"kind":{"type":"string","enum":["merchant","service_agent","person"]}},"required":["site","tenant","kind"]},"channel":{"type":"string","enum":["web_form","h5_chat","telegram","email","phone","system","api","a2a"]},"scope":{"type":["object","null"],"properties":{"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]},"goalChars":{"type":"integer","minimum":0},"approvedAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["shareFields","maxPrice","window","goalChars","approvedAt","expiresAt"]},"criteria":{"type":"object","properties":{"kind":{"type":"string","enum":["business_confirmed","receipt","user_confirmed"]},"needsReference":{"type":"boolean"},"confirmedBy":{"type":"array","items":{"type":"string","enum":["human","bot","system","api","peer_agent"]},"minItems":1}},"required":["kind","needsReference","confirmedBy"]},"state":{"type":"string","enum":["draft","approved","expired","revoked","done"]},"created_at":{"type":"string"}},"required":["plan_id","intent_id","object","recipient","channel","scope","criteria","state","created_at"]}},"tasks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["h5_chat"]},"adapter":{"type":"object","properties":{"id":{"type":"string","maxLength":60},"version":{"type":"string","maxLength":20}},"required":["id","version"]},"session_ref":{"type":"string","maxLength":80},"last_message_ref":{"type":["string","null"],"maxLength":80},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"queue":{"type":["integer","null"]},"capabilities":{"type":"object","properties":{"canSend":{"type":"boolean"},"canRead":{"type":"boolean"},"attachments":{"type":"boolean"},"humanHandoff":{"type":"boolean"},"backgroundResume":{"type":"boolean"}},"required":["canSend","canRead","attachments","humanHandoff","backgroundResume"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","adapter","session_ref","last_message_ref","reception","queue","capabilities","messages_sent","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["email"]},"provider":{"type":"string","enum":["gmail","outlook"]},"from_account":{"type":"string","maxLength":200},"recipients":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"subject_chars":{"type":"integer","minimum":0},"message_id":{"type":["string","null"],"maxLength":300},"thread_ref":{"type":["string","null"],"maxLength":300},"attachment_refs":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":10},"messages_sent":{"type":"integer","minimum":0},"auto_follow_ups":{"type":"integer","minimum":0},"replies_seen":{"type":"integer","minimum":0},"last_reply_ref":{"type":["string","null"],"maxLength":64},"pause_reason":{"type":["string","null"],"maxLength":60},"state":{"type":"string","enum":["DRAFT_READY","SEND_ACCEPTED","BOUNCED","WAITING_REPLY","USER_HANDOFF_REQUIRED","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","provider","from_account","recipients","subject_chars","message_id","thread_ref","attachment_refs","messages_sent","auto_follow_ups","replies_seen","last_reply_ref","pause_reason","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["call"]},"target":{"type":"string","maxLength":200},"number_ref":{"type":"string","maxLength":64},"language":{"type":"string","maxLength":10},"platform":{"type":"string","enum":["android","ios"]},"local_call_ref":{"type":["string","null"],"maxLength":80},"device_capabilities":{"type":"object","properties":{"dial":{"type":"boolean"},"downlinkRead":{"type":"boolean"},"uplinkInject":{"type":"boolean"}},"required":["dial","downlinkRead","uplinkInject"]},"budget":{"type":"object","properties":{"attempts":{"type":"integer"},"maxMinutes":{"type":"integer"}},"required":["attempts","maxMinutes"]},"attempts":{"type":"integer","minimum":0},"last_outcome":{"type":["string","null"],"maxLength":20},"script_digest":{"type":"string","maxLength":64},"script_chars":{"type":"integer","minimum":0},"state":{"type":"string","enum":["DIAL_REQUESTED","CALL_CONNECTED","VERBAL_CONFIRMED","BUSINESS_ACCEPTED","LOCAL_AUDIO_UNAVAILABLE","SYSTEM_PERMISSION_REQUIRED","USER_HANDOFF_REQUIRED","CALL_OUTCOME_UNKNOWN"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","target","number_ref","language","platform","local_call_ref","device_capabilities","budget","attempts","last_outcome","script_digest","script_chars","state"]}]}},"confirmedRefs":{"type":"array","items":{"type":"string"}}},"required":["intent","plans","tasks","confirmedRefs"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/intents/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Everything to check before switching channel: the intent (with its version), its plans, its channel tasks (observed states, reception, counts, business references) and the references already confirmed. Never message bodies or personal values.","parameters":[{"schema":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"state":{"type":"string","enum":["open","confirmed","closed"]},"goal_chars":{"type":"integer"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["intent_id","state","goal_chars","object","version","created_at","updated_at"]},"plans":{"type":"array","items":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"recipient":{"type":"object","properties":{"site":{"type":"string","maxLength":200},"tenant":{"type":["string","null"],"maxLength":120},"kind":{"type":"string","enum":["merchant","service_agent","person"]}},"required":["site","tenant","kind"]},"channel":{"type":"string","enum":["web_form","h5_chat","telegram","email","phone","system","api","a2a"]},"scope":{"type":["object","null"],"properties":{"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]},"goalChars":{"type":"integer","minimum":0},"approvedAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["shareFields","maxPrice","window","goalChars","approvedAt","expiresAt"]},"criteria":{"type":"object","properties":{"kind":{"type":"string","enum":["business_confirmed","receipt","user_confirmed"]},"needsReference":{"type":"boolean"},"confirmedBy":{"type":"array","items":{"type":"string","enum":["human","bot","system","api","peer_agent"]},"minItems":1}},"required":["kind","needsReference","confirmedBy"]},"state":{"type":"string","enum":["draft","approved","expired","revoked","done"]},"created_at":{"type":"string"}},"required":["plan_id","intent_id","object","recipient","channel","scope","criteria","state","created_at"]}},"tasks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["h5_chat"]},"adapter":{"type":"object","properties":{"id":{"type":"string","maxLength":60},"version":{"type":"string","maxLength":20}},"required":["id","version"]},"session_ref":{"type":"string","maxLength":80},"last_message_ref":{"type":["string","null"],"maxLength":80},"reception":{"type":"string","enum":["bot","human","queue","offline","unknown"]},"queue":{"type":["integer","null"]},"capabilities":{"type":"object","properties":{"canSend":{"type":"boolean"},"canRead":{"type":"boolean"},"attachments":{"type":"boolean"},"humanHandoff":{"type":"boolean"},"backgroundResume":{"type":"boolean"}},"required":["canSend","canRead","attachments","humanHandoff","backgroundResume"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","adapter","session_ref","last_message_ref","reception","queue","capabilities","messages_sent","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["email"]},"provider":{"type":"string","enum":["gmail","outlook"]},"from_account":{"type":"string","maxLength":200},"recipients":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"subject_chars":{"type":"integer","minimum":0},"message_id":{"type":["string","null"],"maxLength":300},"thread_ref":{"type":["string","null"],"maxLength":300},"attachment_refs":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":10},"messages_sent":{"type":"integer","minimum":0},"auto_follow_ups":{"type":"integer","minimum":0},"replies_seen":{"type":"integer","minimum":0},"last_reply_ref":{"type":["string","null"],"maxLength":64},"pause_reason":{"type":["string","null"],"maxLength":60},"state":{"type":"string","enum":["DRAFT_READY","SEND_ACCEPTED","BOUNCED","WAITING_REPLY","USER_HANDOFF_REQUIRED","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","provider","from_account","recipients","subject_chars","message_id","thread_ref","attachment_refs","messages_sent","auto_follow_ups","replies_seen","last_reply_ref","pause_reason","state"]},{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["call"]},"target":{"type":"string","maxLength":200},"number_ref":{"type":"string","maxLength":64},"language":{"type":"string","maxLength":10},"platform":{"type":"string","enum":["android","ios"]},"local_call_ref":{"type":["string","null"],"maxLength":80},"device_capabilities":{"type":"object","properties":{"dial":{"type":"boolean"},"downlinkRead":{"type":"boolean"},"uplinkInject":{"type":"boolean"}},"required":["dial","downlinkRead","uplinkInject"]},"budget":{"type":"object","properties":{"attempts":{"type":"integer"},"maxMinutes":{"type":"integer"}},"required":["attempts","maxMinutes"]},"attempts":{"type":"integer","minimum":0},"last_outcome":{"type":["string","null"],"maxLength":20},"script_digest":{"type":"string","maxLength":64},"script_chars":{"type":"integer","minimum":0},"state":{"type":"string","enum":["DIAL_REQUESTED","CALL_CONNECTED","VERBAL_CONFIRMED","BUSINESS_ACCEPTED","LOCAL_AUDIO_UNAVAILABLE","SYSTEM_PERMISSION_REQUIRED","USER_HANDOFF_REQUIRED","CALL_OUTCOME_UNKNOWN"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","target","number_ref","language","platform","local_call_ref","device_capabilities","budget","attempts","last_outcome","script_digest","script_chars","state"]}]}},"confirmedRefs":{"type":"array","items":{"type":"string"}}},"required":["intent","plans","tasks","confirmedRefs"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/intents/{id}/plans":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Opens a plan on another channel. `seenVersion` must be the version GET /v1/intents/{id} returned (409 intent_changed otherwise); with a confirmed reference or a task still waiting, the plan must name `followUpRef` (409 intent_already_confirmed / intent_task_open).","parameters":[{"schema":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["web_form","h5_chat","telegram","email","phone","system","api","a2a"]},"recipient":{"type":"object","properties":{"site":{"type":"string","maxLength":200},"tenant":{"type":["string","null"],"maxLength":120},"kind":{"type":"string","enum":["merchant","service_agent","person"]}},"required":["site","tenant","kind"]},"criteria":{"type":"object","properties":{"kind":{"type":"string","enum":["business_confirmed","receipt","user_confirmed"]},"needsReference":{"type":"boolean"},"confirmedBy":{"type":"array","items":{"type":"string","enum":["human","bot","system","api","peer_agent"]},"minItems":1}},"required":["kind","needsReference","confirmedBy"]},"seenVersion":{"type":"integer"},"followUpRef":{"type":["string","null"],"maxLength":60}},"required":["channel","recipient","criteria","seenVersion","followUpRef"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200},"object_id":{"type":"string","maxLength":200}},"required":["issuer","object_id"]},"recipient":{"type":"object","properties":{"site":{"type":"string","maxLength":200},"tenant":{"type":["string","null"],"maxLength":120},"kind":{"type":"string","enum":["merchant","service_agent","person"]}},"required":["site","tenant","kind"]},"channel":{"type":"string","enum":["web_form","h5_chat","telegram","email","phone","system","api","a2a"]},"scope":{"type":["object","null"],"properties":{"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]},"goalChars":{"type":"integer","minimum":0},"approvedAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["shareFields","maxPrice","window","goalChars","approvedAt","expiresAt"]},"criteria":{"type":"object","properties":{"kind":{"type":"string","enum":["business_confirmed","receipt","user_confirmed"]},"needsReference":{"type":"boolean"},"confirmedBy":{"type":"array","items":{"type":"string","enum":["human","bot","system","api","peer_agent"]},"minItems":1}},"required":["kind","needsReference","confirmedBy"]},"state":{"type":"string","enum":["draft","approved","expired","revoked","done"]},"created_at":{"type":"string"}},"required":["plan_id","intent_id","object","recipient","channel","scope","criteria","state","created_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Intent changed or already confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/link":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"A one-time code (10 min) and the deep link t.me/<bot>?start=<code>. Opening it in Telegram links that Telegram account to the caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deepLink":{"type":["string","null"]},"botUsername":{"type":["string","null"]},"expiresAt":{"type":"string"}},"required":["deepLink","botUsername","expiresAt"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/status":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Link and business-connection status (enabled, can_reply), chats seen, last activity, notices on or off.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"botUsername":{"type":["string","null"]},"linked":{"type":"boolean"},"linkedAt":{"type":["string","null"]},"connection":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"canReply":{"type":"boolean"},"connectedAt":{"type":"string"}},"required":["enabled","canReply","connectedAt"]},"chatsSeen":{"type":"integer","minimum":0},"lastActivityAt":{"type":["string","null"]},"notify":{"type":"boolean"}},"required":["configured","botUsername","linked","linkedAt","connection","chatsSeen","lastActivityAt","notify"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/notify":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Turns generic task notices in the person's own chat with the bot on or off.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notify":{"type":"boolean"}},"required":["notify"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"botUsername":{"type":["string","null"]},"linked":{"type":"boolean"},"linkedAt":{"type":["string","null"]},"connection":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"canReply":{"type":"boolean"},"connectedAt":{"type":"string"}},"required":["enabled","canReply","connectedAt"]},"chatsSeen":{"type":"integer","minimum":0},"lastActivityAt":{"type":["string","null"]},"notify":{"type":"boolean"}},"required":["configured","botUsername","linked","linkedAt","connection","chatsSeen","lastActivityAt","notify"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/disconnect":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Forgets the link and its business connections; open tasks pause. The person also removes the bot in Telegram → Telegram Business → Chatbots.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"botUsername":{"type":["string","null"]},"linked":{"type":"boolean"},"linkedAt":{"type":["string","null"]},"connection":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"canReply":{"type":"boolean"},"connectedAt":{"type":"string"}},"required":["enabled","canReply","connectedAt"]},"chatsSeen":{"type":"integer","minimum":0},"lastActivityAt":{"type":["string","null"]},"notify":{"type":"boolean"}},"required":["configured","botUsername","linked","linkedAt","connection","chatsSeen","lastActivityAt","notify"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/tasks":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Opens a Telegram task with the scope the person approved (D11) and returns a first-message draft (not stored). The person sends the first message themselves in Telegram.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"peer":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{3,30}[A-Za-z0-9]$"},"approval":{"type":"object","properties":{"scope":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["scope","today","approvedAt","expiresAt"],"additionalProperties":false},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false}},"required":["intentId","peer","approval","locale"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},"pause":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["scope_field","scope_price","scope_time","scope_expired","chat_payment","attachment","personal_fields","sensitive","reply_window","cannot_reply","not_connected","send_cap","unclear"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}}},"required":["reason","fields"]},"openUrl":{"type":"string"},"autoSent":{"type":"integer","minimum":0},"draft":{"type":"string","maxLength":1000},"outbound":{"type":"object","properties":{"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["locale","subject","text"],"additionalProperties":false},"gloss":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["machine_translation"]},"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["kind","locale","subject","text"],"additionalProperties":false}},"required":["task","pause","openUrl","autoSent","draft","outbound","gloss"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"FirebaseIdToken":[]}],"description":"The caller's Telegram tasks, newest first (at most 20).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"task":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},"pause":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["scope_field","scope_price","scope_time","scope_expired","chat_payment","attachment","personal_fields","sensitive","reply_window","cannot_reply","not_connected","send_cap","unclear"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}}},"required":["reason","fields"]},"openUrl":{"type":"string"},"autoSent":{"type":"integer","minimum":0}},"required":["task","pause","openUrl","autoSent"]}}},"required":["tasks"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/tasks/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"One Telegram task: observed state, pause reason, reply window.","parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},"pause":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["scope_field","scope_price","scope_time","scope_expired","chat_payment","attachment","personal_fields","sensitive","reply_window","cannot_reply","not_connected","send_cap","unclear"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}}},"required":["reason","fields"]},"openUrl":{"type":"string"},"autoSent":{"type":"integer","minimum":0}},"required":["task","pause","openUrl","autoSent"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/tasks/{id}/first-message":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Records the digest and length of the first message the person is about to send (computed on the device; the text is not sent).","parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"chars":{"type":"integer","minimum":1,"maximum":4096}},"required":["sha256","chars"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},"pause":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["scope_field","scope_price","scope_time","scope_expired","chat_payment","attachment","personal_fields","sensitive","reply_window","cannot_reply","not_connected","send_cap","unclear"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}}},"required":["reason","fields"]},"openUrl":{"type":"string"},"autoSent":{"type":"integer","minimum":0}},"required":["task","pause","openUrl","autoSent"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/telegram/tasks/{id}/close":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"The person closes the task; the bot stops following up.","parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["message"]},"platform":{"type":"string","enum":["telegram","whatsapp","other"]},"acting_account":{"type":"string","maxLength":120},"conversation_ref":{"type":"string","maxLength":120},"peer":{"type":"string","maxLength":120},"last_message_ref":{"type":["string","null"],"maxLength":120},"reply_window_ends_at":{"type":["string","null"]},"messages_sent":{"type":"integer","minimum":0},"state":{"type":"string","enum":["SESSION_READY","MESSAGE_SENT","WAITING_REPLY","HUMAN_HANDOFF","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","USER_HANDOFF_REQUIRED","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","platform","acting_account","conversation_ref","peer","last_message_ref","reply_window_ends_at","state"]},"pause":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["scope_field","scope_price","scope_time","scope_expired","chat_payment","attachment","personal_fields","sensitive","reply_window","cannot_reply","not_connected","send_cap","unclear"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}}},"required":["reason","fields"]},"openUrl":{"type":"string"},"autoSent":{"type":"integer","minimum":0}},"required":["task","pause","openUrl","autoSent"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not linked, or a task is already open","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Telegram bot not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/visits":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Second visit (whitepaper §11.2): the caller's verified orders (own lines only) and feedback at one merchant object, each with its source events.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]}},"required":["object"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"verified_order_count":{"type":"integer","minimum":0},"last_visit_at":{"type":["string","null"]},"dishes":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"name":{"type":"string","maxLength":200},"times_ordered":{"type":"integer","minimum":0},"last_ordered_at":{"type":"string"},"feedback":{"type":["object","null"],"properties":{"verdict":{"type":["string","null"],"enum":["up","down",null]},"tags":{"type":"array","items":{"type":"string","enum":["too_spicy","too_salty","too_sweet","too_oily","small_portion","large_portion"]}},"event_id":{"type":"string","maxLength":120},"occurred_at":{"type":"string"}},"required":["verdict","tags","event_id","occurred_at"]},"sources":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["order","feedback"]},"event_id":{"type":"string","maxLength":120},"task_id":{"type":["string","null"],"maxLength":80},"order_ref":{"type":["string","null"],"maxLength":120},"occurred_at":{"type":"string"}},"required":["kind","event_id","task_id","order_ref","occurred_at"]}}},"required":["item_id","name","times_ordered","last_ordered_at","feedback","sources"]}}},"required":["object","verified_order_count","last_visit_at","dishes"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Memory is off for this anonymous user (memory_consent_required)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Already approved","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/feedback/pending":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"Recent verified orders whose own dishes still have no post-meal feedback (30 min after acceptance, or once fulfilled).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"prompts":{"type":"array","items":{"type":"object","properties":{"order_event_id":{"type":"string","maxLength":120},"task_id":{"type":["string","null"],"maxLength":80},"order_ref":{"type":["string","null"],"maxLength":120},"occurred_at":{"type":"string"},"object":{"type":["object","null"],"properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","maxLength":120},"name":{"type":"string","maxLength":200}},"required":["item_id","name"]}}},"required":["order_event_id","task_id","order_ref","occurred_at","object","items"]}}},"required":["prompts"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Memory is off for this anonymous user (memory_consent_required)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Already approved","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/memory/feedback":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Post-meal feedback on one dish the caller ordered for themselves. Taste and portion only; allergen, diet or health text is refused (422 sensitive_text).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_event_id":{"type":"string","minLength":1,"maxLength":120},"item_id":{"type":"string","minLength":1,"maxLength":120},"verdict":{"type":["string","null"],"enum":["up","down",null]},"tags":{"type":"array","items":{"type":"string","enum":["too_spicy","too_salty","too_sweet","too_oily","small_portion","large_portion"]},"maxItems":6},"text":{"type":["string","null"],"maxLength":200}},"required":["order_event_id","item_id","verdict","tags"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"event_id":{"type":"string"},"status":{"type":"string","enum":["accepted","duplicate","tombstoned"]}},"required":["event_id","status"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Memory is off for this anonymous user (memory_consent_required)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Already approved","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/plans/{id}/reject":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Rejects a drafted plan. It can never be granted afterwards.","parameters":[{"schema":{"type":"string","pattern":"^pln_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan_id":{"type":"string"},"state":{"type":"string","enum":["rejected"]},"rejected_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?(Z|[+-]\\d{2}:\\d{2})$"}},"required":["plan_id","state","rejected_at"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"403":{"description":"Memory is off for this anonymous user (memory_consent_required)","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Already approved","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates":{"get":{"security":[{"LabToken":[]}],"description":"ExecutionTemplate versions, newest change first.","parameters":[{"schema":{"type":"string","maxLength":253},"required":false,"name":"host","in":"query"},{"schema":{"type":"string","enum":["draft","testing","published","paused","retired"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["templates"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/versions/{v}":{"get":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/events":{"get":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["events"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/versions/{v}/test":{"post":{"security":[{"LabToken":[]}],"description":"draft or paused → testing. The next matching run on a FIXTURE form-lab host replays it; a pass is recorded as test evidence.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/versions/{v}/publish":{"post":{"security":[{"LabToken":[]}],"description":"testing → published, only after a passing FIXTURE replay of this version (zero model calls). The previous published version retires.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/versions/{v}/pause":{"post":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100000},"required":true,"name":"v","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":120}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/templates/{id}/versions/{v}/retire":{"post":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/bindings":{"post":{"security":[{"LabToken":[]}],"description":"Creates a pending binding of an existing code and issues its verification token. sample_url is read once and never stored; only store or tenant ids may be pinned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"merchant":{"type":"object","properties":{"issuer":{"type":"string","maxLength":200,"pattern":"^(https:\\/\\/[a-z0-9.-]+(:\\d+)?|scanro:[a-z0-9._-]+)$"},"object_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~:/@-]+$"}},"required":["issuer","object_id"]},"merchant_type":{"type":"string","enum":["restaurant_venue","restaurant_table","product","device","facility","parking_site","charging_point","parcel_locker","exhibit","event_session","asset","other"]},"display_name":{"type":"string","minLength":1,"maxLength":120},"sample_url":{"type":"string","maxLength":2000,"format":"uri"},"entry":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"path_pattern":{"type":"string","minLength":1,"maxLength":300,"pattern":"^\\/[A-Za-z0-9._~%!$&'()+,;=:@*/-]*$"},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[A-Za-z0-9_.-]+$"},"kind":{"type":"string","enum":["store","tenant","table","session","signature","other"]},"equals":{"type":["string","null"],"maxLength":40}},"required":["name","kind","equals"],"additionalProperties":false},"maxItems":8}},"required":["host","path_pattern","params"],"additionalProperties":false},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[A-Za-z0-9_.-]+$"},"kind":{"type":"string","enum":["store","tenant","table","session","signature","other"]},"equals":{"type":["string","null"],"maxLength":40}},"required":["name","kind","equals"],"additionalProperties":false},"maxItems":8},"method":{"type":"string","enum":["dns_txt","well_known","platform_account"]},"capabilities":{"type":"object","properties":{"api_adapter":{"type":["string","null"],"maxLength":200},"template_ids":{"type":"array","items":{"type":"string","pattern":"^tpl_[a-z0-9]{10,32}$"},"maxItems":20},"h5_chat":{"type":"boolean"}},"required":["api_adapter","template_ids","h5_chat"],"additionalProperties":false}},"required":["merchant","display_name","method"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}},"get":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":253},"required":false,"name":"host","in":"query"},{"schema":{"type":"string","enum":["pending","active","suspended","revoked","expired"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["bindings"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/bindings/{id}":{"get":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/bindings/{id}/verify":{"post":{"security":[{"LabToken":[]}],"description":"Checks the DNS TXT record or the /.well-known file for the token.","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/bindings/{id}/approve":{"post":{"security":[{"LabToken":[]}],"description":"Owner approval of a platform-account linkage (manual review).","parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/bindings/{id}/revoke":{"post":{"security":[{"LabToken":[]}],"parameters":[{"schema":{"type":"string","maxLength":60},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Not allowed in this state","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/email/draft":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Drafts the first email of a task (subject, body with {{field}} vault placeholders, proposed follow-up scope). Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"goal":{"type":"string","minLength":1,"maxLength":1000},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"merchant":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":200},"name":{"type":["string","null"],"maxLength":120}},"required":["domain","name"],"additionalProperties":false},"vaultAvailable":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"seed":{"type":["object","null"],"properties":{"subject":{"type":"string","maxLength":200},"body":{"type":"string","maxLength":1000}},"required":["subject","body"],"additionalProperties":false}},"required":["intentId","goal","locale","today","merchant","vaultAvailable","seed"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":4000},"scope":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"outbound":{"type":"object","properties":{"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["locale","subject","text"],"additionalProperties":false},"gloss":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["machine_translation"]},"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["kind","locale","subject","text"],"additionalProperties":false},"personLocale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"flags":{"type":"array","items":{"type":"string","enum":["payment"]}},"model":{"type":"string"},"provider":{"type":"string"}},"required":["subject","body","scope","outbound","gloss","personLocale","fields","flags","model","provider"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"502":{"description":"Model draft refused by the checks","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/email/read-reply":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Reads a merchant reply (quoted history and vault values removed on the phone): confirmed with a reference, a question, an offer, out of scope, and the follow-up to send. A confirmation stands only on an exact line of a reply from the merchant quoting a reference. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"goal":{"type":"string","minLength":1,"maxLength":1000},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false},"merchant":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":200},"name":{"type":["string","null"],"maxLength":120}},"required":["domain","name"],"additionalProperties":false},"approval":{"type":"object","properties":{"scope":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["scope","today","approvedAt","expiresAt"],"additionalProperties":false},"vaultAvailable":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"reply":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":6000},"fromMerchant":{"type":"boolean"},"automated":{"type":"boolean"}},"required":["text","fromMerchant","automated"],"additionalProperties":false},"sent":{"type":"array","items":{"type":"string","maxLength":4000},"maxItems":3}},"required":["intentId","goal","locale","merchant","approval","vaultAvailable","reply","sent"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["confirmed","question","offer","declined","auto_reply","other"]},"businessRef":{"type":["string","null"],"maxLength":60},"evidence":{"type":["string","null"],"maxLength":300},"summary":{"type":["string","null"],"maxLength":300},"outsideScope":{"type":"boolean"},"outsideReason":{"type":["string","null"],"enum":["scope_field","scope_price","scope_time","scope_expired","payment","needs_attachment","new_recipient","cost","question","limit","other",null]},"followUp":{"type":["object","null"],"properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"language":{"type":["string","null"],"maxLength":35},"translation":{"type":["string","null"],"maxLength":4000}},"required":["body"]},"outbound":{"type":["object","null"],"properties":{"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["locale","subject","text"],"additionalProperties":false},"gloss":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["machine_translation"]},"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["kind","locale","subject","text"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"model":{"type":"string"},"provider":{"type":"string"}},"required":["kind","businessRef","evidence","summary","outsideScope","outsideReason","followUp","outbound","gloss","fields","model","provider"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"502":{"description":"Model reading refused","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/email/tasks":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Records an email task after the person approved the first email on the phone (D11). Addresses arrive only as emailAddressRef digests. With an intentId, seenVersion must be the version GET /v1/intents/{id} returned (409 intent_changed); one live task per intent and recipient (409 email_task_exists).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"seenVersion":{"type":["integer","null"]},"followUpRef":{"type":["string","null"],"maxLength":60},"goal":{"type":"string","minLength":1,"maxLength":1000},"recipientRef":{"type":"string","pattern":"^[0-9a-f]{64}$"},"fromAccountRef":{"type":"string","pattern":"^[0-9a-f]{64}$"},"merchantDomain":{"type":"string","minLength":1,"maxLength":200},"subjectChars":{"type":"integer","minimum":0,"maximum":200},"approval":{"type":"object","properties":{"scope":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":200},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"maxPrice":{"type":["object","null"],"properties":{"currency":{"type":"string","enum":["SGD"]},"amount":{"type":"number","minimum":0,"maximum":100000}},"required":["currency","amount"]},"window":{"type":["object","null"],"properties":{"date":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","from","to"]}},"required":["goal","shareFields","maxPrice","window"]},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}},"required":["scope","today","approvedAt","expiresAt"],"additionalProperties":false},"provider":{"type":"string","enum":["gmail","outlook"]},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false}},"required":["intentId","seenVersion","followUpRef","goal","recipientRef","fromAccountRef","merchantDomain","subjectChars","approval"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["email"]},"provider":{"type":"string","enum":["gmail","outlook"]},"from_account":{"type":"string","maxLength":200},"recipients":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"subject_chars":{"type":"integer","minimum":0},"message_id":{"type":["string","null"],"maxLength":300},"thread_ref":{"type":["string","null"],"maxLength":300},"attachment_refs":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":10},"messages_sent":{"type":"integer","minimum":0},"auto_follow_ups":{"type":"integer","minimum":0},"replies_seen":{"type":"integer","minimum":0},"last_reply_ref":{"type":["string","null"],"maxLength":64},"pause_reason":{"type":["string","null"],"maxLength":60},"state":{"type":"string","enum":["DRAFT_READY","SEND_ACCEPTED","BOUNCED","WAITING_REPLY","USER_HANDOFF_REQUIRED","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","provider","from_account","recipients","subject_chars","message_id","thread_ref","attachment_refs","messages_sent","auto_follow_ups","replies_seen","last_reply_ref","pause_reason","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Intent changed, confirmed or already has this task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/email/tasks/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["email"]},"provider":{"type":"string","enum":["gmail","outlook"]},"from_account":{"type":"string","maxLength":200},"recipients":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"subject_chars":{"type":"integer","minimum":0},"message_id":{"type":["string","null"],"maxLength":300},"thread_ref":{"type":["string","null"],"maxLength":300},"attachment_refs":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":10},"messages_sent":{"type":"integer","minimum":0},"auto_follow_ups":{"type":"integer","minimum":0},"replies_seen":{"type":"integer","minimum":0},"last_reply_ref":{"type":["string","null"],"maxLength":64},"pause_reason":{"type":["string","null"],"maxLength":60},"state":{"type":"string","enum":["DRAFT_READY","SEND_ACCEPTED","BOUNCED","WAITING_REPLY","USER_HANDOFF_REQUIRED","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","provider","from_account","recipients","subject_chars","message_id","thread_ref","attachment_refs","messages_sent","auto_follow_ups","replies_seen","last_reply_ref","pause_reason","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/email/tasks/{id}/events":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"One observed fact from the phone. SEND_REQUESTED comes before every Gmail send and must succeed first: it refuses a first or paused send not approved by the person, a duplicate, a send while an outcome is unknown (check Sent first), and automatic follow-ups after expiry or the cap (409 with the rule code).","parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["SEND_REQUESTED","SEND_ACCEPTED","SEND_FAILED","SEND_UNCERTAIN","SENT_FOUND","SENT_NOT_FOUND","WAITING_REPLY","REPLY_RECEIVED","SCOPE_PAUSE","BOUNCED","BUSINESS_CONFIRMED","CLOSED"]},"digest":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"chars":{"type":["integer","null"],"minimum":0},"by":{"type":["string","null"],"enum":["person","auto",null]},"messageId":{"type":["string","null"],"maxLength":300},"gmailId":{"type":["string","null"],"maxLength":64},"threadId":{"type":["string","null"],"maxLength":64},"businessRef":{"type":["string","null"],"maxLength":60},"detail":{"type":["string","null"],"maxLength":60}},"required":["type","digest","chars","by","messageId","gmailId","threadId","businessRef","detail"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["email"]},"provider":{"type":"string","enum":["gmail","outlook"]},"from_account":{"type":"string","maxLength":200},"recipients":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10},"subject_chars":{"type":"integer","minimum":0},"message_id":{"type":["string","null"],"maxLength":300},"thread_ref":{"type":["string","null"],"maxLength":300},"attachment_refs":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":10},"messages_sent":{"type":"integer","minimum":0},"auto_follow_ups":{"type":"integer","minimum":0},"replies_seen":{"type":"integer","minimum":0},"last_reply_ref":{"type":["string","null"],"maxLength":64},"pause_reason":{"type":["string","null"],"maxLength":60},"state":{"type":"string","enum":["DRAFT_READY","SEND_ACCEPTED","BOUNCED","WAITING_REPLY","USER_HANDOFF_REQUIRED","BUSINESS_CONFIRMED","OUTCOME_UNKNOWN","CLOSED"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","provider","from_account","recipients","subject_chars","message_id","thread_ref","attachment_refs","messages_sent","auto_follow_ups","replies_seen","last_reply_ref","pause_reason","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused by the EmailTask rules","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/call/script":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Writes a short call script for a dial handoff (D12): opening, points, what to confirm (always a reference). Personal data only as {{field}} placeholders; the number is never sent. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"goal":{"type":"string","minLength":1,"maxLength":1000},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"merchant":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":120},"site":{"type":["string","null"],"maxLength":200}},"required":["name","site"],"additionalProperties":false},"vaultAvailable":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"followUpRef":{"type":["string","null"],"maxLength":60}},"required":["intentId","goal","locale","today","merchant","vaultAvailable","followUpRef"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"opening":{"type":"string","minLength":1,"maxLength":400},"points":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":5},"confirm":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["time","price","reference","name","other"]},"prompt":{"type":"string","minLength":1,"maxLength":120}},"required":["kind","prompt"],"additionalProperties":false},"maxItems":5},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12},"spokenLocale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"personLocale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"gloss":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["machine_translation"]},"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["kind","locale","subject","text"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"flags":{"type":"array","items":{"type":"string","enum":["payment"]}},"model":{"type":"string"},"provider":{"type":"string"}},"required":["opening","points","confirm","shareFields","spokenLocale","personLocale","gloss","fields","flags","model","provider"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent or task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused by the CallTask rules or the intent changed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"502":{"description":"Model script refused by the checks","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/call/tasks":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Records a call task right before the phone opens the dialer (DIAL_REQUESTED: the dialer opened, not a call). The number arrives as a callNumberRef digest. With an intentId, seenVersion must be the version GET /v1/intents/{id} returned (409 intent_changed).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intentId":{"type":["string","null"],"pattern":"^int_[a-z0-9]{10,32}$"},"seenVersion":{"type":["integer","null"]},"followUpRef":{"type":["string","null"],"maxLength":60},"goal":{"type":"string","minLength":1,"maxLength":1000},"numberRef":{"type":"string","pattern":"^[0-9a-f]{64}$"},"merchantSite":{"type":["string","null"],"maxLength":200},"scriptDigest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"scriptChars":{"type":"integer","minimum":0,"maximum":4000},"language":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"platform":{"type":"string","enum":["android","ios"]}},"required":["intentId","seenVersion","followUpRef","goal","numberRef","merchantSite","scriptDigest","scriptChars","language","platform"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["call"]},"target":{"type":"string","maxLength":200},"number_ref":{"type":"string","maxLength":64},"language":{"type":"string","maxLength":10},"platform":{"type":"string","enum":["android","ios"]},"local_call_ref":{"type":["string","null"],"maxLength":80},"device_capabilities":{"type":"object","properties":{"dial":{"type":"boolean"},"downlinkRead":{"type":"boolean"},"uplinkInject":{"type":"boolean"}},"required":["dial","downlinkRead","uplinkInject"]},"budget":{"type":"object","properties":{"attempts":{"type":"integer"},"maxMinutes":{"type":"integer"}},"required":["attempts","maxMinutes"]},"attempts":{"type":"integer","minimum":0},"last_outcome":{"type":["string","null"],"maxLength":20},"script_digest":{"type":"string","maxLength":64},"script_chars":{"type":"integer","minimum":0},"state":{"type":"string","enum":["DIAL_REQUESTED","CALL_CONNECTED","VERBAL_CONFIRMED","BUSINESS_ACCEPTED","LOCAL_AUDIO_UNAVAILABLE","SYSTEM_PERMISSION_REQUIRED","USER_HANDOFF_REQUIRED","CALL_OUTCOME_UNKNOWN"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","target","number_ref","language","platform","local_call_ref","device_capabilities","budget","attempts","last_outcome","script_digest","script_chars","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent or task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused by the CallTask rules or the intent changed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/call/tasks/{id}":{"get":{"security":[{"FirebaseIdToken":[]}],"parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["call"]},"target":{"type":"string","maxLength":200},"number_ref":{"type":"string","maxLength":64},"language":{"type":"string","maxLength":10},"platform":{"type":"string","enum":["android","ios"]},"local_call_ref":{"type":["string","null"],"maxLength":80},"device_capabilities":{"type":"object","properties":{"dial":{"type":"boolean"},"downlinkRead":{"type":"boolean"},"uplinkInject":{"type":"boolean"}},"required":["dial","downlinkRead","uplinkInject"]},"budget":{"type":"object","properties":{"attempts":{"type":"integer"},"maxMinutes":{"type":"integer"}},"required":["attempts","maxMinutes"]},"attempts":{"type":"integer","minimum":0},"last_outcome":{"type":["string","null"],"maxLength":20},"script_digest":{"type":"string","maxLength":64},"script_chars":{"type":"integer","minimum":0},"state":{"type":"string","enum":["DIAL_REQUESTED","CALL_CONNECTED","VERBAL_CONFIRMED","BUSINESS_ACCEPTED","LOCAL_AUDIO_UNAVAILABLE","SYSTEM_PERMISSION_REQUIRED","USER_HANDOFF_REQUIRED","CALL_OUTCOME_UNKNOWN"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","target","number_ref","language","platform","local_call_ref","device_capabilities","budget","attempts","last_outcome","script_digest","script_chars","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent or task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused by the CallTask rules or the intent changed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/call/tasks/{id}/events":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"DIAL_REQUESTED (a re-dial, with the intent version just read), DIAL_FAILED, or the person's answer after the call. BUSINESS_ACCEPTED needs \"confirmed\" plus a reference the person typed; \"confirmed\" alone is VERBAL_CONFIRMED; anything else CALL_OUTCOME_UNKNOWN.","parameters":[{"schema":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["DIAL_REQUESTED","DIAL_FAILED","OUTCOME_REPORTED"]},"seenVersion":{"type":["integer","null"]},"outcome":{"type":["string","null"],"enum":["confirmed","no_answer","call_again","switch_channel","unsure",null]},"businessRef":{"type":["string","null"],"maxLength":60},"noteDigest":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"noteChars":{"type":["integer","null"],"minimum":0,"maximum":200},"detail":{"type":["string","null"],"maxLength":60}},"required":["type","seenVersion","outcome","businessRef","noteDigest","noteChars","detail"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^cht_[a-z0-9]{10,32}$"},"intent_id":{"type":"string","pattern":"^int_[a-z0-9]{10,32}$"},"plan_id":{"type":"string","pattern":"^chp_[a-z0-9]{10,32}$"},"run_id":{"type":["string","null"]},"business_ref":{"type":["string","null"],"maxLength":60},"created_at":{"type":"string"},"updated_at":{"type":"string"},"state_history":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","maxLength":40},"at":{"type":"string"}},"required":["state","at"]},"maxItems":100},"kind":{"type":"string","enum":["call"]},"target":{"type":"string","maxLength":200},"number_ref":{"type":"string","maxLength":64},"language":{"type":"string","maxLength":10},"platform":{"type":"string","enum":["android","ios"]},"local_call_ref":{"type":["string","null"],"maxLength":80},"device_capabilities":{"type":"object","properties":{"dial":{"type":"boolean"},"downlinkRead":{"type":"boolean"},"uplinkInject":{"type":"boolean"}},"required":["dial","downlinkRead","uplinkInject"]},"budget":{"type":"object","properties":{"attempts":{"type":"integer"},"maxMinutes":{"type":"integer"}},"required":["attempts","maxMinutes"]},"attempts":{"type":"integer","minimum":0},"last_outcome":{"type":["string","null"],"maxLength":20},"script_digest":{"type":"string","maxLength":64},"script_chars":{"type":"integer","minimum":0},"state":{"type":"string","enum":["DIAL_REQUESTED","CALL_CONNECTED","VERBAL_CONFIRMED","BUSINESS_ACCEPTED","LOCAL_AUDIO_UNAVAILABLE","SYSTEM_PERMISSION_REQUIRED","USER_HANDOFF_REQUIRED","CALL_OUTCOME_UNKNOWN"]}},"required":["task_id","intent_id","plan_id","run_id","business_ref","created_at","updated_at","kind","target","number_ref","language","platform","local_call_ref","device_capabilities","budget","attempts","last_outcome","script_digest","script_chars","state"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"404":{"description":"Unknown intent or task","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"409":{"description":"Refused by the CallTask rules or the intent changed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/message/draft":{"post":{"security":[{"FirebaseIdToken":[]}],"description":"Drafts the first message the person will send themselves in WhatsApp (D10/D11): the merchant's language, personal data only as {{field}} placeholders for the fields the person allowed. Nothing is stored; the number is never sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp"]},"goal":{"type":"string","minLength":1,"maxLength":200},"locale":{"type":"string","maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"counterpart":{"type":["object","null"],"properties":{"chosen":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"declared":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"},"pageLang":{"type":["string","null"],"maxLength":35,"pattern":"^(?:[A-Za-z]{1,8}(?:[_-][A-Za-z0-9]{1,8})*)?$"}},"required":["declared","pageLang"],"additionalProperties":false},"shareFields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]},"maxItems":12}},"required":["channel","goal","locale","shareFields"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp"]},"outbound":{"type":"object","properties":{"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["locale","subject","text"],"additionalProperties":false},"gloss":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["machine_translation"]},"locale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"subject":{"type":["string","null"],"maxLength":200},"text":{"type":"string","maxLength":4000}},"required":["kind","locale","subject","text"],"additionalProperties":false},"personLocale":{"type":"string","enum":["en","zh-Hans","zh-Hant","ms","ta","id","th","vi","fil","ja","ko","hi","bn","fr","de","es","pt-BR","it","ru","ar"]},"fields":{"type":"array","items":{"type":"string","enum":["full_name","given_name","family_name","phone","email","company","job_title","address_line1","address_line2","postal_code","city","country"]}},"flags":{"type":"array","items":{"type":"string","enum":["payment"]}}},"required":["channel","outbound","gloss","personLocale","fields","flags"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/v1/a2a/tasks":{"get":{"security":[{"FirebaseIdToken":[]}],"description":"The caller's A2A tasks, newest first, for the app inbox. `awaiting_approval` tasks carry a draft plan (GET /v1/plans/{id}) that only the person can approve on the device (POST /v1/grants). Protocol state and business state are reported apart.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["tasks"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/metrics":{"get":{"security":[{"LabToken":[]}],"description":"Aggregates for the acceptance dashboard. Counts only: no personal data.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}},"/admin/metrics/bench":{"post":{"security":[{"LabToken":[]}],"description":"Ingests one bench, field or controlled-experiment run (strict schema; replays of a run_id are duplicates).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"422":{"description":"Rejected content","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"429":{"description":"Quota or concurrency limit","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}},"503":{"description":"Provider not configured or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"path":{"type":"string"},"retryAfterSec":{"type":"integer"},"byok_hint":{"type":"boolean"},"retryable":{"type":"boolean"},"next_step":{"type":"string"},"field":{"type":"string"}},"required":["code"]}}}}}}}},"webhooks":{}}