{"openapi":"3.1.0","info":{"title":"Duebay API","version":"1.0.0","description":"Duebay is accounts-receivable collections for small teams. Import your open invoices from a CSV, Stripe, or by hand, see your aging and DSO the moment the data lands, and put every overdue invoice on a chasing sequence that steps from a friendly nudge to a firm final notice. When a customer asks whether you can even charge that late fee, the built-in late-fee engine answers from the actual state statute, with the citation shown. The same engine is a single-key API and an MCP server, so AI bookkeeping agents can run collections the way a good finance person does.","contact":{"name":"Duebay","url":"https://www.duebay.com","email":"hello@duebay.com"}},"servers":[{"url":"https://www.duebay.com"}],"security":[{},{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"dc_live_* / dc_test_* / dc_test_sandbox"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]},"Statute":{"type":"object","description":"One state's late-fee / interest / prompt-payment entry. Fields that could not be verified are null, never guessed.","properties":{"state_code":{"type":"string"},"state_name":{"type":"string"},"legal_interest_rate_pct":{"type":["number","null"],"description":"Statutory interest rate (% per year) when a contract is silent."},"interest_rate_citation":{"type":["string","null"]},"interest_rate_summary":{"type":["string","null"]},"contract_rate_summary":{"type":["string","null"],"description":"What the state allows parties to agree to."},"contract_rate_citation":{"type":["string","null"]},"prompt_payment_scope":{"type":["string","null"]},"prompt_payment_rate_summary":{"type":["string","null"]},"prompt_payment_citation":{"type":["string","null"]},"late_fee_notes":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["state_code","state_name","sources","confidence"]},"LateFeeTerms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"status":{"type":"string","enum":["open","partial","paid","void","disputed"]},"source":{"type":"string","enum":["web","csv","api","mcp","stripe"]},"description":{"type":"string"},"currency":{"type":"string"},"amount_cents":{"type":"integer"},"amount_paid_cents":{"type":"integer"},"outstanding_cents":{"type":"integer"},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"days_overdue":{"type":"integer"},"payment_url":{"type":["string","null"]},"late_fee_terms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]},"chasing":{"type":"object","properties":{"reminders_sent":{"type":"integer"},"last_reminded_at":{"type":["string","null"],"format":"date-time"},"next_step_index":{"type":"integer"},"next_action_at":{"type":["string","null"],"format":"date-time"},"paused":{"type":"boolean"}}},"archived":{"type":"boolean"},"customer":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","invoice_number","status","amount_cents","outstanding_cents","issue_date","due_date"]}}},"paths":{"/api/v1/late-fee":{"post":{"summary":"Compute the late fee for an overdue balance from the terms AGREED on the invoice, with the state statute shown alongside: citation, sources and a confidence grade. Deterministic: no model, same input to same output, and every number is reproducible from the plain-English derivation lines. No agreed terms means nothing to charge; the statutory rate is then shown as a labelled reference, never as a fee. Free, no key needed.","operationId":"post_api_v1_late_fee","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"fee_cents":{"type":"integer"},"fee":{"type":"number"},"basis":{"type":"string","enum":["ok","reference_only","not_overdue"],"description":"ok = computed from agreed terms; reference_only = no agreed terms, statutory figure shown as reference; not_overdue = nothing due yet."},"days_overdue":{"type":"integer"},"chargeable_days":{"type":"integer"},"derivation":{"type":"array","items":{"type":"string"},"description":"Plain-English arithmetic, one line per step, reproducible by hand."},"statute":{"oneOf":[{"type":"object","description":"One state's late-fee / interest / prompt-payment entry. Fields that could not be verified are null, never guessed.","properties":{"state_code":{"type":"string"},"state_name":{"type":"string"},"legal_interest_rate_pct":{"type":["number","null"],"description":"Statutory interest rate (% per year) when a contract is silent."},"interest_rate_citation":{"type":["string","null"]},"interest_rate_summary":{"type":["string","null"]},"contract_rate_summary":{"type":["string","null"],"description":"What the state allows parties to agree to."},"contract_rate_citation":{"type":["string","null"]},"prompt_payment_scope":{"type":["string","null"]},"prompt_payment_rate_summary":{"type":["string","null"]},"prompt_payment_citation":{"type":["string","null"]},"late_fee_notes":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["state_code","state_name","sources","confidence"]},{"type":"null"}]},"statute_note":{"type":"string","description":"Present when no statute entry applies: an explicit statute_unavailable note, never an invented rate."},"statute_disclaimer":{"type":["string","null"]},"balance_cents":{"type":"integer"},"due_date":{"type":"string","format":"date"},"as_of":{"type":"string","format":"date"},"terms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]}},"required":["fee_cents","fee","basis","days_overdue","chargeable_days","derivation","statute"]},"request_id":{"type":"string"},"disclaimer":{"type":"string"},"attribution":{"type":"string","description":"Present on free/anonymous responses only."}},"required":["data","request_id"]}}}},"400":{"description":"Invalid request. `details.field` names the offending field; unknown keys list `details.known_keys` so a client can self-correct.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"balance_cents":{"type":"integer","minimum":0,"description":"Outstanding balance in integer cents."},"balance":{"type":"number","minimum":0,"description":"Outstanding balance in dollars, if not using balance_cents."},"due_date":{"type":"string","format":"date"},"as_of":{"type":"string","format":"date","description":"Defaults to today (UTC)."},"state":{"type":"string","description":"Two-letter US state code for statutory context."},"terms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]}},"required":["due_date","terms"],"anyOf":[{"required":["balance_cents"]},{"required":["balance"]}],"description":"Provide balance_cents (integer cents) OR balance (dollars) - one is required, and sending both is an error. Unknown fields are rejected with known_keys listed."}}}}}},"/api/v1/dunning/draft":{"post":{"summary":"Render payment-reminder drafts for an invoice you describe inline: subject and body per step of the standard chase (courtesy heads-up, friendly, firm, final), or one step when `tone` is given. It composes; it does NOT send. Free, no key needed.","operationId":"post_api_v1_dunning_draft","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sequence":{"type":"string"},"as_of":{"type":"string","format":"date"},"days_overdue":{"type":"integer"},"drafts":{"type":"array","items":{"type":"object","properties":{"tone":{"type":"string","enum":["upcoming","friendly","firm","final"]},"offset_days":{"type":"integer","description":"Days relative to the due date (negative = before due)."},"send_on":{"type":"string","format":"date"},"subject":{"type":"string"},"body":{"type":"string"}},"required":["tone","offset_days","send_on","subject","body"]}},"note":{"type":"string"}},"required":["sequence","as_of","days_overdue","drafts"]},"request_id":{"type":"string"},"attribution":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"Invalid request. `details.field` names the offending field; unknown keys list `details.known_keys` so a client can self-correct.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_name":{"type":"string"},"business_name":{"type":"string"},"invoice_number":{"type":"string"},"amount_cents":{"type":"integer","minimum":0},"amount":{"type":"number","minimum":0,"description":"Dollars, if not using amount_cents."},"due_date":{"type":"string","format":"date"},"as_of":{"type":"string","format":"date"},"payment_url":{"type":"string"},"portal_url":{"type":"string"},"tone":{"type":"string","enum":["upcoming","friendly","firm","final"]}},"required":["customer_name","business_name","invoice_number","due_date"],"anyOf":[{"required":["amount_cents"]},{"required":["amount"]}],"description":"Provide amount_cents (integer cents) OR amount (dollars) - one is required. Unknown fields are rejected with known_keys listed."}}}}}},"/api/v1/statutes":{"get":{"summary":"The state late-fee / interest / prompt-payment statute library as structured data: every entry carries its citations, source URLs, an honest confidence grade and the dataset's generated_at. Fields that could not be verified are null, never guessed. Free, no key needed, CDN-cached.","operationId":"get_api_v1_statutes","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"generated_at":{"type":["string","null"]},"disclaimer":{"type":["string","null"]},"count":{"type":"integer"},"states":{"type":"array","items":{"type":"object","description":"One state's late-fee / interest / prompt-payment entry. Fields that could not be verified are null, never guessed.","properties":{"state_code":{"type":"string"},"state_name":{"type":"string"},"legal_interest_rate_pct":{"type":["number","null"],"description":"Statutory interest rate (% per year) when a contract is silent."},"interest_rate_citation":{"type":["string","null"]},"interest_rate_summary":{"type":["string","null"]},"contract_rate_summary":{"type":["string","null"],"description":"What the state allows parties to agree to."},"contract_rate_citation":{"type":["string","null"]},"prompt_payment_scope":{"type":["string","null"]},"prompt_payment_rate_summary":{"type":["string","null"]},"prompt_payment_citation":{"type":["string","null"]},"late_fee_notes":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["state_code","state_name","sources","confidence"]}},"federal_prompt_payment":{"oneOf":[{"type":"object","description":"One state's late-fee / interest / prompt-payment entry. Fields that could not be verified are null, never guessed.","properties":{"state_code":{"type":"string"},"state_name":{"type":"string"},"legal_interest_rate_pct":{"type":["number","null"],"description":"Statutory interest rate (% per year) when a contract is silent."},"interest_rate_citation":{"type":["string","null"]},"interest_rate_summary":{"type":["string","null"]},"contract_rate_summary":{"type":["string","null"],"description":"What the state allows parties to agree to."},"contract_rate_citation":{"type":["string","null"]},"prompt_payment_scope":{"type":["string","null"]},"prompt_payment_rate_summary":{"type":["string","null"]},"prompt_payment_citation":{"type":["string","null"]},"late_fee_notes":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["state_code","state_name","sources","confidence"]},{"type":"null"}]},"statute_note":{"type":"string","description":"Present only when the library is empty on this deployment."}},"required":["count","states"]},"request_id":{"type":"string"},"disclaimer":{"type":"string"}},"required":["data","request_id"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/statutes/{state}":{"get":{"summary":"One state's statute entry, by two-letter code (CA) or name slug (california). A state without a verified entry returns an explicit statute_unavailable error, never an invented rate.","operationId":"get_api_v1_statutes_state","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"state","in":"path","required":true,"description":"Two-letter code or name slug.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"generated_at":{"type":["string","null"]},"disclaimer":{"type":["string","null"]},"statute":{"type":"object","description":"One state's late-fee / interest / prompt-payment entry. Fields that could not be verified are null, never guessed.","properties":{"state_code":{"type":"string"},"state_name":{"type":"string"},"legal_interest_rate_pct":{"type":["number","null"],"description":"Statutory interest rate (% per year) when a contract is silent."},"interest_rate_citation":{"type":["string","null"]},"interest_rate_summary":{"type":["string","null"]},"contract_rate_summary":{"type":["string","null"],"description":"What the state allows parties to agree to."},"contract_rate_citation":{"type":["string","null"]},"prompt_payment_scope":{"type":["string","null"]},"prompt_payment_rate_summary":{"type":["string","null"]},"prompt_payment_citation":{"type":["string","null"]},"late_fee_notes":{"type":["string","null"]},"sources":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["state_code","state_name","sources","confidence"]}},"required":["statute"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such resource: an unknown invoice or customer id, or a state with no verified statute entry (statute_unavailable).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/aging":{"get":{"summary":"The caller's live AR aging report: outstanding balances bucketed current / 1-30 / 31-60 / 61-90 / 90+, the largest overdue balance, and DSO computed by the simple method over the trailing 91 days, with the method stated in the response. Requires a key (reads your own invoices).","operationId":"get_api_v1_aging","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"as_of":{"type":"string","format":"date"},"total_outstanding_cents":{"type":"integer"},"overdue_cents":{"type":"integer"},"overdue_invoice_count":{"type":"integer"},"open_invoice_count":{"type":"integer"},"buckets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["current","d1_30","d31_60","d61_90","d90_plus"]},"label":{"type":"string"},"amount_cents":{"type":"integer"},"invoice_count":{"type":"integer"}},"required":["key","label","amount_cents","invoice_count"]}},"largest_overdue":{"type":["object","null"],"properties":{"invoice_number":{"type":"string"},"customer_name":{"type":["string","null"]},"amount_cents":{"type":"integer"},"days_overdue":{"type":"integer"}}},"dso":{"type":"object","properties":{"days":{"type":["number","null"],"description":"Null when the trailing window has no invoice volume: undefined, not zero."},"period_days":{"type":"integer"},"formula":{"type":"string"},"method":{"type":"string","description":"How DSO was computed, stated plainly."},"note":{"type":"string"}},"required":["days","period_days","formula","method"]}},"required":["as_of","total_outstanding_cents","overdue_cents","buckets","dso"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this: a live key on a free plan, sending reminders without a paid plan, or the monthly API quota exhausted. `details` carries the quota position where one applies.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"A dependency this endpoint needs is not configured on this deployment (the database, or the email provider). Never a fabricated success.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/invoices":{"get":{"summary":"List the caller's invoices, newest first, with the customer, outstanding balance, days overdue and chasing state on each row.","operationId":"get_api_v1_invoices","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"open | partial | paid | void | disputed.","schema":{"type":"string"}},{"name":"overdue","in":"query","required":false,"description":"true = only invoices past due with a balance outstanding.","schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"description":"Only one customer's invoices.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100. Defaults to 25.","schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"description":"Pagination offset. Defaults to 0.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"status":{"type":"string","enum":["open","partial","paid","void","disputed"]},"source":{"type":"string","enum":["web","csv","api","mcp","stripe"]},"description":{"type":"string"},"currency":{"type":"string"},"amount_cents":{"type":"integer"},"amount_paid_cents":{"type":"integer"},"outstanding_cents":{"type":"integer"},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"days_overdue":{"type":"integer"},"payment_url":{"type":["string","null"]},"late_fee_terms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]},"chasing":{"type":"object","properties":{"reminders_sent":{"type":"integer"},"last_reminded_at":{"type":["string","null"],"format":"date-time"},"next_step_index":{"type":"integer"},"next_action_at":{"type":["string","null"],"format":"date-time"},"paused":{"type":"boolean"}}},"archived":{"type":"boolean"},"customer":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","invoice_number","status","amount_cents","outstanding_cents","issue_date","due_date"]}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"request_id":{"type":"string"}},"required":["data","total","limit","offset","request_id"]}}}},"400":{"description":"Invalid request. `details.field` names the offending field; unknown keys list `details.known_keys` so a client can self-correct.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this: a live key on a free plan, sending reminders without a paid plan, or the monthly API quota exhausted. `details` carries the quota position where one applies.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"A dependency this endpoint needs is not configured on this deployment (the database, or the email provider). Never a fabricated success.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Create an invoice, upserting its customer by name in the same call. Unknown body fields are rejected with the known_keys listed, so an agent can self-correct. Idempotent via the Idempotency-Key header.","operationId":"post_api_v1_invoices","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, up to 255 characters, that makes this write safe to retry. The FIRST request with a given key executes; a replay of the same key by the same account returns that original response verbatim with `Idempotent-Replay: true` instead of acting again. A second request sent while the first is still running returns 409 conflict rather than executing in parallel. Keys are scoped to the account and kept for 24 hours. Use a stable key derived from your intent (\"remind-INV-1042-step-1\"), not a fresh random value per attempt - a new value per attempt provides no protection at all.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"status":{"type":"string","enum":["open","partial","paid","void","disputed"]},"source":{"type":"string","enum":["web","csv","api","mcp","stripe"]},"description":{"type":"string"},"currency":{"type":"string"},"amount_cents":{"type":"integer"},"amount_paid_cents":{"type":"integer"},"outstanding_cents":{"type":"integer"},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"days_overdue":{"type":"integer"},"payment_url":{"type":["string","null"]},"late_fee_terms":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]},"chasing":{"type":"object","properties":{"reminders_sent":{"type":"integer"},"last_reminded_at":{"type":["string","null"],"format":"date-time"},"next_step_index":{"type":"integer"},"next_action_at":{"type":["string","null"],"format":"date-time"},"paused":{"type":"boolean"}}},"archived":{"type":"boolean"},"customer":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","invoice_number","status","amount_cents","outstanding_cents","issue_date","due_date"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"Invalid request. `details.field` names the offending field; unknown keys list `details.known_keys` so a client can self-correct.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this: a live key on a free plan, sending reminders without a paid plan, or the monthly API quota exhausted. `details` carries the quota position where one applies.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such resource: an unknown invoice or customer id, or a state with no verified statute entry (statute_unavailable).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The request is well formed but conflicts with existing state: a duplicate invoice number, or an Idempotency-Key whose original request is still in flight.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"A dependency this endpoint needs is not configured on this deployment (the database, or the email provider). Never a fabricated success.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoice_number":{"type":"string"},"amount_cents":{"type":"integer","minimum":0},"amount":{"type":"number","minimum":0,"description":"Dollars, if not using amount_cents."},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"company":{"type":"string"},"state":{"type":"string","description":"Two-letter US state code."}},"required":["name"]},"customer_id":{"type":"string","description":"An existing customer's id, instead of customer."},"description":{"type":"string"},"currency":{"type":"string"},"payment_url":{"type":"string"},"late_fee":{"type":"object","description":"The late-fee terms as agreed on the invoice. The engine never invents terms.","properties":{"type":{"type":"string","enum":["none","flat","percent_monthly","percent_annual"]},"value":{"type":"number","description":"Dollars for flat; percent (e.g. 1.5) for percent types."},"grace_days":{"type":"integer","minimum":0}},"required":["type"]}},"required":["invoice_number","issue_date","due_date"],"allOf":[{"anyOf":[{"required":["amount_cents"]},{"required":["amount"]}]},{"anyOf":[{"required":["customer"]},{"required":["customer_id"]}]}],"description":"Provide amount_cents (integer cents) OR amount (dollars), and customer (upserted by name) OR customer_id - one of each pair is required. Unknown fields are rejected with known_keys listed."}}}}}},"/api/v1/invoices/{id}/remind":{"post":{"summary":"Actually send the next (or a specified) reminder for one invoice, through the same send path the app uses. reminder_sent is logged only after the provider accepted the message; a failed send logs send_failed and returns the real error. Requires a paid plan. Idempotent via Idempotency-Key, so a retry cannot double-email a customer.","operationId":"post_api_v1_invoices_id_remind","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The invoice id.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"A caller-chosen key, up to 255 characters, that makes this write safe to retry. The FIRST request with a given key executes; a replay of the same key by the same account returns that original response verbatim with `Idempotent-Replay: true` instead of acting again. A second request sent while the first is still running returns 409 conflict rather than executing in parallel. Keys are scoped to the account and kept for 24 hours. Use a stable key derived from your intent (\"remind-INV-1042-step-1\"), not a fresh random value per attempt - a new value per attempt provides no protection at all.","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"invoice_id":{"type":"string"},"invoice_number":{"type":"string"},"step_index":{"type":"integer"},"tone":{"type":"string","enum":["upcoming","friendly","firm","final"]},"subject":{"type":"string"},"body":{"type":"string"},"sent_to":{"type":"string"},"provider_message_id":{"type":["string","null"]},"reminders_sent":{"type":"integer"},"next_step":{"type":["object","null"],"properties":{"step_index":{"type":"integer"},"date":{"type":"string","format":"date"}}}},"required":["invoice_id","step_index","tone","subject","body","sent_to"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"400":{"description":"Invalid request. `details.field` names the offending field; unknown keys list `details.known_keys` so a client can self-correct.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this: a live key on a free plan, sending reminders without a paid plan, or the monthly API quota exhausted. `details` carries the quota position where one applies.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such resource: an unknown invoice or customer id, or a state with no verified statute entry (statute_unavailable).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The request is well formed but conflicts with existing state: a duplicate invoice number, or an Idempotency-Key whose original request is still in flight.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Understood, but not actionable in the current state: an archived, paid, void or paused invoice, or a customer with no billing email to send to.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"502":{"description":"An upstream provider rejected or failed the call. For a reminder this means the email was NOT sent, and the activity log records send_failed.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"A dependency this endpoint needs is not configured on this deployment (the database, or the email provider). Never a fabricated success.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"`true` when this response was replayed from a previous request with the same Idempotency-Key rather than executed again.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"step":{"type":"integer","minimum":0,"description":"0-based step to send. Omitted = the invoice's next scheduled step."},"as_of":{"type":"string","format":"date"}}}}}}}},"/api/v1/usage":{"get":{"summary":"The caller's request-log summary: billable calls this month, the plan quota and overage price, and the 20 most recent requests.","operationId":"get_api_v1_usage","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"plan":{"type":"string","enum":["free","pro","scale"]},"month_start":{"type":"string","format":"date-time"},"billable_calls_this_month":{"type":"integer"},"included_calls_per_month":{"type":"integer"},"overage_usd_per_call":{"type":"number"},"rate_limit_per_minute":{"type":"integer"},"recent_requests":{"type":"array","items":{"type":"object","properties":{"endpoint":{"type":"string"},"method":{"type":"string"},"surface":{"type":"string","enum":["rest","mcp"]},"tool":{"type":["string","null"]},"status":{"type":"integer"},"billable":{"type":"boolean"},"request_id":{"type":["string","null"]},"duration_ms":{"type":["integer","null"]},"created_at":{"type":"string","format":"date-time"}}}}},"required":["plan","billable_calls_this_month","included_calls_per_month","recent_requests"]},"request_id":{"type":"string"}},"required":["data","request_id"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"402":{"description":"The plan does not include this: a live key on a free plan, sending reminders without a paid plan, or the monthly API quota exhausted. `details` carries the quota position where one applies.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"A dependency this endpoint needs is not configured on this deployment (the database, or the email provider). Never a fabricated success.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/pricing":{"get":{"summary":"Machine-readable pricing: plans, active-invoice limits, included API calls, per-call overage, rate limits and features, projected from the same module the pricing page renders.","operationId":"get_api_v1_pricing","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"unit":{"type":"string","enum":["call"]},"currency":{"type":"string"},"anonymous":{"type":"object","properties":{"price_usd":{"type":"number"},"rate_limit_per_minute":{"type":"integer"},"rate_limit_per_day":{"type":"integer"},"api_access":{"type":"boolean"},"note":{"type":"string"}}},"sandbox":{"type":"object","properties":{"key":{"type":"string"},"price_usd":{"type":"number"},"rate_limit_per_minute":{"type":"integer"},"rate_limit_per_day":{"type":"integer"},"note":{"type":"string"}}},"plans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["free","pro","scale"]},"name":{"type":"string"},"price_usd_per_month":{"type":"number"},"active_invoices":{"description":"An integer, or the string \"unlimited\"."},"included_api_calls_per_month":{"type":"integer"},"overage_usd_per_call":{"type":"number"},"rate_limit_per_minute":{"type":"integer"},"seats":{"type":"integer"},"api_access":{"type":"boolean"},"mcp_access":{"type":"boolean"},"automation":{"type":"boolean"},"customer_portal":{"type":"boolean"},"exports":{"type":"boolean"},"priority_support":{"type":"boolean"},"features":{"type":"array","items":{"type":"string"}}}}}},"required":["unit","currency","anonymous","plans"]}}}},"401":{"description":"Missing, invalid or revoked API key - or a key without access to this endpoint (the dc_test_sandbox key reaches the compute endpoints only).","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. `Retry-After` gives the seconds until the window resets.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected server error. Never leaks a stack trace or an upstream message.","headers":{"X-Request-Id":{"description":"Echoes the request's `request_id`. Quote it in any support request; it is also the id in the inspectable request log.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current per-minute burst window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current burst window.","schema":{"type":"integer"}},"X-Quota-Limit":{"description":"Calls included in the caller's quota period.","schema":{"type":"integer"}},"X-Quota-Used":{"description":"Billable calls used in the current period. Keyed callers on a monthly plan only.","schema":{"type":"integer"}},"X-Quota-Remaining":{"description":"Calls left in the period. At zero, further calls return 402 upgrade_required.","schema":{"type":"integer"}},"X-Quota-Period":{"description":"`month` for a plan quota, `day` for anonymous, sandbox and test-key callers.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","not_found","unauthorized","upgrade_required","payload_too_large","unsupported_media_type","unprocessable","rate_limited","not_configured","upstream_unavailable","upstream_timeout","internal"]},"message":{"type":"string"},"details":{"type":"object","properties":{"field":{"type":"string","description":"The offending field, when one field caused the rejection."},"known_keys":{"type":"array","items":{"type":"string"},"description":"Every key this endpoint understands, listed on unknown-field errors so an agent can self-correct."}}}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1":{"get":{"summary":"The self-describing API index: base URL, auth rules, response format, the full endpoint list, and links to the OpenAPI manifest, the MCP server, pricing and llms.txt. The entry point for an agent that has only been given the host.","operationId":"get_api_v1_index","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"The API index.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"base":{"type":"string","format":"uri"},"auth":{"type":"string"},"format":{"type":"string"},"unit":{"type":"string"},"determinism":{"type":"string"},"openapi":{"type":"string","format":"uri"},"mcp":{"type":"string","format":"uri"},"docs":{"type":"string","format":"uri"},"developers":{"type":"string","format":"uri"},"pricing":{"type":"string","format":"uri"},"llms_txt":{"type":"string","format":"uri"},"endpoints":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST"]},"path":{"type":"string"},"summary":{"type":"string"},"auth":{"type":"string","enum":["optional","required"]},"paid":{"type":"boolean"}},"required":["method","path","summary","auth"]}},"disclaimer":{"type":"string"}},"required":["name","version","base","endpoints"]}}}}}}}}}