{"openapi":"3.1.0","info":{"title":"Customer Support Intelligence API","version":"1.0.0","description":"Classify supplied tickets, explain priority and duplicate matches, and draft replies from the conversation in the request. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses the x402 protocol with exact USDC on Base (chain id 8453). Each POST operation has a fixed USD price.\nHow to call an operation:\n1. POST a JSON body matching the operation's requestBody schema to the operation path. Include an Idempotency-Key header (64 hex characters, 32 random bytes).\n2. If you have not paid, the server responds 402 with payment requirements in the body. Pay the exact amount to the payTo address on Base.\n3. Retry the identical request with the same Idempotency-Key and add a payment-signature header containing the x402 payment payload. On success (200) the operation result is returned.\n4. Reuse the same Idempotency-Key only for retries of the same operation and request body; it will not be charged twice.\nAll outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Verify time-sensitive or official data with the cited source before acting."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/customer-support/ticket-classify":{"post":{"operationId":"classify_support_tickets","summary":"Classify support tickets","description":"Classify supplied tickets into billing, access, outage, defect, delivery, or account when one documented keyword list has the most matches. A caller-supplied category list replaces that set. A tie stays unclassified.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","subject":"Cannot log in","body":"I cannot log in. The password page is broken.","email":"ada@analytical.example"},{"id":"t2","subject":"Invoice 104","body":"Please review invoice 104.","email":"grace@navy.example"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"subject":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"matches":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"number"},"terms":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"classified","ticketCount":2,"tickets":[{"id":"t1","row":1,"subject":"Cannot log in","category":"access","status":"classified","matches":[{"category":"access","count":2,"terms":"password, log in"},{"category":"defect","count":1,"terms":"broken"}]},{"id":"t2","row":2,"subject":"Invoice 104","category":"billing","status":"classified","matches":[{"category":"billing","count":1,"terms":"invoice"}]}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/ticket-prioritize":{"post":{"operationId":"prioritize_support_tickets","summary":"Prioritize support tickets","description":"Set priority from a supplied severity and from documented urgency and business-impact phrases. A ticket with none of those signals stays unspecified.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","subject":"Production down","body":"Production down for payroll. This is urgent.","severity":"high","impact":"Payroll for the night shift"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"subject":{"type":"string"},"priority":{"type":"string"},"rank":{"type":"number"},"urgency":{"type":"string"},"impact":{"type":"string"},"impactSignals":{"type":"string"},"signals":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"signal":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"prioritized","ticketCount":1,"tickets":[{"id":"t1","row":1,"subject":"Production down","priority":"critical","rank":4,"urgency":"production down","impact":"Payroll for the night shift","impactSignals":"production, payroll","signals":[{"source":"supplied_severity","signal":"high","detail":"The ticket supplies severity high."},{"source":"urgency_phrase","signal":"production down","detail":"The customer text contains a documented critical phrase."},{"source":"impact_phrase","signal":"production, payroll","detail":"The customer text contains a documented business-impact phrase."}]}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/ticket-deduplicate":{"post":{"operationId":"detect_duplicate_tickets","summary":"Detect duplicate tickets","description":"Find duplicate tickets for the same email address and repeated wording across customers. Each pair names the rule and a confidence level. Tickets are not merged.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","email":"ada@analytical.example","subject":"Cannot log in","body":"The password page returns an error for my account."},{"id":"t2","email":"ada@analytical.example","subject":"Cannot log in","body":"The password page returns an error for my account."},{"id":"t3","email":"grace@navy.example","subject":"Invoice 88","body":"Please review invoice 88."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"pairs":{"type":"array","items":{"type":"object","properties":{"leftId":{"type":"string"},"leftRow":{"type":"number"},"rightId":{"type":"string"},"rightRow":{"type":"number"},"rule":{"type":"string"},"confidence":{"type":"number"},"level":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"checked","ticketCount":3,"pairs":[{"leftId":"t1","leftRow":1,"rightId":"t2","rightRow":2,"rule":"duplicate_text","confidence":0.99,"level":"confirmed","detail":"The subject and customer text match, and both tickets use the same email address."}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/conversation-summarize":{"post":{"operationId":"summarize_a_support_conversation","summary":"Summarize a support conversation","description":"Restate up to three customer sentences and quote supplied agent replies. The summary does not decide that a ticket was resolved.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"text":"Ticket: t1\nSubject: Cannot log in\nCustomer: I cannot log in. The password page is broken.\nAgent: I have resolved this.\n"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"summaries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"subject":{"type":"string"},"summary":{"type":"string"},"excerpts":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"text":{"type":"string"},"truncated":{"type":"boolean"}},"additionalProperties":true}}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"summarized","ticketCount":1,"summaries":[{"id":"t1","row":1,"subject":"Cannot log in","summary":"I cannot log in. The password page is broken.","excerpts":[{"role":"customer","text":"I cannot log in.","truncated":false},{"role":"customer","text":"The password page is broken.","truncated":false},{"role":"agent","text":"I have resolved this.","truncated":false}]}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/sentiment-analyze":{"post":{"operationId":"analyze_ticket_sentiment","summary":"Analyze ticket sentiment","description":"Label customer wording with a documented positive and negative word list. Text with no listed words stays unspecified.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","body":"I am frustrated and disappointed."},{"id":"t2","body":"Thanks, that was helpful."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"subject":{"type":"string"},"label":{"type":"string"},"negative":{"type":"string"},"positive":{"type":"string"}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"checked","ticketCount":2,"tickets":[{"id":"t1","row":1,"subject":"","label":"negative","negative":"disappointed, frustrated","positive":""},{"id":"t2","row":2,"subject":"","label":"positive","negative":"","positive":"helpful, thanks"}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/resolution-suggest":{"post":{"operationId":"draft_a_support_reply","summary":"Draft a support reply","description":"Draft a reply that quotes the customer and a supplied policy only when that policy shares a word with the ticket. The draft does not resolve the ticket or state an unsupplied policy.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","customer":"Ada Lovelace","subject":"Invoice 104","body":"Please review invoice 104.","orderId":"104"}],"policies":[{"id":"p1","text":"Invoice questions are reviewed on the next business day."}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"drafts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"category":{"type":"string"},"policyId":{"type":"string"},"text":{"type":"string"}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"drafted","ticketCount":1,"drafts":[{"id":"t1","row":1,"category":"billing","policyId":"p1","text":"Hello Ada Lovelace. You wrote: \"Please review invoice 104.\" The message matched billing because it contains: invoice. The supplied order reference is 104. The supplied policy p1 says: \"Invoice questions are reviewed on the next business day.\" This draft does not resolve the ticket or record an action."}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/escalation-detect":{"post":{"operationId":"detect_escalation_signals","summary":"Detect escalation signals","description":"Flag a ticket when the text contains a documented escalation phrase, the priority rules mark it critical, or the same email appears on three tickets in the request. No escalation is performed.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","body":"I will speak with my lawyer about this charge."},{"id":"t2","body":"How do I update my profile name?"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"escalated":{"type":"boolean"},"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row":{"type":"number"},"potential":{"type":"boolean"},"rule":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"checked","ticketCount":2,"escalated":false,"tickets":[{"id":"t1","row":1,"potential":true,"rule":"escalation_phrase","detail":"The customer text contains: lawyer."},{"id":"t2","row":2,"potential":false,"rule":"","detail":"No escalation signal was found in the supplied text."}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/customer-support/quality-audit":{"post":{"operationId":"audit_support_reply_quality","summary":"Audit support reply quality","description":"Check supplied replies for a resolution claim, a missing reply, or an email, amount, order, or policy that was not in the ticket. The audit does not confirm that any action happened.","tags":["customer-support"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tickets":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000},"email":{"type":"string","minLength":1,"maxLength":254},"customer":{"type":"string","minLength":1,"maxLength":120},"severity":{"type":"string","minLength":1,"maxLength":40},"impact":{"type":"string","minLength":1,"maxLength":200},"reply":{"type":"string","minLength":1,"maxLength":8000},"orderId":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":8000},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}}},"additionalProperties":false}},"messages":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","agent","system"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"],"additionalProperties":false}},"text":{"type":"string","minLength":1,"maxLength":20000},"csv":{"type":"string","minLength":1,"maxLength":200000},"json":{"type":"string","minLength":1,"maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/csv","application/json","text/plain"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"categories":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"keywords":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","keywords"],"additionalProperties":false}},"policies":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["id","text"],"additionalProperties":false}}},"additionalProperties":false},"example":{"tickets":[{"id":"t1","body":"I cannot log in.","reply":"I have resolved this and refunded $50."},{"id":"t2","body":"Where is invoice 104?"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"ticketsModified":{"type":"boolean"},"actionTaken":{"type":"boolean"},"issueResolved":{"type":"boolean"},"status":{"type":"string"},"ticketCount":{"type":"number"},"findingCount":{"type":"number"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"ticketId":{"type":"string"},"field":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"issues":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-03T12:00:00.000Z","ticketsModified":false,"actionTaken":false,"issueResolved":false,"status":"checked","ticketCount":2,"findingCount":3,"findings":[{"kind":"claim","code":"resolution_claim","ticketId":"t1","field":"reply","detail":"The reply contains \"resolved, refunded\". The claim was not verified, and this audit does not record a resolution."},{"kind":"claim","code":"unsupported_detail","ticketId":"t1","field":"amount","detail":"The reply includes $50, which is not in the supplied ticket or policies."},{"kind":"missing","code":"missing_reply","ticketId":"t2","field":"reply","detail":"No agent reply was supplied. None was written."}],"issues":[],"limitations":["No support system was contacted or changed.","A ticket is not marked resolved, and no reply is sent.","Policies, account details, and customer history are not invented.","A category, priority, or escalation flag comes only from the supplied text and the documented rules.","A similar ticket is a suggestion with a confidence level, not a merged case."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.12"},"protocols":[{"x402":{}}]}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}