{"openapi":"3.1.0","info":{"title":"Surfing Dog Inbox","description":"Typed inbox for people and AI agents. Public routes need no auth; /v1/owner needs an owner API key.","version":"0.1.0"},"components":{"securitySchemes":{"ownerKey":{"type":"http","scheme":"bearer","description":"An owner or integration key (sdi_own_…), an OAuth access token from /oauth, or the owner app's session."}},"schemas":{"__schema0":{"anyOf":[{"type":"object","properties":{"all":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["any"]},{"type":"object","properties":{"not":{"$ref":"#/components/schemas/__schema0"}},"required":["not"]},{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":120},"op":{"type":"string","enum":["eq","neq","lt","lte","gt","gte","in","nin","contains","startsWith","exists","empty","between"]},"value":{}},"required":["path","op"]},{"type":"object","properties":{"fn":{"type":"string","enum":["slot_is_free","within_business_hours","party_verified","text_has_keywords","is_sandbox","person_trusted","person_tier_on","customer_known","within_customer_limit"]},"args":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["fn"]}]}}},"paths":{"/v1/owner/items":{"get":{"operationId":"getV1OwnerItems","tags":["owner"],"summary":"List items, newest change first","responses":{"200":{"description":"Items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","flags","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["message","quote_request","booking","order","refund"]}},{"in":"query","name":"state","schema":{"type":"string","maxLength":40}},{"in":"query","name":"needs_human","schema":{"type":"string"}},{"in":"query","name":"open_only","schema":{"type":"string"},"description":"Hide closed items."},{"in":"query","name":"sandbox","schema":{"type":"string"}},{"in":"query","name":"q","schema":{"type":"string","maxLength":200},"description":"Full-text search over the conversation, or the six-character reference the customer quotes."},{"in":"query","name":"mail_failed","schema":{"type":"string"},"description":"Only items with an email that could not be sent."},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}]}},"/v1/owner/items/{id}":{"get":{"operationId":"getV1OwnerItemsById","tags":["owner"],"summary":"One item with its events (who caused each, and through which door), conversation, and every email about it with what became of it","responses":{"200":{"description":"Item detail","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","flags","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}},"events":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"event":{"type":"string"},"from":{"type":["string","null"]},"to":{"type":"string"},"actor":{"type":"string"},"by":{"type":"object","properties":{"kind":{"type":"string","description":"owner, owner_ai, integration, connector, rule, system, customer_agent or customer_human"},"id":{"description":"The user, AI app or key id; null for a customer and for a receipt.","type":["string","null"]},"name":{"description":"The key's or AI app's name.","type":"string"}},"required":["kind","id"]},"channel":{"type":["string","null"]},"reason":{"type":["string","null"]},"at":{"type":"string","description":"ISO 8601 instant"}},"required":["seq","event","from","to","actor","by","channel","reason","at"],"additionalProperties":{}}},"thread":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string"},"channel":{"type":"string"},"actor":{"type":"string"},"body":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"delivery":{"description":"On a reply to the customer: what became of the email it went out in.","type":"object","properties":{"status":{"type":"string","enum":["queued","sent","retrying","failed","skipped"],"description":"sent only once the mail service took it; retrying: it failed and is tried again; failed: for good."},"sent_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"last_error":{"type":["string","null"]},"skip_reason":{"type":["string","null"]}},"required":["status","sent_at","last_error","skip_reason"]}},"required":["id","direction","channel","actor","body","at"],"additionalProperties":{}}},"mail":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"recipient":{"type":"string","enum":["customer","owner"]},"template":{"type":"string","description":"Which email it is: ack.booking, booking.proposed, reply, key, …"},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["queued","sent","retrying","failed","skipped"],"description":"sent only once the mail service took it; retrying: it failed and is tried again; failed: for good."},"skip_reason":{"description":"Why it was not sent: no_address, no_sender, test_item.","type":["string","null"]},"last_error":{"type":["string","null"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"created_at":{"type":"string","description":"ISO 8601 instant"},"entry_id":{"description":"The reply it carries, when it is one.","type":["string","null"]}},"required":["id","recipient","template","subject","body","status","skip_reason","last_error","attempts","sent_at","created_at","entry_id"]},"description":"Every email about the item, to the customer and to the owner, and what became of each."}},"required":["item","transitions","human","events","thread","mail"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/items/{id}/transitions":{"post":{"operationId":"postV1OwnerItemsByIdTransitions","tags":["owner"],"summary":"Move an item to its next state","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"linked":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":60},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","maxLength":2000},"expected_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"written_by":{"description":"Who wrote the words the customer gets. person: someone typed them (honoured from an integration key; the owner's AI is always automatic); automation: nobody did. An email nobody typed says it was sent automatically.","type":"string","enum":["person","automation"]},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200}},"required":["event"]}}}}}},"/v1/owner/items/{id}/replies":{"post":{"operationId":"postV1OwnerItemsByIdReplies","tags":["owner"],"summary":"Reply to the customer or add a note","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":20000},"internal":{"default":false,"description":"A private note for the team instead of a reply to the customer.","type":"boolean"},"written_by":{"description":"Who wrote the words the customer gets. person: someone typed them (honoured from an integration key; the owner's AI is always automatic); automation: nobody did. An email nobody typed says it was sent automatically.","type":"string","enum":["person","automation"]},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200}},"required":["body"]}}}}}},"/v1/owner/customers/{id}":{"get":{"operationId":"getV1OwnerCustomersById","tags":["owner"],"summary":"One customer: their parties, items, emails, and whether booking networks are off for them","description":"The customer is party.id on any of their items, and every party that is them: merged, or with the same email address (the same phone number only when they gave no email, and only records that gave none either). networks_off says since when booking networks are off for them and what each network already had.","responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"type":"object","properties":{"party_id":{"type":"string"},"name":{"type":["string","null"]},"parties":{"type":"array","items":{"type":"string"},"description":"Every party that is this customer."},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emails":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"erased_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"networks_off":{"anyOf":[{"type":"object","properties":{"since":{"type":"string","description":"ISO 8601 instant"},"via":{"anyOf":[{"type":"string","enum":["customer","owner","erased"]},{"type":"null"}],"description":"customer: by the link in their code email."},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"receipts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Receipts about them this network took before the stop."},"open_promises":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Their promises this network holds without an outcome: it records each as unclosed 9 days after it was due."},"person":{"type":"boolean","description":"This network knows their person."}},"required":["network","receipts","open_promises","person"]}}},"required":["since","via","networks"]},{"type":"null"}],"description":"Booking networks are off for this customer: nothing more about them goes to any network. Null: on."}},"required":["party_id","name","parties","items","open_items","entries","emails","erased_at","networks_off"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/customers/{id}/export":{"get":{"operationId":"getV1OwnerCustomersByIdExport","tags":["owner"],"summary":"Everything the inbox holds about one customer, as one JSON document","description":"Their parties, contacts, identities, network ids, agents, and every item with its events, conversation, emails and receipts. The owner's AI may export too. Never a pass, a key, an access token or a link.","responses":{"200":{"description":"Customer export","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/customers/{id}/networks-off":{"post":{"operationId":"postV1OwnerCustomersByIdNetworksOff","tags":["owner"],"summary":"Stop using booking networks for one customer","description":"From now on no network is sent anything about them (no first contact, presentation, receipt or acknowledgement) and nothing a network said about them is read; their bookings, orders and emails are unchanged. The same as the customer's own link in their code email. A network cannot yet be asked to erase what it already has: networks_off lists it.","responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"type":"object","properties":{"party_id":{"type":"string"},"name":{"type":["string","null"]},"parties":{"type":"array","items":{"type":"string"},"description":"Every party that is this customer."},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emails":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"erased_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"networks_off":{"anyOf":[{"type":"object","properties":{"since":{"type":"string","description":"ISO 8601 instant"},"via":{"anyOf":[{"type":"string","enum":["customer","owner","erased"]},{"type":"null"}],"description":"customer: by the link in their code email."},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"receipts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Receipts about them this network took before the stop."},"open_promises":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Their promises this network holds without an outcome: it records each as unclosed 9 days after it was due."},"person":{"type":"boolean","description":"This network knows their person."}},"required":["network","receipts","open_promises","person"]}}},"required":["since","via","networks"]},{"type":"null"}],"description":"Booking networks are off for this customer: nothing more about them goes to any network. Null: on."}},"required":["party_id","name","parties","items","open_items","entries","emails","erased_at","networks_off"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/customers/{id}/erase":{"post":{"operationId":"postV1OwnerCustomersByIdErase","tags":["owner"],"summary":"Erase one customer's personal data (cannot be undone)","description":"Rewrites their names, email addresses, phone numbers, postal addresses, message text and the emails about them to a placeholder, and keeps the structure: item types, states, times, amounts, the event sequence and the receipts. Booking networks are switched off for them for good. Only the owner, signed in or with their own key, or a key given customers:erase; never the owner's AI. Without confirm, or with one that no longer matches, nothing is erased: 409 confirm_erase says what would be, and details.confirm is the value to send.","responses":{"200":{"description":"Erased","content":{"application/json":{"schema":{"type":"object","properties":{"erased":{"type":"boolean"},"already":{"type":"boolean","description":"The customer had been erased already: nothing more was done."},"customer":{"type":"object","properties":{"party_id":{"type":"string"},"name":{"type":["string","null"]},"parties":{"type":"array","items":{"type":"string"},"description":"Every party that is this customer."},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emails":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"erased_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"networks_off":{"anyOf":[{"type":"object","properties":{"since":{"type":"string","description":"ISO 8601 instant"},"via":{"anyOf":[{"type":"string","enum":["customer","owner","erased"]},{"type":"null"}],"description":"customer: by the link in their code email."},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"receipts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Receipts about them this network took before the stop."},"open_promises":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Their promises this network holds without an outcome: it records each as unclosed 9 days after it was due."},"person":{"type":"boolean","description":"This network knows their person."}},"required":["network","receipts","open_promises","person"]}}},"required":["since","via","networks"]},{"type":"null"}],"description":"Booking networks are off for this customer: nothing more about them goes to any network. Null: on."}},"required":["party_id","name","parties","items","open_items","entries","emails","erased_at","networks_off"]}},"required":["erased","already","customer"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/mail":{"get":{"operationId":"getV1OwnerMail","tags":["owner"],"summary":"Whether this inbox can send email","description":"service: a mail service is set up that delivers (without one, every email is written to the log and shows as not sent); sender: there is an address to send from; links: emails can carry answer links (INBOX_SECRET_KEY and a public address are set).","responses":{"200":{"description":"Mail","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"boolean","description":"A mail service that delivers is set up."},"sender":{"type":"boolean","description":"There is an address to send from."},"links":{"type":"boolean","description":"Emails can carry answer links."}},"required":["service","sender","links"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]}},"/v1/owner/settings":{"get":{"operationId":"getV1OwnerSettings","tags":["owner"],"summary":"The settings document, secrets left out (named in redacted)","responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"redacted":{"type":"array","items":{"type":"string"},"description":"Settings paths that hold a secret this read leaves out."}},"required":["doc","version","redacted"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"put":{"operationId":"putV1OwnerSettings","tags":["owner"],"summary":"Change settings","description":"The document you send is merged over the current one: sections and keys left out keep their values, and null removes a key so its default applies again. Networks are a map keyed by https origin; adding one leaves the others as they are. The security section can only be changed by the owner in the owner app.","responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"redacted":{"type":"array","items":{"type":"string"},"description":"Settings paths that hold a secret this read leaves out."}},"required":["doc","version","redacted"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The changes, merged over the current settings: objects merge key by key, anything you leave out keeps its value, null removes a key (its default applies again), and arrays replace. Networks are a map keyed by https origin, e.g. {\"networks\": {\"https://network.example.com\": {\"enabled\": true}}}: that adds or switches on one network and leaves the others as they are; {\"enabled\": false} switches one off. At most 8."},"expected_version":{"description":"The version you read; a write over a newer version is refused instead of overwriting it.","type":"integer","minimum":1,"maximum":9007199254740991}},"required":["doc"]}}}}}},"/v1/owner/receipts":{"get":{"operationId":"getV1OwnerReceipts","tags":["owner"],"summary":"Whether this instance issues receipts, and how many it has","responses":{"200":{"description":"Receipt status","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]}},"/v1/owner/networks":{"get":{"operationId":"getV1OwnerNetworks","tags":["owner"],"summary":"The networks this inbox reports to, and how each one is doing","description":"Every network in settings, switched on or not: what it is sent, whether it has verified this instance, the last ping it took, the last error in a few words, and how many receipts it has. Add, switch on or switch off a network with PUT /settings and `networks` keyed by origin; the owner's AI and integration keys may switch one off or share less with it, not switch one on, let it issue keys or share more.","responses":{"200":{"description":"Networks","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]}},"/v1/owner/profile":{"get":{"operationId":"getV1OwnerProfile","tags":["setup"],"summary":"Business profile","responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":["string","null"]},"timezone":{"type":"string"},"currency":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}}},"required":["name","domain","timezone","currency","languages"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"put":{"operationId":"putV1OwnerProfile","tags":["setup"],"summary":"Update the business profile","responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":["string","null"]},"timezone":{"type":"string"},"currency":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}}},"required":["name","domain","timezone","currency","languages"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"anyOf":[{"type":"string","maxLength":253,"pattern":"^(?!-)[a-z0-9-]{1,63}(?<!-)(\\.(?!-)[a-z0-9-]{1,63}(?<!-))+$"},{"type":"null"}]},"timezone":{"description":"IANA name, e.g. Europe/Lisbon","type":"string","minLength":1,"maxLength":64},"currency":{"type":"string","minLength":3,"maxLength":3},"languages":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":2,"maxLength":12}}}}}}}}},"/v1/owner/services":{"get":{"operationId":"getV1OwnerServices","tags":["setup"],"summary":"All services, archived included","responses":{"200":{"description":"Services","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferBeforeMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferAfterMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularityMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"per":{"description":"A fixed price is per booking unless it says per person.","type":"string","enum":["booking","person"]}},"required":["model"],"additionalProperties":{}},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sort":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","durationMin","bufferBeforeMin","bufferAfterMin","capacity","granularityMin","price","active","sort"],"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerServices","tags":["setup"],"summary":"Add a bookable service","description":"A fixed price is per booking unless price.per is person. Prices are the owner's: a service the owner's AI adds with a price is saved unpublished (active false) for the owner to check and publish.","responses":{"201":{"description":"Service","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferBeforeMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferAfterMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularityMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"per":{"description":"A fixed price is per booking unless it says per person.","type":"string","enum":["booking","person"]}},"required":["model"],"additionalProperties":{}},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sort":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","durationMin","bufferBeforeMin","bufferAfterMin","capacity","granularityMin","price","active","sort"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"duration_min":{"default":60,"type":"integer","minimum":5,"maximum":1440},"buffer_before_min":{"default":0,"type":"integer","minimum":0,"maximum":240},"buffer_after_min":{"default":0,"type":"integer","minimum":0,"maximum":240},"capacity":{"default":1,"description":"How many bookings can share one slot.","type":"integer","minimum":1,"maximum":100},"granularity_min":{"default":15,"description":"Slots start every N minutes.","type":"integer","minimum":5,"maximum":240},"price":{"type":"object","properties":{"model":{"type":"string","enum":["fixed","from","quote"],"description":"fixed = this price; from = starting at; quote = priced per request"},"value":{"description":"Minor units (cents).","type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"per":{"description":"Whom a fixed price is for: the whole booking (the default) or each person, so a booking for four costs four times the price.","type":"string","enum":["booking","person"]}},"required":["model"]},"active":{"default":true,"type":"boolean"},"sort":{"default":0,"type":"integer","minimum":0,"maximum":10000}},"required":["name"]}}}}}},"/v1/owner/services/{id}":{"patch":{"operationId":"patchV1OwnerServicesById","tags":["setup"],"summary":"Change a service","description":"Only the fields you send change. Prices are the owner's: the owner's AI cannot change a price or publish a priced service (403, not_allowed).","responses":{"200":{"description":"Service","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferBeforeMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferAfterMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularityMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"per":{"description":"A fixed price is per booking unless it says per person.","type":"string","enum":["booking","person"]}},"required":["model"],"additionalProperties":{}},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sort":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","durationMin","bufferBeforeMin","bufferAfterMin","capacity","granularityMin","price","active","sort"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"duration_min":{"default":60,"type":"integer","minimum":5,"maximum":1440},"buffer_before_min":{"default":0,"type":"integer","minimum":0,"maximum":240},"buffer_after_min":{"default":0,"type":"integer","minimum":0,"maximum":240},"capacity":{"default":1,"description":"How many bookings can share one slot.","type":"integer","minimum":1,"maximum":100},"granularity_min":{"default":15,"description":"Slots start every N minutes.","type":"integer","minimum":5,"maximum":240},"price":{"type":"object","properties":{"model":{"type":"string","enum":["fixed","from","quote"],"description":"fixed = this price; from = starting at; quote = priced per request"},"value":{"description":"Minor units (cents).","type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"per":{"description":"Whom a fixed price is for: the whole booking (the default) or each person, so a booking for four costs four times the price.","type":"string","enum":["booking","person"]}},"required":["model"]},"active":{"default":true,"type":"boolean"},"sort":{"default":0,"type":"integer","minimum":0,"maximum":10000}}}}}}},"delete":{"operationId":"deleteV1OwnerServicesById","tags":["setup"],"summary":"Archive a service","responses":{"200":{"description":"Service","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferBeforeMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferAfterMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularityMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"per":{"description":"A fixed price is per booking unless it says per person.","type":"string","enum":["booking","person"]}},"required":["model"],"additionalProperties":{}},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sort":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","durationMin","bufferBeforeMin","bufferAfterMin","capacity","granularityMin","price","active","sort"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/products":{"get":{"operationId":"getV1OwnerProducts","tags":["setup"],"summary":"All products, archived included","responses":{"200":{"description":"Products","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["value","currency"]},"stock":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","sku","name","description","price","stock","active"],"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerProducts","tags":["setup"],"summary":"Add a product","description":"Prices are the owner's: a product the owner's AI adds is saved unpublished (active false) for the owner to check and publish.","responses":{"201":{"description":"Product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["value","currency"]},"stock":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","sku","name","description","price","stock","active"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]},"stock":{"description":"null = not tracked","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"active":{"default":true,"type":"boolean"}},"required":["name","price"]}}}}}},"/v1/owner/products/{id}":{"patch":{"operationId":"patchV1OwnerProductsById","tags":["setup"],"summary":"Change a product","description":"Only the fields you send change. Prices are the owner's: the owner's AI cannot change a price or publish a product (403, not_allowed).","responses":{"200":{"description":"Product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["value","currency"]},"stock":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","sku","name","description","price","stock","active"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]},"stock":{"description":"null = not tracked","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"active":{"default":true,"type":"boolean"}}}}}}},"delete":{"operationId":"deleteV1OwnerProductsById","tags":["setup"],"summary":"Archive a product","responses":{"200":{"description":"Product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["value","currency"]},"stock":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","sku","name","description","price","stock","active"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/availability":{"get":{"operationId":"getV1OwnerAvailability","tags":["setup"],"summary":"Opening hours, per-service overrides and closures","responses":{"200":{"description":"Availability","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"overrides":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"}},"required":["service_id"],"additionalProperties":{}}},"closures":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":{}}}},"required":["timezone","weekly","overrides","closures"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"put":{"operationId":"putV1OwnerAvailability","tags":["setup"],"summary":"Set the weekly opening hours (business-wide or for one service)","responses":{"200":{"description":"Availability","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"overrides":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"}},"required":["service_id"],"additionalProperties":{}}},"closures":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":{}}}},"required":["timezone","weekly","overrides","closures"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"weekly":{"type":"object","properties":{"mon":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":6,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"description":"Opening windows per weekday, e.g. {\"mon\": [[\"09:00\",\"13:00\"],[\"14:00\",\"18:00\"]]}. Missing days are closed."},"service_id":{"description":"Override the hours for one service; omit for the whole business.","type":"string","minLength":1}},"required":["weekly"]}}}}}},"/v1/owner/availability/{serviceId}":{"delete":{"operationId":"deleteV1OwnerAvailabilityByServiceId","tags":["setup"],"summary":"Remove a service's own hours so it follows the business hours","responses":{"200":{"description":"Availability","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"overrides":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"}},"required":["service_id"],"additionalProperties":{}}},"closures":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":{}}}},"required":["timezone","weekly","overrides","closures"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"serviceId","required":true}]}},"/v1/owner/availability/closures":{"put":{"operationId":"putV1OwnerAvailabilityClosures","tags":["setup"],"summary":"Replace the list of closed days","responses":{"200":{"description":"Availability","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"overrides":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"}},"required":["service_id"],"additionalProperties":{}}},"closures":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":{}}}},"required":["timezone","weekly","overrides","closures"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"closures":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"First closed day, YYYY-MM-DD in the business time zone."},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Last closed day, inclusive."},"reason":{"type":"string","maxLength":200}},"required":["from","to"]}}},"required":["closures"]}}}}}},"/v1/owner/rules":{"get":{"operationId":"getV1OwnerRules","tags":["setup"],"summary":"The rules, highest priority first, each with a plain-English summary","responses":{"200":{"description":"Rules","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"summary":{"type":"string"},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"}},"required":["id","name","priority","enabled","version","definition","summary","created_at","updated_at"],"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerRules","tags":["setup"],"summary":"Add a rule","responses":{"201":{"description":"Rule","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"summary":{"type":"string"},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"}},"required":["id","name","priority","enabled","version","definition","summary","created_at","updated_at"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"priority":{"default":0,"description":"Higher runs first.","type":"integer","minimum":-1000,"maximum":1000},"enabled":{"default":true,"type":"boolean"},"definition":{"type":"object","properties":{"on":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"string","enum":["item.created","item.transitioned","thread.inbound"]},{"type":"string","pattern":"^item\\.transitioned:[a-z_]+$"}]}},"if":{"$ref":"#/components/schemas/__schema0"},"actions":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"transition"},"event":{"type":"string","minLength":1,"maxLength":60},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","maxLength":500}},"required":["action","event"]},{"type":"object","properties":{"action":{"type":"string","const":"set_flags"},"needsHuman":{"type":"boolean"},"priority":{"type":"integer","minimum":0,"maximum":3}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reply"},"template":{"type":"string","minLength":1,"maxLength":4000},"internal":{"default":false,"type":"boolean"}},"required":["action","template"]},{"type":"object","properties":{"action":{"type":"string","const":"enqueue"},"job":{"type":"string","minLength":1,"maxLength":60},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delayMin":{"type":"integer","minimum":0,"maximum":43200}},"required":["action","job"]},{"type":"object","properties":{"action":{"type":"string","const":"stop"}},"required":["action"]}]}},"stop":{"default":false,"type":"boolean"},"maxRunsPerItem":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["on","if","actions"]}},"required":["name","definition"]}}}}}},"/v1/owner/rules/presets":{"get":{"operationId":"getV1OwnerRulesPresets","tags":["setup"],"summary":"Rule presets per kind of business","responses":{"200":{"description":"Presets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]}},"/v1/owner/rules/presets/{key}":{"post":{"operationId":"postV1OwnerRulesPresetsByKey","tags":["setup"],"summary":"Apply a preset's rules","responses":{"200":{"description":"Rules","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"summary":{"type":"string"},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"}},"required":["id","name","priority","enabled","version","definition","summary","created_at","updated_at"],"additionalProperties":{}}}},"required":["items"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"key","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"replace":{"default":false,"description":"Remove the existing rules first.","type":"boolean"}}}}}}}},"/v1/owner/rules/test":{"post":{"operationId":"postV1OwnerRulesTest","tags":["setup"],"summary":"Evaluate a rule against an existing item without changing anything","responses":{"200":{"description":"Test result","content":{"application/json":{"schema":{"type":"object","properties":{"matched":{"type":"boolean"},"summary":{"type":"string"},"would":{"type":"array","items":{"type":"string"}},"skipped":{"description":"What a run would hold back on this item, in plain words: a rule reading a customer's record only helps.","type":"array","items":{"type":"string"}}},"required":["matched","summary","would"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","properties":{"on":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"string","enum":["item.created","item.transitioned","thread.inbound"]},{"type":"string","pattern":"^item\\.transitioned:[a-z_]+$"}]}},"if":{"$ref":"#/components/schemas/__schema0"},"actions":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"transition"},"event":{"type":"string","minLength":1,"maxLength":60},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","maxLength":500}},"required":["action","event"]},{"type":"object","properties":{"action":{"type":"string","const":"set_flags"},"needsHuman":{"type":"boolean"},"priority":{"type":"integer","minimum":0,"maximum":3}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reply"},"template":{"type":"string","minLength":1,"maxLength":4000},"internal":{"default":false,"type":"boolean"}},"required":["action","template"]},{"type":"object","properties":{"action":{"type":"string","const":"enqueue"},"job":{"type":"string","minLength":1,"maxLength":60},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delayMin":{"type":"integer","minimum":0,"maximum":43200}},"required":["action","job"]},{"type":"object","properties":{"action":{"type":"string","const":"stop"}},"required":["action"]}]}},"stop":{"default":false,"type":"boolean"},"maxRunsPerItem":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["on","if","actions"]},"item_id":{"type":"string","minLength":1,"description":"An existing item to evaluate the conditions against; nothing is changed."},"name":{"description":"The rule's name, for the words the test answers with.","type":"string","maxLength":200}},"required":["definition","item_id"]}}}}}},"/v1/owner/rules/{id}":{"patch":{"operationId":"patchV1OwnerRulesById","tags":["setup"],"summary":"Change a rule (pass expected_version to avoid racing a colleague)","responses":{"200":{"description":"Rule","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"summary":{"type":"string"},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"}},"required":["id","name","priority","enabled","version","definition","summary","created_at","updated_at"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"priority":{"default":0,"description":"Higher runs first.","type":"integer","minimum":-1000,"maximum":1000},"enabled":{"default":true,"type":"boolean"},"definition":{"type":"object","properties":{"on":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"string","enum":["item.created","item.transitioned","thread.inbound"]},{"type":"string","pattern":"^item\\.transitioned:[a-z_]+$"}]}},"if":{"$ref":"#/components/schemas/__schema0"},"actions":{"minItems":1,"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"transition"},"event":{"type":"string","minLength":1,"maxLength":60},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"reason":{"type":"string","maxLength":500}},"required":["action","event"]},{"type":"object","properties":{"action":{"type":"string","const":"set_flags"},"needsHuman":{"type":"boolean"},"priority":{"type":"integer","minimum":0,"maximum":3}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reply"},"template":{"type":"string","minLength":1,"maxLength":4000},"internal":{"default":false,"type":"boolean"}},"required":["action","template"]},{"type":"object","properties":{"action":{"type":"string","const":"enqueue"},"job":{"type":"string","minLength":1,"maxLength":60},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delayMin":{"type":"integer","minimum":0,"maximum":43200}},"required":["action","job"]},{"type":"object","properties":{"action":{"type":"string","const":"stop"}},"required":["action"]}]}},"stop":{"default":false,"type":"boolean"},"maxRunsPerItem":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["on","if","actions"]},"expected_version":{"type":"integer","minimum":1,"maximum":9007199254740991}}}}}}},"delete":{"operationId":"deleteV1OwnerRulesById","tags":["setup"],"summary":"Delete a rule","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/webhooks":{"get":{"operationId":"getV1OwnerWebhooks","tags":["integrations"],"summary":"The endpoints events are sent to, each with a delivery summary. Never the secret.","responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"payload_style":{"type":"string","enum":["thin","full"]},"headers":{"type":"array","items":{"type":"string"},"description":"The names of the extra headers; values are never returned."},"active":{"type":"boolean"},"failing_since":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"disabled_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"},"deliveries":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_delivery_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["pending","delivered","failed","last_delivery_at"]}},"required":["id","url","events","payload_style","headers","active","failing_since","disabled_at","last_error","created_at","updated_at","deliveries"],"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerWebhooks","tags":["integrations"],"summary":"Add an endpoint. The signing secret is in this response and in no other: store it now.","responses":{"201":{"description":"Webhook and its secret","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"payload_style":{"type":"string","enum":["thin","full"]},"headers":{"type":"array","items":{"type":"string"},"description":"The names of the extra headers; values are never returned."},"active":{"type":"boolean"},"failing_since":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"disabled_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"},"deliveries":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_delivery_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["pending","delivered","failed","last_delivery_at"]},"secret":{"description":"The signing secret, in this answer and in no other.","type":["string","null"]},"secret_note":{"type":"string"},"previous_secret_until":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","url","events","payload_style","headers","active","failing_since","disabled_at","last_error","created_at","updated_at","deliveries","secret","secret_note","previous_secret_until"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","description":"https URL on a public host. Every event is POSTed here, signed with Standard Webhooks."},"events":{"default":["*"],"description":"Which events to send, e.g. [\"booking.*\", \"order.*\"]. Default: everything.","minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80,"pattern":"^(\\*|[a-z][a-z0-9_]*)(\\.(\\*|[a-z][a-z0-9_]*))?$"}},"payload_style":{"default":"thin","type":"string","enum":["thin","full"],"description":"thin sends a pointer — id, type, state, version and a URL — and never goes stale or leaks. full also sends the customer's data to this address."},"headers":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,63}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":1024,"pattern":"^[\\t\\x20-\\x7e]*$"},"description":"Up to 5 extra headers sent with every delivery, e.g. {\"Authorization\": \"Bearer …\"} for an n8n or Make webhook that checks a header. The values are sealed like the signing secret and never shown again; only the names are."}},"required":["url"]}}}}}},"/v1/owner/webhooks/{id}":{"patch":{"operationId":"patchV1OwnerWebhooksById","tags":["integrations"],"summary":"Change an endpoint's URL, events, payload style or extra headers, or wake it after a failure run","responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"payload_style":{"type":"string","enum":["thin","full"]},"headers":{"type":"array","items":{"type":"string"},"description":"The names of the extra headers; values are never returned."},"active":{"type":"boolean"},"failing_since":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"disabled_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"},"deliveries":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_delivery_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["pending","delivered","failed","last_delivery_at"]}},"required":["id","url","events","payload_style","headers","active","failing_since","disabled_at","last_error","created_at","updated_at","deliveries"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80,"pattern":"^(\\*|[a-z][a-z0-9_]*)(\\.(\\*|[a-z][a-z0-9_]*))?$"}},"payload_style":{"type":"string","enum":["thin","full"],"description":"thin sends a pointer — id, type, state, version and a URL — and never goes stale or leaks. full also sends the customer's data to this address."},"active":{"description":"Setting it back to true also clears a failure run, so deliveries resume.","type":"boolean"},"headers":{"description":"Changes to the extra headers, merged: a name with a value sets or replaces it, a name with null removes it, and headers you leave out keep their values. At most 5 in all.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024,"pattern":"^[\\t\\x20-\\x7e]*$"},{"type":"null"}]}}}}}}}},"delete":{"operationId":"deleteV1OwnerWebhooksById","tags":["integrations"],"summary":"Remove an endpoint and its delivery log","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/feeds":{"get":{"operationId":"getV1OwnerFeeds","tags":["integrations"],"summary":"The product feeds this inbox imports, with when each last ran and what went wrong","responses":{"200":{"description":"Feeds","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}},"required":["id","name","url","status"],"additionalProperties":{}}}},"required":["items"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerFeeds","tags":["integrations"],"summary":"Connect a product feed by URL. No credentials. The first import starts immediately.","description":"A feed sets prices, so the owner's AI cannot connect one (403, not_allowed).","responses":{"201":{"description":"Feed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}},"required":["id","name","url","status"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"The feed URL, as the shop's platform gives it. A comma-separated export or a Google Merchant XML feed."},"name":{"description":"What to call it. Defaults to the host it is fetched from.","type":"string","maxLength":120},"currency":{"description":"Used for prices the feed states with no currency of their own. Defaults to the business currency.","type":"string","minLength":3,"maxLength":3},"deactivate_missing":{"description":"Deactivate products that stop appearing in the feed. On by default; they are never deleted.","type":"boolean"}},"required":["url"]}}}}}},"/v1/owner/feeds/{id}":{"get":{"operationId":"getV1OwnerFeedsById","tags":["integrations"],"summary":"One feed","responses":{"200":{"description":"Feed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"}},"required":["id","name","url","status"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"delete":{"operationId":"deleteV1OwnerFeedsById","tags":["integrations"],"summary":"Disconnect a feed. Its products are deactivated, never deleted.","description":"A feed sets prices, so the owner's AI cannot disconnect one (403, not_allowed).","responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/feeds/{id}/import":{"post":{"operationId":"postV1OwnerFeedsByIdImport","tags":["integrations"],"summary":"Import now rather than waiting for the next scheduled run","responses":{"200":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/webhooks/{id}/rotate-secret":{"post":{"operationId":"postV1OwnerWebhooksByIdRotateSecret","tags":["integrations"],"summary":"Mint a new signing secret, shown once. The old one keeps verifying for 24 hours.","responses":{"200":{"description":"Webhook and its new secret","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"payload_style":{"type":"string","enum":["thin","full"]},"headers":{"type":"array","items":{"type":"string"},"description":"The names of the extra headers; values are never returned."},"active":{"type":"boolean"},"failing_since":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"disabled_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO 8601 instant"},"updated_at":{"type":"string","description":"ISO 8601 instant"},"deliveries":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_delivery_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["pending","delivered","failed","last_delivery_at"]},"secret":{"description":"The signing secret, in this answer and in no other.","type":["string","null"]},"secret_note":{"type":"string"},"previous_secret_until":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","url","events","payload_style","headers","active","failing_since","disabled_at","last_error","created_at","updated_at","deliveries","secret","secret_note","previous_secret_until"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/webhooks/{id}/test":{"post":{"operationId":"postV1OwnerWebhooksByIdTest","tags":["integrations"],"summary":"Send a real, signed, clearly marked test delivery now, with the endpoint's extra headers, and report the HTTP status it got","responses":{"200":{"description":"Test result","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":["string","null"]},"event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"<item type>.<event>, e.g. booking.confirm"},"timestamp":{"type":"string","description":"ISO 8601 instant"},"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"owner, owner_ai, integration, connector, rule, system, customer_agent or customer_human"},"id":{"description":"The user, AI app or key id; null for a customer and for a receipt.","type":["string","null"]},"name":{"description":"The key's or AI app's name.","type":"string"}},"required":["kind","id"]},"channel":{"type":["string","null"]},"sandbox":{"type":"boolean"}},"required":["id","type","state","version","url","actor","channel","sandbox"],"additionalProperties":{}},"test":{"type":"boolean","const":true},"message":{"type":"string"}},"required":["id","type","timestamp","data","test","message"]},"delivery":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","description":"ISO 8601 instant"},"delivered_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"next_attempt_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","webhook_id","event_id","event_type","status","attempts","last_status","last_error","duration_ms","created_at","delivered_at","next_attempt_at"],"additionalProperties":{}}},"required":["delivered","status","duration_ms","error","event","delivery"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/webhooks/{id}/replay":{"post":{"operationId":"postV1OwnerWebhooksByIdReplay","tags":["integrations"],"summary":"Re-queue every matching event since an instant that this endpoint never received","responses":{"200":{"description":"Replay report","content":{"application/json":{"schema":{"type":"object","properties":{"webhook_id":{"type":"string"},"matched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"truncated":{"type":"boolean"},"next_after":{"type":["string","null"]}},"required":["webhook_id","matched","queued","truncated","next_after"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"Re-send every matching event from this instant that this endpoint never received."},"after":{"description":"The next_after of your last call. One call scans at most 500 events from `since`; when the result is truncated, pass its next_after back here to take the next window.","type":"string","maxLength":200}},"required":["since"]}}}}}},"/v1/owner/webhooks/{id}/deliveries":{"get":{"operationId":"getV1OwnerWebhooksByIdDeliveries","tags":["integrations"],"summary":"One endpoint's deliveries, newest first","responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","description":"ISO 8601 instant"},"delivered_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"next_attempt_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","webhook_id","event_id","event_type","status","attempts","last_status","last_error","duration_ms","created_at","delivered_at","next_attempt_at"],"additionalProperties":{}}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["pending","delivered","failed"]}},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/deliveries":{"get":{"operationId":"getV1OwnerDeliveries","tags":["integrations"],"summary":"Deliveries across every endpoint, newest first, keyset paginated","responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","description":"ISO 8601 instant"},"delivered_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"next_attempt_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","webhook_id","event_id","event_type","status","attempts","last_status","last_error","duration_ms","created_at","delivered_at","next_attempt_at"],"additionalProperties":{}}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"query","name":"webhook_id","schema":{"type":"string","minLength":1},"description":"Omit to see every endpoint's deliveries."},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","delivered","failed"]}},{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}]}},"/v1/owner/deliveries/{id}/replay":{"post":{"operationId":"postV1OwnerDeliveriesByIdReplay","tags":["integrations"],"summary":"Send one delivery again, on the row it already has","responses":{"200":{"description":"Delivery","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created_at":{"type":"string","description":"ISO 8601 instant"},"delivered_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"next_attempt_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]}},"required":["id","webhook_id","event_id","event_type","status","attempts","last_status","last_error","duration_ms","created_at","delivered_at","next_attempt_at"],"additionalProperties":{}}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/owner/events":{"get":{"operationId":"getV1OwnerEvents","tags":["integrations"],"summary":"The event stream, oldest first: every booking, order, quote and message event as the same thin event a webhook carries, with who caused it (data.actor), the door (data.channel) and whether it is a sandbox item. Pass the next_cursor of your last page as cursor. The stream trails live by a few seconds, which is what makes that cursor safe as a watermark. For anyone who cannot receive a webhook.","responses":{"200":{"description":"Events and the next cursor","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"<item type>.<event>, e.g. booking.confirm"},"timestamp":{"type":"string","description":"ISO 8601 instant"},"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"owner, owner_ai, integration, connector, rule, system, customer_agent or customer_human"},"id":{"description":"The user, AI app or key id; null for a customer and for a receipt.","type":["string","null"]},"name":{"description":"The key's or AI app's name.","type":"string"}},"required":["kind","id"]},"channel":{"type":["string","null"]},"sandbox":{"type":"boolean"}},"required":["id","type","state","version","url","actor","channel","sandbox"],"additionalProperties":{}}},"required":["id","type","timestamp","data"]}},"next_cursor":{"type":["string","null"]}},"required":["events","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200},"description":"The next_cursor of your last page. Omit to start at the beginning of time."},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"types","schema":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80,"pattern":"^(\\*|[a-z][a-z0-9_]*)(\\.(\\*|[a-z][a-z0-9_]*))?$"}},"description":"Only these event types, patterns allowed: \"booking.*,order.record_payment\", or types repeated."},{"in":"query","name":"since","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only events from this instant onwards."}]}},"/v1/owner/api-keys":{"get":{"operationId":"getV1OwnerApiKeys","tags":["keys"],"summary":"The owner and integration keys, with their scopes, when each was last used, and every call each made outside its scopes; the AI apps' such calls too","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["owner","integration"]},"hint":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"created_at":{"type":"string","description":"ISO 8601 instant"},"created_by":{"type":["string","null"]},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"refusals":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"scope":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enforced":{"type":"boolean"},"first_at":{"type":"string","description":"ISO 8601 instant"},"last_at":{"type":"string","description":"ISO 8601 instant"}},"required":["operation","scope","count","enforced","first_at","last_at"]}}},"required":["id","name","kind","hint","scopes","active","created_at","created_by","last_used_at","expires_at","revoked_at","refusals"]}},"ai_clients":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"name":{"type":["string","null"]},"refusals":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"scope":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enforced":{"type":"boolean"},"first_at":{"type":"string","description":"ISO 8601 instant"},"last_at":{"type":"string","description":"ISO 8601 instant"}},"required":["operation","scope","count","enforced","first_at","last_at"]}}},"required":["kind","id","name","refusals"]}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string"},"label":{"type":"string"}},"required":["scope","label"]}},"presets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["key","name","scopes"],"additionalProperties":{}}},"security":{"type":"object","properties":{"ai_may_create_keys":{"type":"boolean"},"enforce_scopes":{"type":"boolean"}},"required":["ai_may_create_keys","enforce_scopes"]}},"required":["items","ai_clients","scopes","presets","security"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}]},"post":{"operationId":"postV1OwnerApiKeys","tags":["keys"],"summary":"Create an integration key: named, scoped, revocable. The key is in this response and in no other: store it now.","description":"Give a preset (automation, shop_sync, calendar_sync, read_only) or scopes, or both. Only the owner in person creates keys: the owner's AI (over OAuth or the owner MCP) and integration keys get 403 not_allowed.","responses":{"201":{"description":"The key, shown once","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["owner","integration"]},"hint":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"created_at":{"type":"string","description":"ISO 8601 instant"},"created_by":{"type":["string","null"]},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"refusals":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"scope":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enforced":{"type":"boolean"},"first_at":{"type":"string","description":"ISO 8601 instant"},"last_at":{"type":"string","description":"ISO 8601 instant"}},"required":["operation","scope","count","enforced","first_at","last_at"]}},"key":{"description":"The key, in this answer and in no other.","type":["string","null"]},"key_note":{"type":"string"}},"required":["id","name","kind","hint","scopes","active","created_at","created_by","last_used_at","expires_at","revoked_at","refusals","key","key_note"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"What the key is for, as the owner will recognise it: the system it goes into, e.g. \"Zapier\"."},"preset":{"description":"A ready-made scope set: automation, shop_sync, calendar_sync or read_only. Give this or scopes (or both: they add up).","type":"string","enum":["automation","shop_sync","calendar_sync","read_only"]},"scopes":{"description":"The scopes, as narrow as the system needs. Never keys:write.","maxItems":10,"type":"array","items":{"type":"string","enum":["inbox:read","inbox:write","events:read","catalogue:write","availability:write","settings:read","settings:write","setup:run","integrations:write","customers:erase"]}},"expires_at":{"description":"When the key stops working. Omit for a key that works until revoked.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["name"]}}}}}},"/v1/owner/api-keys/{id}":{"delete":{"operationId":"deleteV1OwnerApiKeysById","tags":["keys"],"summary":"Revoke a key, at once and for good","responses":{"200":{"description":"Key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["owner","integration"]},"hint":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"created_at":{"type":"string","description":"ISO 8601 instant"},"created_by":{"type":["string","null"]},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"refusals":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"scope":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enforced":{"type":"boolean"},"first_at":{"type":"string","description":"ISO 8601 instant"},"last_at":{"type":"string","description":"ISO 8601 instant"}},"required":["operation","scope","count","enforced","first_at","last_at"]}}},"required":["id","name","kind","hint","scopes","active","created_at","created_by","last_used_at","expires_at","revoked_at","refusals"]}}}},"401":{"description":"No owner credentials: send an owner key, an integration key or an OAuth token."},"403":{"description":"Not allowed: the problem document says why."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"security":[{"ownerKey":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Any string up to 200 characters, new for each new request. Sending the same key and body again returns the first answer (with Idempotent-Replayed: true) instead of doing it twice; the same key with a different body is refused. Keys are kept for 30 days.","schema":{"type":"string","maxLength":200}},{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/business":{"get":{"operationId":"getV1Business","tags":["public"],"summary":"The business profile","responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":["string","null"]},"timezone":{"type":"string"},"currency":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"item_types":{"type":"array","items":{"type":"string"}}},"required":["name","domain","timezone","currency","languages","item_types"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}}}},"/v1/services":{"get":{"operationId":"getV1Services","tags":["public"],"summary":"Services with duration and price model. Pass next_cursor back as cursor for the next page.","responses":{"200":{"description":"Services","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferBeforeMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bufferAfterMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"granularityMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price":{"anyOf":[{"type":"object","properties":{"model":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"per":{"description":"A fixed price is per booking unless it says per person.","type":"string","enum":["booking","person"]}},"required":["model"],"additionalProperties":{}},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sort":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","durationMin","bufferBeforeMin","bufferAfterMin","capacity","granularityMin","price","active","sort"],"additionalProperties":{}}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}]}},"/v1/products":{"get":{"operationId":"getV1Products","tags":["public"],"summary":"Products. Pass next_cursor back as cursor for the next page.","responses":{"200":{"description":"Products","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["value","currency"]},"stock":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","sku","name","description","price","stock","active"],"additionalProperties":{}}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","maxLength":200}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"q","schema":{"type":"string","maxLength":100}}]}},"/v1/availability":{"get":{"operationId":"getV1Availability","tags":["public"],"summary":"Free slots for a service","description":"Free start times between from and to (at most 14 days). A time that has started, or that starts within the business's minimum notice, is not offered.","responses":{"200":{"description":"Slots","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"durationMin":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","durationMin"],"additionalProperties":{}},"slots":{"type":"array","items":{"type":"object","properties":{"startTime":{"type":"string"}},"required":["startTime"],"additionalProperties":{}}}},"required":["service","slots"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"parameters":[{"in":"query","name":"service_id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"required":true,"description":"Start of the window to search, ISO 8601."},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"required":true,"description":"End of the window, at most 14 days after from."},{"in":"query","name":"party_size","schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}]}},"/v1/quotes":{"post":{"operationId":"postV1Quotes","tags":["public"],"summary":"Request a quote","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"accessToken":{"description":"Shown once, to an anonymous creator: keep it to read or cancel the item.","type":"string"},"replayed":{"type":"boolean"},"identity":{"type":"object","properties":{"recognised":{"type":"string","enum":["strong","weak","none"],"description":"strong: a customer the business knows, proven; weak: same email or phone, not proven; none."},"passes":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"pass":{"type":"string"}},"required":["network","pass"]},"description":"Passes to keep for the person, one per network: present them next time (pass or Sdi-Pass)."},"verify":{"type":"object","properties":{"available":{"type":"boolean","description":"A one-time code can prove the customer: POST /v1/customers/verify."},"sent_to":{"description":"The masked address a code went to.","type":["string","null"]}},"required":["available","sent_to"]},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"state":{"type":"string"}},"required":["network","state"]}},"guide":{"type":"string","description":"How an agent identifies itself and its person: https://surfingdog.ai/for-agents.md"}},"required":["recognised","passes","verify","networks","guide"],"additionalProperties":{}}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"object","properties":{"itemOffered":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"sku":{"type":"string","maxLength":100},"serviceId":{"type":"string"},"productId":{"type":"string"}},"required":["name"]},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991},"description":{"type":"string","minLength":1,"maxLength":5000},"budget":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]},"requestedFor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deliveryAddress":{"type":"object","properties":{"streetAddress":{"type":"string","maxLength":200},"addressLocality":{"type":"string","maxLength":100},"addressRegion":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"addressCountry":{"type":"string","minLength":2,"maxLength":2}}}},"required":["itemOffered","description"]},"contact":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":12}}},"message":{"type":"string","maxLength":20000},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["payload"]}}}}}},"/v1/bookings":{"post":{"operationId":"postV1Bookings","tags":["public"],"summary":"Request a booking","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"accessToken":{"description":"Shown once, to an anonymous creator: keep it to read or cancel the item.","type":"string"},"replayed":{"type":"boolean"},"identity":{"type":"object","properties":{"recognised":{"type":"string","enum":["strong","weak","none"],"description":"strong: a customer the business knows, proven; weak: same email or phone, not proven; none."},"passes":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"pass":{"type":"string"}},"required":["network","pass"]},"description":"Passes to keep for the person, one per network: present them next time (pass or Sdi-Pass)."},"verify":{"type":"object","properties":{"available":{"type":"boolean","description":"A one-time code can prove the customer: POST /v1/customers/verify."},"sent_to":{"description":"The masked address a code went to.","type":["string","null"]}},"required":["available","sent_to"]},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"state":{"type":"string"}},"required":["network","state"]}},"guide":{"type":"string","description":"How an agent identifies itself and its person: https://surfingdog.ai/for-agents.md"}},"required":["recognised","passes","verify","networks","guide"],"additionalProperties":{}}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"object","properties":{"reservationFor":{"type":"object","properties":{"serviceId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["serviceId","name"]},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"partySize":{"type":"integer","minimum":1,"maximum":1000},"totalPrice":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]},"resourceId":{"type":"string"},"notes":{"type":"string","maxLength":5000}},"required":["reservationFor","startTime","endTime"]},"contact":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":12}}},"message":{"type":"string","maxLength":20000},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["payload"]}}}}}},"/v1/orders":{"post":{"operationId":"postV1Orders","tags":["public"],"summary":"Place an order","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"accessToken":{"description":"Shown once, to an anonymous creator: keep it to read or cancel the item.","type":"string"},"replayed":{"type":"boolean"},"identity":{"type":"object","properties":{"recognised":{"type":"string","enum":["strong","weak","none"],"description":"strong: a customer the business knows, proven; weak: same email or phone, not proven; none."},"passes":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"pass":{"type":"string"}},"required":["network","pass"]},"description":"Passes to keep for the person, one per network: present them next time (pass or Sdi-Pass)."},"verify":{"type":"object","properties":{"available":{"type":"boolean","description":"A one-time code can prove the customer: POST /v1/customers/verify."},"sent_to":{"description":"The masked address a code went to.","type":["string","null"]}},"required":["available","sent_to"]},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"state":{"type":"string"}},"required":["network","state"]}},"guide":{"type":"string","description":"How an agent identifies itself and its person: https://surfingdog.ai/for-agents.md"}},"required":["recognised","passes","verify","networks","guide"],"additionalProperties":{}}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"object","properties":{"orderedItem":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"sku":{"type":"string","maxLength":100},"name":{"type":"string","minLength":1,"maxLength":200},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991},"price":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]}},"required":["name","quantity","price"]}},"totalPrice":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["value","currency"]},"billingAddress":{"type":"object","properties":{"streetAddress":{"type":"string","maxLength":200},"addressLocality":{"type":"string","maxLength":100},"addressRegion":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"addressCountry":{"type":"string","minLength":2,"maxLength":2}}},"shippingAddress":{"type":"object","properties":{"streetAddress":{"type":"string","maxLength":200},"addressLocality":{"type":"string","maxLength":100},"addressRegion":{"type":"string","maxLength":100},"postalCode":{"type":"string","maxLength":20},"addressCountry":{"type":"string","minLength":2,"maxLength":2}}},"delivery":{"type":"object","properties":{"method":{"type":"string","enum":["pickup","delivery","digital"]},"when":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["method"]},"paymentMethod":{"type":"string","maxLength":60},"notes":{"type":"string","maxLength":5000}},"required":["orderedItem","totalPrice"]},"contact":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":12}}},"message":{"type":"string","maxLength":20000},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["payload"]}}}}}},"/v1/items/{id}":{"get":{"operationId":"getV1ItemsById","tags":["public"],"summary":"Status of your item","description":"For the customer (an access token, or a pass the item recognises): the item in the business's words and language, with offer (what the business proposed and waits for you to answer, and its terms_sha), waiting_on, next, a six-character reference, and thread: the business's replies and the customer's messages, never its internal notes.","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/items/{id}/cancel":{"post":{"operationId":"postV1ItemsByIdCancel","tags":["public"],"summary":"Cancel your item","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"linked":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":2000},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/items/{id}/accept":{"post":{"operationId":"postV1ItemsByIdAccept","tags":["public"],"summary":"Accept what the business proposed: another time, or a quote","description":"Binds your customer, so it takes the confirm step (ADR-018 §5): send terms_sha, the offer.terms_sha from GET /items/{id} that your person said yes to. Without it nothing is written and the answer is 409 confirm_terms with the terms to show them. An accepted time confirms the booking; an accepted quote creates the booking (confirmed) or the order (accepted) it was for, in linked.","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"linked":{"description":"What an accepted quote became: the booking or order, confirmed.","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"403":{"description":"The item is someone else's: send its access token, or a pass it recognises."},"409":{"description":"confirm_terms (nothing was written: show your person details.summary and accept again with details.terms_sha), offer_changed (details.offer is the current proposal), no_offer, slot_taken, or guard_failed not_too_soon."},"410":{"description":"offer_expired: the quote is no longer valid."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"terms_sha":{"description":"The fingerprint of the terms your person said yes to: offer.terms_sha from get_item_status. Leave it out to be told the terms first; nothing is booked without it.","type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/items/{id}/decline":{"post":{"operationId":"postV1ItemsByIdDecline","tags":["public"],"summary":"Decline what the business proposed","description":"A time the business proposed: the booking request is closed, as your customer chose. A quote: the request is closed. Send reason for anything they want the business to know.","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"linked":{"description":"What an accepted quote became: the booking or order, confirmed.","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"403":{"description":"The item is someone else's: send its access token, or a pass it recognises."},"409":{"description":"confirm_terms (nothing was written: show your person details.summary and accept again with details.terms_sha), offer_changed (details.offer is the current proposal), no_offer, slot_taken, or guard_failed not_too_soon."},"410":{"description":"offer_expired: the quote is no longer valid."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"description":"Anything your person wants the business to know.","type":"string","maxLength":2000},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/items/{id}/counter":{"post":{"operationId":"postV1ItemsByIdCounter","tags":["public"],"summary":"Ask for another time than the one the business proposed","description":"start_time must be one of the free times GET /availability lists; the end follows the service's length. The booking goes back to the business to confirm, with nothing held. 409 slot_taken when that time is not free.","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"linked":{"description":"What an accepted quote became: the booking or order, confirmed.","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"403":{"description":"The item is someone else's: send its access token, or a pass it recognises."},"409":{"description":"confirm_terms (nothing was written: show your person details.summary and accept again with details.terms_sha), offer_changed (details.offer is the current proposal), no_offer, slot_taken, or guard_failed not_too_soon."},"410":{"description":"offer_expired: the quote is no longer valid."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"The start your person would like instead: one of the free times check_availability lists. The end follows the service's length."},"note":{"type":"string","maxLength":2000},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["start_time"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/items/{id}/details":{"post":{"operationId":"postV1ItemsByIdDetails","tags":["public"],"summary":"Send the details the business asked for","description":"An item waiting on your details moves on (200). On any other item they are kept as your message for the business (202 with waiting_on: us). Never refused for the state the item is in.","responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"linked":{"description":"What an accepted quote became: the booking or order, confirmed.","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"202":{"description":"Kept as your message","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"linked":{"description":"What an accepted quote became: the booking or order, confirmed.","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string","description":"In the business's words and language: relay it as it is."},"reference":{"type":"string","description":"Six characters the customer quotes back to the business."},"offer":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time","quote"],"description":"time: another time for a booking; quote: a price for a request."},"terms":{"type":"object","properties":{},"additionalProperties":{},"description":"startTime, endTime, partySize, totalPrice, lines, notes, validThrough, creates: what accepting agrees to."},"terms_sha":{"type":"string","description":"Send it back with accept: the customer said yes to exactly these terms."},"deadline":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}],"description":"Until when the customer can answer."},"obligation_to_pay":{"type":"boolean","description":"Accepting binds the customer to pay."},"human":{"type":"string","description":"The terms in the business's words: tell your person this, as it is."}},"required":["kind","terms","terms_sha","deadline","obligation_to_pay","human"],"additionalProperties":{}},{"type":"null"}]},"waiting_on":{"anyOf":[{"type":"string","enum":["you","us"]},{"type":"null"}],"description":"you: the business waits for the customer; us: the other way."},"next":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"}},"required":["action","label"]},"description":"What the customer can do next."},"thread":{"description":"On the status door: the conversation, oldest first, the last fifty — the business's replies and the customer's messages, never its internal notes.","type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["you","us"],"description":"you: the customer wrote it; us: the business did."},"text":{"type":"string"},"at":{"type":"string","description":"ISO 8601 instant"},"automated":{"description":"Sent automatically: not written by a person.","type":"boolean","const":true}},"required":["from","text","at"]}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human","reference","offer","waiting_on","next"],"additionalProperties":{}},"replayed":{"type":"boolean"}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"403":{"description":"The item is someone else's: send its access token, or a pass it recognises."},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"details":{"type":"string","minLength":1,"maxLength":5000,"description":"The answer to what the business asked."},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["details"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/v1/messages":{"post":{"operationId":"postV1Messages","tags":["public"],"summary":"Send a message, or reply on your item","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","quote_request","booking","order","refund"]},"state":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partyId":{"type":"string"},"locationId":{"type":["string","null"]},"channel":{"type":"string"},"subject":{"type":["string","null"]},"flags":{"description":"The business's own flags; never in a customer's answer.","type":"object","properties":{"needsHuman":{"type":"boolean"},"sandbox":{"type":"boolean"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["needsHuman","sandbox","priority"],"additionalProperties":{}},"linkedItemId":{"type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 instant"},"updatedAt":{"type":"string","description":"ISO 8601 instant"},"closedAt":{"anyOf":[{"type":"string","description":"ISO 8601 instant"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","state","version","partyId","locationId","channel","subject","linkedItemId","createdAt","updatedAt","closedAt","payload"],"additionalProperties":{}},"transitions":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"label":{"type":"string"}},"required":["event","label"]}},"human":{"type":"string"},"party":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"verified":{"type":"boolean"}},"required":["id","name","kind","verified"],"additionalProperties":{}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}},"identity":{"description":"On the status door: who the inbox takes the customer for.","type":"object","properties":{},"additionalProperties":{}}},"required":["item","transitions","human"],"additionalProperties":{}},"accessToken":{"description":"Shown once, to an anonymous creator: keep it to read or cancel the item.","type":"string"},"replayed":{"type":"boolean"},"identity":{"type":"object","properties":{"recognised":{"type":"string","enum":["strong","weak","none"],"description":"strong: a customer the business knows, proven; weak: same email or phone, not proven; none."},"passes":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"pass":{"type":"string"}},"required":["network","pass"]},"description":"Passes to keep for the person, one per network: present them next time (pass or Sdi-Pass)."},"verify":{"type":"object","properties":{"available":{"type":"boolean","description":"A one-time code can prove the customer: POST /v1/customers/verify."},"sent_to":{"description":"The masked address a code went to.","type":["string","null"]}},"required":["available","sent_to"]},"networks":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"state":{"type":"string"}},"required":["network","state"]}},"guide":{"type":"string","description":"How an agent identifies itself and its person: https://surfingdog.ai/for-agents.md"}},"required":["recognised","passes","verify","networks","guide"],"additionalProperties":{}}},"required":["view","replayed"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item_id":{"description":"Reply on an existing item; omit to start a new conversation.","type":"string","minLength":1},"subject":{"type":"string","maxLength":500},"body":{"type":"string","minLength":1,"maxLength":20000},"contact":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":12}}},"message_id":{"type":"string","minLength":1,"maxLength":998},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"idempotency_key":{"description":"Same key + same request = same answer. Required for agents.","type":"string","minLength":1,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}},"required":["body"]}}}}}},"/v1/customers/verify":{"post":{"operationId":"postV1CustomersVerify","tags":["public"],"summary":"Prove you are a customer the business knows (one-time code)","description":"When an item's identity says recognised: weak, the customer gave the email of someone the business knows. Send {item_id, access_token} to have six digits emailed to that address (202 {sent_to}); send them back with code to be recognised (200 {recognised: strong}). 409 nothing_to_verify or already_verified; 422 bad_code or code_expired; 429 too_many_attempts.","responses":{"200":{"description":"Recognised","content":{"application/json":{"schema":{"type":"object","properties":{"recognised":{"type":"string","const":"strong"}},"required":["recognised"]}}}},"202":{"description":"Code sent","content":{"application/json":{"schema":{"type":"object","properties":{"sent_to":{"type":"string","description":"The masked address, like a•••@e•••.pt."},"test":{"description":"A test item: nothing was sent; the code is on the item for the business to read.","type":"boolean","const":true}},"required":["sent_to"]}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"409":{"description":"Nothing to verify, or already verified."},"422":{"description":"Wrong or expired code, or invalid input."},"429":{"description":"Too many attempts or codes."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item_id":{"type":"string","minLength":1},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"code":{"description":"The six digits the customer received. Omit to have them sent.","type":"string","pattern":"^[0-9]{6}$"}},"required":["item_id"]}}}}}},"/v1/items/{id}/receipt-ack":{"post":{"operationId":"postV1ItemsByIdReceiptAck","tags":["public"],"summary":"Counter-sign a receipt on your item","description":"Send a compact JWS signed with your agent's Ed25519 key: header {alg:'EdDSA', typ:'sdi-receipt-ack+jws', jwk:<public jwk>}, payload {rcp:<receipt id>, sha:<base64url(SHA-256(receipt jws))>, iat:<unix seconds>}. The receipt ids are on GET /items/{id}.","responses":{"200":{"description":"Receipt","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":{}}}}},"400":{"description":"Validation Error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"array","items":{}},"data":{}},"required":["success","error","data"]}}}},"422":{"description":"Invalid input: the problem document names the fields to fix."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counter_signature":{"description":"A compact JWS by the customer's agent, EdDSA, header carrying its Ed25519 public `jwk`, payload `{\"rcp\": \"<receipt id>\", \"sha\": \"<base64url(SHA-256(receipt JWS))>\", \"iat\": <unix seconds>}`. Or, for an agent that signs its requests instead (sdi-agent/1) and carries a pass reference, `receipt_id` alone.","type":"string","minLength":1,"maxLength":8192},"receipt_id":{"description":"The receipt to acknowledge, for an agent that signs this request (sdi-agent/1) with a key delegated to the pass reference it sends: the inbox forwards the signature to the network (ADR-017 §3.4). Send this or counter_signature.","type":"string","minLength":1,"maxLength":64},"receipt":{"description":"The receipt JWS being acknowledged, if you want the instance to check it is the one it holds.","type":"string","minLength":1,"maxLength":8192},"access_token":{"description":"Capability secret returned when the item was created without an account.","type":"string","minLength":16,"maxLength":200},"pass":{"description":"The person's passes (sdpass1_…), space-separated, at most 8: presented to the network that issued each, so the business recognises the customer. Or send them in the Sdi-Pass header. Never stored.","type":"string","maxLength":1608},"key":{"description":"The person's key (sdkey1_…), if that is all you have: it is exchanged once for a pass, which comes back in identity.passes — keep the pass and send it next time instead. Never stored.","type":"string","maxLength":200}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}}}}