{"openapi": "3.0.3", "info": {"title": "Kyber Hub API", "version": "2.0.0", "description": "Quotes, proposals, invoices, subscriptions and payment links for KyberApps, KyberGate, KyberAccess, KyberWatch and KyberCopy (payee Kyber Systems LLC), across several Stripe accounts. All amounts are integer cents in USD. Every object carries brand and account_id."}, "servers": [{"url": "https://hub.kyberapps.com/api/v1"}], "components": {"securitySchemes": {"bearer": {"type": "http", "scheme": "bearer", "description": "Token created in Settings. Scopes: read, quotes:write, proposals:write, invoices:write, subscriptions:write, links:write, crm:write, catalog:write, ap:write, ledger:write, prospects:write, leads:write, sequences:write, comms:send, admin"}}}, "paths": {"/me": {"get": {"summary": "Who am I", "description": "Returns the token label and scopes.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/pricing-rules": {"get": {"summary": "Pricing rules", "description": "The pricing rules as data: KyberCopy bands, KyberGate floor and bands, manual products, multi-year discounts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/pricing-rules/suggest": {"get": {"summary": "Suggest a line", "description": "Default description, unit and unit price for a product. requires_price=true means the price must be supplied manually.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "product", "in": "query", "schema": {"type": "string"}}, {"name": "qty", "in": "query", "schema": {"type": "string"}}, {"name": "enrollment", "in": "query", "schema": {"type": "string"}}]}}, "/terms": {"get": {"summary": "Agreement text", "description": "Current Master Subscription Agreement text and version.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/orgs": {"get": {"summary": "List organizations", "description": "Each org carries tags (list of strings). tag= narrows to one segment (case-insensitive).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "search", "in": "query", "schema": {"type": "string"}}, {"name": "tag", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create organization", "description": "type is school, district or other. contacts is a list of {name,email,phone,role}. products is a list of product names.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "Sample Academy", "type": "school", "address": "1 Main St, Albany, NY", "enrollment": 900, "contacts": [{"name": "Dana Lee", "email": "dlee@sample.edu", "phone": "", "role": "IT Director"}], "products": ["KyberCopy"], "tax_exempt": true, "tax_exempt_no": "EX-12345", "tags": ["Renewal 2027"]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/tags": {"get": {"summary": "List tags", "description": "Every customer tag with how many customers carry it, most used first.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/orgs/{id}": {"get": {"summary": "Get organization", "description": "Includes the org's quotes, proposals and invoices.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update organization", "description": "Send only the fields you want to change. tags replaces the customer's tags with exactly this list (max 20, 32 characters each).", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"enrollment": 1200, "tags": ["Renewal 2027", "Board approval"]}}}}}}, "/quotes": {"get": {"summary": "List quotes", "description": "status: draft, sent, accepted, expired, declined, converted.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create quote", "description": "Lines: product (KyberGate, KyberAccess, KyberWatch, KyberCopy), description (optional, defaulted), qty, unit, unit_cents or unit_price (dollars), years, term_start, term_end, is_pilot. KyberCopy price is defaulted from the org's enrollment band when unit_cents is omitted. KyberGate never below 500 cents. KyberAccess and KyberWatch need a manual price. discount_type: none, percent (discount_percent, e.g. 10) or fixed (discount_amount in dollars). multi_year_percent: 0, 10 or 15. valid_until defaults to 30 days.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "lines": [{"product": "KyberCopy", "qty": 1, "term_start": "2026-11-01", "term_end": "2027-10-31"}, {"product": "KyberGate", "qty": 800, "unit_price": "5.50", "description": "KyberGate Basic, per device, annual"}], "discount_type": "percent", "discount_percent": 10, "notes": "Pricing held through the validity date."}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/quotes/{id}": {"get": {"summary": "Get quote", "description": "Includes share_path (/q/<token>) for the customer-facing page.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update quote", "description": "Same fields as create. Pass status: declined to decline. Accepted or converted quotes are locked.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"lines": [{"product": "KyberCopy", "qty": 2, "unit_price": "3600"}]}}}}}}, "/quotes/{id}/send": {"post": {"summary": "Mark quote sent", "description": "Sets status=sent and returns share_url. Nothing is emailed; deliver the link yourself.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/quotes/{id}/duplicate": {"post": {"summary": "Duplicate quote", "description": "New draft with a new number.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/quotes/{id}/versions": {"get": {"summary": "Quote versions", "description": "Every saved revision (v1, v2, ...) newest first, each with its lines, total and the changes from the one before.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/quotes/{id}/invoice": {"post": {"summary": "Invoice a quote", "description": "Creates a draft native invoice from the quote's chosen lines (multi-year lines for all years, same discount as a fixed amount) and marks the quote converted. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/proposals": {"get": {"summary": "List proposals", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create proposal from quote", "description": "Snapshots the quote and org, drafts the cover letter, attaches the current agreement text. payment_terms: net30 (PO, Stripe send_invoice) or card (hosted invoice, charge automatically). send: true also marks it sent.", "security": [{"bearer": []}], "x-scope": "proposals:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"quote_id": 1, "payment_terms": "net30", "po_number": "", "send": true}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/proposals/{id}": {"get": {"summary": "Get proposal", "description": "Includes share_url and the quote snapshot.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update proposal", "description": "cover_letter, payment_terms, po_number, term_start, term_end, status (sent/declined). Locked after acceptance.", "security": [{"bearer": []}], "x-scope": "proposals:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"po_number": "PO-2026-118"}}}}}}, "/proposals/{id}/status": {"get": {"summary": "Proposal status", "description": "Acceptance details: accepted_name, accepted_title, accepted_email, accepted_at (UTC), accepted_ip.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/proposals/{id}/send": {"post": {"summary": "Mark proposal sent", "description": "Returns share_url. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "proposals:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices": {"get": {"summary": "List invoices", "description": "Also returns stripe_connected and stripe_test_mode.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create invoice from accepted proposal", "description": "With Stripe connected: creates a draft Stripe invoice from the proposal snapshot (send_invoice net-30 for PO, charge_automatically for card). send: true finalizes and sends it. Without Stripe, or for check/PO tracking, pass manual: true to create a local invoice record (amount defaults to the proposal total).", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"proposal_id": 1, "send": false}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/invoices/{id}": {"get": {"summary": "Get invoice", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Edit draft invoice", "description": "Drafts made here only. Any field from create.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"po_number": "PO-2027-11"}}}}}}, "/invoices/{id}/send": {"post": {"summary": "Finalize and send Stripe invoice", "description": "", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/{id}/mark-paid": {"post": {"summary": "Mark paid (check or PO)", "description": "method: check, ach, po, other. reference: check number or remittance id.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"method": "check", "reference": "chk 10422"}}}}}}, "/receipts": {"get": {"summary": "List received payments", "description": "Checks, wires and other payments received by hand. applied_cents, refunded_cents and unapplied_cents (customer credit) per receipt.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Record a received payment", "description": "One payment applied across the customer's invoices. method: check, wire, ach, card, other. applications: [{invoice_id, amount_cents}], or apply_oldest_first: true. What is not applied is kept as customer credit. received_on defaults to today. currency (USD, CAD, EUR...) defaults to the applied invoices' currency; amounts are in that currency and every invoice must share it.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "amount_cents": 170000, "method": "check", "reference": "CHK 1042", "applications": [{"invoice_id": 7, "amount_cents": 150000}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/receipts/{id}": {"get": {"summary": "Get received payment", "description": "With applications, refunds that drew on it, and receipt_url (the customer's receipt page).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/receipts/{id}/void": {"post": {"summary": "Void received payment", "description": "Bounced check or entered twice: every application is cancelled and the invoices reopen. Refused while a credit refund draws on it.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "check bounced"}}}}}}, "/orgs/{id}/credit": {"get": {"summary": "Customer credit", "description": "credit_cents (US dollars), credit_by_currency, and the received payments it sits on with their currency, oldest first.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/orgs/{id}/credit/apply": {"post": {"summary": "Apply customer credit", "description": "applications: [{invoice_id, amount_cents}]. Oldest credit is used first.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"applications": [{"invoice_id": 9, "amount_cents": 20000}]}}}}}}, "/credit-refunds": {"get": {"summary": "List credit refunds", "description": "Customer credit paid back out.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Refund customer credit", "description": "Record credit paid back to the customer. method: check, ach, wire, card, other. Nothing moves money; it records what you sent. Cannot exceed the customer's credit in that currency. currency defaults to USD.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "amount_cents": 20000, "method": "check", "reference": "CHK 5511"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/credit-refunds/{id}": {"get": {"summary": "Get credit refund", "description": "With the received payments it drew on and refund_url (the customer's refund advice page; add /pdf for the PDF).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/credit-refunds/{id}/email": {"post": {"summary": "Email refund advice", "description": "Emails the customer's billing contact a link to the refund advice with the PDF attached (held on the server while MAIL_MODE=log).", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/payments": {"get": {"summary": "List payments", "description": "The payments ledger: card, ACH and bank payments through Stripe, checks and wires recorded by hand, credit applied. Each has receipt_url (the customer's receipt page).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "invoice_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}}, "/payments/{id}": {"get": {"summary": "Get payment", "description": "One ledger row with receipt_url.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/credit-refunds/{id}/void": {"post": {"summary": "Void credit refund", "description": "The check was never mailed: the amount is customer credit again.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "never mailed"}}}}}}, "/subscriptions": {"get": {"summary": "List subscriptions", "description": "Annual plans mirrored from Stripe, per brand and per Stripe account. amount_cents is the annualised value; next_invoice_at is the renewal date.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "account", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create subscription from accepted proposal", "description": "The proposal's quote must have billing_mode=subscription (or pass it anyway to bill an accepted quote annually). Creates the Stripe subscription on the proposal's account (annual, N-year interval for multi-year lines), the first invoice follows Stripe's collection method. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"proposal_id": 1}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/subscriptions/{id}": {"get": {"summary": "Get subscription", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Set subscription brand", "description": "brand: kyberapps, kybergate, kyberaccess, kyberwatch, kybercopy or unassigned.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"brand": "kybergate"}}}}}}, "/subscriptions/{id}/sync": {"post": {"summary": "Sync subscription from Stripe", "description": "", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/payment-links": {"get": {"summary": "List payment links", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "account", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create payment link", "description": "Stripe-hosted pay page. account (label) defaults to the brand's account. unit_cents or unit_price; qty; recurring: empty (one-off), month or year; product optional (KyberGate, KyberCopy, ...).", "security": [{"bearer": []}], "x-scope": "links:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"brand": "kybergate", "description": "KyberGate \u00b7 1,200 devices \u00b7 2026-27", "unit_price": "6000", "qty": 1, "recurring": "", "org_id": 1}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/payment-links/{id}": {"get": {"summary": "Get payment link", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/payment-links/{id}/deactivate": {"post": {"summary": "Deactivate payment link", "description": "", "security": [{"bearer": []}], "x-scope": "links:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/orgs/{id}/portal": {"post": {"summary": "Customer portal session", "description": "Short-lived Stripe customer-portal URL for the org (invoice history, payment methods, billing details; cancel is off). account optional.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"account": "kyber-systems"}}}}}}, "/stripe-accounts": {"get": {"summary": "List Stripe accounts", "description": "Label, Stripe account id, display name, default brand, mode, connected, webhook secret set, last sync. Never returns keys.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/stripe-accounts/{id}/sync": {"post": {"summary": "Sync one Stripe account", "description": "id is the label or numeric id. full: true also walks products and quotes (the Import existing action). Read-only against Stripe.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"full": false}}}}}}, "/brands": {"get": {"summary": "List brands", "description": "Every brand with legal name, address, support email, website, tax id, accent, logo URL, price family, invoice prefix, its own Stripe account (or null) and bills_from (the account its money goes to: its own, else the umbrella's; null when its own account is disconnected).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "archived", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create brand", "description": "key (optional, from name), name, tagline, legal_name, accent (hex, 3:1 on white), family, support_email, website, address, tax_id, default_terms, payment_text. Connect its Stripe account in Settings, Brands.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "KyberLearn", "accent": "#5B3FD6", "support_email": "hello@kyberapps.com"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/brands/{key}": {"get": {"summary": "Get brand", "description": "One brand plus usage counts (customers, quotes, proposals, invoices, subscriptions, payment links, products).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "key", "in": "path", "required": true, "schema": {"type": "string"}}]}, "patch": {"summary": "Update or archive brand", "description": "Any brand field; archived: true hides it from pickers and keeps history (the umbrella cannot be archived).", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "key", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"tagline": "Learning platform", "archived": false}}}}}}, "/prospects/import": {"post": {"summary": "Import researched prospects", "description": "Fleet research import. accounts: up to 200 schools or districts, each with up to 50 people. Any field may be a plain value or {value, source_url, confidence (0 to 1), found_at (YYYY-MM-DD), notes}; account-level source_url, confidence, found_at and research_notes are the default for its fields and people. Everything lands in the Review queue (/prospects/review); nothing is created or emailed until a person accepts it. Student-pattern and personal mailbox addresses are dropped and counted in blocked_people. Bad accounts come back per index with status invalid and do not stop the rest. Send an Idempotency-Key to retry safely. Schema: GET /api/v1/prospects/import/schema.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"batch": {"ref": "ny-westchester-2026-11", "brand": "kybergate", "brief": "Westchester public districts, tech directors"}, "accounts": [{"name": "Sample Union Free School District", "type": "district", "nces_id": "3600001", "state": "NY", "county": "Westchester", "website": "sampleufsd.org", "enrollment": 4200, "locale": "suburb", "source_url": "https://nces.ed.gov/ccd/districtsearch/", "confidence": 0.9, "found_at": "2026-11-25", "people": [{"name": "Dana Lee", "title": "Director of Technology", "email": {"value": "dlee@sampleufsd.org", "source_url": "https://sampleufsd.org/staff", "confidence": 0.8}}]}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/leads": {"post": {"summary": "Send an inbound lead (Revenue Hub)", "description": "Every product's demo, pricing, signup, trial and contact forms post here. source: demo_request, pricing_page, signup, trial_start, contact_form, chat, referral, webinar or import. school {name, website, state, type (school or district), kind (public, charter, private, religious), enrollment}; person {name, email (required), phone, title, role}; product_interest: brand keys; message; utm_source, utm_medium, utm_campaign, utm_term, utm_content (or utm {...}); page_url; consent; external_id (a repeat with the same external_id returns the first lead with 200). A product token posts only its own brand. The lead joins the school's account (person's email, then NCES ID, website, staff email domain or name), sets lifecycle Engaged (MQL for demo_request and trial_start), routes to an owner, and makes a 1-business-hour reply task. Student accounts are refused with 422. Nothing is emailed to the person. Returns 201 with the lead.", "security": [{"bearer": []}], "x-scope": "leads:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"source": "demo_request", "product_interest": ["kyberaccess"], "school": {"name": "Sample Union Free School District", "state": "NY", "type": "district", "enrollment": 4200}, "person": {"name": "Dana Lee", "email": "dlee@sampleufsd.org", "title": "Director of Technology"}, "message": "Demo for 6 buildings, please.", "utm_source": "google", "page_url": "https://kyberaccess.com/demo", "consent": true, "external_id": "ka-form-123"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}, "get": {"summary": "List leads", "description": "Newest first. A product token sees only its own brand's leads. status: open, new, working, qualified or disqualified.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "source", "in": "query", "schema": {"type": "string"}}]}}, "/events/product": {"post": {"summary": "Send a product event (Revenue Hub timeline)", "description": "What a person or school does in your product: event signup, trial_start, trial_end, activated, milestone (label required), upgrade, downgrade or cancellation. account {external_id (your customer id, as in the billing import), name, state, type, website, nces_id}; person {name, email, title}; occurred_at (ISO 8601 or Unix seconds, default now); label; plan; value_cents; properties (object, up to 4,000 characters); external_id (a repeat returns the first event with 200). Or {events: [...]} up to 100, with a result per index. The event joins the account (external_id, then the person's email, then the school), shows on the company and person timelines, and adds to the engagement score. signup makes the account Engaged and trial_start MQL (never backwards); only those two may add a new prospect, any other unmatched event is refused with 422. A trial start tells the owner; a cancellation at a paying account makes a save task. A product token posts only its own brand. Students are refused. test=true checks it and writes nothing. Returns 201.", "security": [{"bearer": []}], "x-scope": "leads:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"event": "trial_start", "account": {"external_id": "acct_8812", "name": "Sample Union Free School District", "state": "NY"}, "person": {"name": "Dana Lee", "email": "dlee@sampleufsd.org", "title": "Director of Technology"}, "plan": "Pro trial", "occurred_at": "2026-11-26T15:04:05Z", "properties": {"devices": 40}, "external_id": "evt_1001"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}, "get": {"summary": "List product events", "description": "Newest first. A product token sees only its own brand's events.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "event", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}]}}, "/events/product/{id}": {"get": {"summary": "Get product event", "description": "One product event with the account it joined, the stage it moved to and the timeline link.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/leads/report": {"get": {"summary": "Lead report (speed to lead and conversion)", "description": "PL12: days 7, 30, 90 or 365. leads, answered, met (first reply inside the 1-business-hour SLA), met_rate, median and p90 business minutes to first reply, overdue, meetings, deals, won and their rates, grades {A, B, C, D}, by_source and by_brand (leads, meetings, deals, won, meeting_rate, deal_rate, win_rate, avg_score) and by_owner (leads, answered, met_rate, median, p90, overdue). A product token sees only its own brand.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "days", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/leads/{id}": {"get": {"summary": "Get lead", "description": "One lead with its account, owner, SLA state (due, soon, overdue, answered), first touch and score {total 0 to 100, grade A to D, parts [{group, label, points}]} (PL12) enrichment {status (none, pending, done, failed, skipped), domain, website, site_name, logo, enrollment, enrollment_band, error, enriched_at} and merged_into (PL14).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update lead", "description": "As on the lead page: status working, qualified (account moves to SQL) or disqualified with reason; owner_id; answered: true marks it responded (stops the reply clock, ticks the task); deal_id (with deal_role) puts the lead's person on a deal at the same company. Fires lead.updated when PL3 webhooks are on.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"status": "working", "answered": true, "owner_id": 2}}}}}}, "/prospects/import/schema": {"get": {"summary": "Prospect import JSON schema", "description": "The JSON schema for the import body, with the sourcing rules.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/prospects/match": {"get": {"summary": "Does this prospect exist?", "description": "Check before researching or importing: companies that look like this school or district (same NCES ID, PSS ID for private schools, or website, staff email domain, same or similar name in the state), strongest first, each with why and a level (exact, likely, possible). Different NCES IDs, states, counties, school levels or a school versus a district never match.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "name", "in": "query", "schema": {"type": "string"}}, {"name": "state", "in": "query", "schema": {"type": "string"}}, {"name": "website", "in": "query", "schema": {"type": "string"}}, {"name": "nces_id", "in": "query", "schema": {"type": "string"}}, {"name": "pss_id", "in": "query", "schema": {"type": "string"}}, {"name": "type", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/supply": {"get": {"summary": "Research supply gate (LE2)", "description": "Ask before each research batch: pause (true or false) and reason (Review never pauses research while auto-accept is on; otherwise pause while more than 50 wait), auto_accept, waiting, cadence_hours, batch_max, next {segment A, B or C, label, state, have} (the segment and state with the fewest schools), target, verified (decision makers with a buying role and a verified email), pace_per_day, needed_per_day, days_left, segments.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/prospects/briefs": {"get": {"summary": "List research briefs", "description": "Research briefs for the fleet (Prospects, Research briefs): what to find (states, kinds, enrollment bands, roles), what to verify, the brief text, and progress (requested, returned, pending, accepted, rejected, people). status: open (default), draft, requested, returned, closed or all. Send a brief's ref as batch.brief_ref on POST /api/v1/prospects/import and the batch counts against it.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/briefs/{id}": {"get": {"summary": "Get research brief", "description": "One brief by id or ref, with its full text and progress.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/prospects/growth": {"get": {"summary": "Growth dashboard", "description": "GE5: the monthly plan (target, average deal, win rate, meeting and contact rates, coverage, each with set_by you, history or typical), what it takes (need: deals, open deals, pipeline, meetings a month, accounts to contact a week), this month's actuals, the funnel per brand with stage conversion, this week against last week, the sequence leaderboard, research brief ROI and source ROI. Money in cents.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/nurture": {"get": {"summary": "Nurture and expand segments", "description": "GE7: the four segments in order (renewal, cross_sell, lost, not_now), each with on, sequence_id, settings (window, brand, rest, lookback, max_per_run), accounts (org_id, name, why, brand, people, first 200), accounts_n, would_enrol, eligible and refused reasons with counts; sending tells whether outreach is on. Read only: nobody is enrolled while outreach sending is off.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/prospects/pipeline": {"get": {"summary": "Pipeline review", "description": "GE6: this week's pipeline review. totals (open, weighted, stuck, closing this month), this_week and last_week counts (moved, created, advanced, won, won_cents, lost, reopened), moved deals with their events, stuck deals with reasons (rotting, no_next, late, no_value), deals closing this month, the top 10 by value, and the owner workload (open deals, stuck, tasks, overdue, due today, replies waiting, open leads, meetings in 7 days, load). owner is a user id or none. Money in cents.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "owner", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/batches/{id}": {"get": {"summary": "Import batch status", "description": "Counts for one import batch: accounts, people, blocked, invalid, and how many are pending, accepted and rejected.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/credit-notes": {"get": {"summary": "List credit notes", "description": "Issued and void credit notes with lines, amounts applied, refunded and kept as credit, credit_note_url (the customer's copy), currency (the invoice's) and amount_home_cents (US dollars at the invoice's booked rate).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "invoice_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Issue credit note", "description": "On an issued invoice. Either lines: [{line (index on the invoice), qty}], amount_cents with description, or full: true for everything left. Amounts are in the invoice's currency; credit kept from a foreign credit note stays in that currency. apply_cents (default: as much as is due) goes on the invoice; refund_cents with refund_method (check, ach, wire, other) records money sent back; the rest is customer credit. reason: returned, billing_error, discount, duplicate, other. Card refunds through Stripe are made on the invoice page.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"invoice_id": 7, "amount_cents": 25000, "description": "Goodwill credit, outage in October", "reason": "discount"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/credit-notes/{id}": {"get": {"summary": "Get credit note", "description": "One credit note with its lines and where the money went.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/credit-notes/{id}/void": {"post": {"summary": "Void credit note", "description": "reason is required. Its invoice application is taken back and unused credit disappears. Refused when money already went back or its credit was used.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Issued on the wrong invoice"}}}}}}, "/credit-notes/{id}/email": {"post": {"summary": "Email credit note", "description": "Emails the credit note with its PDF to the billing contact through Communications. Returns to and status (logged while mail is in log mode).", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/writeoffs": {"get": {"summary": "List write-offs", "description": "Invoices written off as bad debt with amount, date, reason and status (active or reversed), the journal entries each one posted (journal_entries: number, date, kind, url), plus totals for this year and overall.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "invoice_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}}, "/invoices/{id}/writeoff": {"post": {"summary": "Write off invoice", "description": "Writes the balance of an open invoice off as bad debt; the invoice becomes uncollectible. reason is required; written_on (YYYY-MM-DD, not in the future) defaults to today.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "School closed, uncollectible after collections", "written_on": "2026-11-20"}}}}}}, "/invoices/{id}/writeoff/reverse": {"post": {"summary": "Reverse write-off", "description": "The customer paid after all: the invoice is open again for the amount written off. Send payment to record the money received in the same step (method check, wire, ach or other; a partial amount leaves the rest open); the response then carries the payment and amount_due_cents.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Paid by check", "payment": {"amount_cents": 120000, "method": "check", "reference": "CHK 1042", "paid_on": "2026-11-20"}}}}}}}, "/recurring-invoices": {"get": {"summary": "List recurring invoices", "description": "Schedules with how often (every), next_run, total_cents, monthly_cents, mode (draft or send) and the invoice template, plus totals (active, monthly, due this week, paused).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create recurring invoice", "description": "org_id and lines are required. preset: monthly, quarterly, annually, or custom with every_n and unit (day, week, month). start_date is the first invoice (today or later). end_mode: never, count (end_count) or date (end_date). mode: draft (made for review) or send (issued and emailed). Also brand, terms (net30 and so on), po_number, notes, tax_exempt, discount_type and discount_value.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "name": "Filter seats", "preset": "monthly", "start_date": "2026-12-01", "mode": "draft", "terms": "net30", "lines": [{"description": "KyberGate seats", "qty": 300, "unit_price": "5.00"}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/recurring-invoices/{id}": {"get": {"summary": "Get recurring invoice", "description": "One schedule with its next six dates (upcoming) and the last 24 runs with the invoice each one made.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update recurring invoice", "description": "Any field from create; omitted fields keep their value. Invoices already made are not changed.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"lines": [{"description": "KyberGate seats", "qty": 320, "unit_price": "5.00"}]}}}}}}, "/recurring-invoices/{id}/pause": {"post": {"summary": "Pause recurring invoice", "description": "Dates pass without invoices until it is resumed (no catch-up).", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/recurring-invoices/{id}/resume": {"post": {"summary": "Resume recurring invoice", "description": "Next run moves to the next scheduled date from today.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/recurring-invoices/{id}/end": {"post": {"summary": "End recurring invoice", "description": "No more invoices are made. Invoices already made stay.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/recurring-invoices/{id}/run": {"post": {"summary": "Run recurring invoice now", "description": "Makes the next scheduled invoice today (a draft, or issued and emailed in send mode) and moves the schedule on. Returns the invoice.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/reports": {"get": {"summary": "List reports", "description": "Every report with its headline number and summary for the range (default the last 12 months; brand=all by default), plus links to the financial statements.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/reports/{name}": {"get": {"summary": "Get report", "description": "name: revenue, collected, dso, quotes, methods, products, customers. Returns headline, summary, columns and rows keyed by column (money columns end in _cents), and the total row.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/deals": {"get": {"summary": "List deals", "description": "Pipeline deals with stage, value, weighted value, probability, owner, expected close and idle days. status: open, won, lost. Also returns the stages.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "owner_id", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create deal", "description": "title and org_id are required. value in dollars (or omitted to estimate from products), stage_id (default the first stage), owner_id, expected_close (YYYY-MM-DD), probability, source, notes, contact_ids.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"title": "District renewal 2027", "org_id": 1, "value": "18000", "expected_close": "2027-03-31", "source": "Existing customer"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/deal-stages": {"get": {"summary": "Deal stages", "description": "Pipeline stages in board order with kind (open, won, lost) and probability, plus lost_reasons: the pick list a Lost move must use.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/deals/{id}": {"get": {"summary": "Get deal", "description": "One deal with its last 100 events (stage moves, edits, quotes, tasks).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update or move deal", "description": "Any deal field; stage_id or stage (key or name) moves it. Moving to a Lost stage needs lost_reason from GET /deal-stages lost_reasons (case ignored); any other text is saved as Other with the text in lost_note, or refused with 422 when Other is not on the list. Fires deal.stage_changed, deal.won or deal.lost.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"stage": "won"}}}}}}, "/deals/{id}/bill": {"post": {"summary": "Bill a won deal", "description": "how: quote (quote_id of an accepted quote on the deal), products (the deal's products at list price; terms optional) or plan (plan_id, optional qty_<SKU>, start, terms, trial_days). Makes a draft invoice or a native subscription linked to the deal. Nothing is emailed or charged.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"how": "quote", "quote_id": 12}}}}}}, "/tasks": {"get": {"summary": "List tasks", "description": "Tasks with due date, owner, priority, the record they belong to and bucket (overdue, today, upcoming, nodate, done).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "owner_id", "in": "query", "schema": {"type": "string"}}, {"name": "record_type", "in": "query", "schema": {"type": "string"}}, {"name": "record_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create task", "description": "title is required. due_date, due_time (HH:MM), owner_id, priority (low, normal, high), record_type (deal, customer, contact, quote, invoice, proposal) with record_id.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"title": "Call about the renewal", "due_date": "2026-12-01", "priority": "high", "record_type": "customer", "record_id": 1}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/tasks/{id}": {"get": {"summary": "Get task", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update or complete task", "description": "Any task field; done: true ticks it (fires task.completed), done: false reopens it.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"done": true}}}}}}, "/events": {"get": {"summary": "List events", "description": "Everything that fired a webhook, newest first, kept even when no endpoint listens. type filters (invoice.paid, or invoice.* for a group). Page with before=<next_before>.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}, {"name": "before", "in": "query", "schema": {"type": "string"}}]}}, "/events/{id}": {"get": {"summary": "Get event", "description": "One event by evt_ id, with the object as it was when it happened.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/webhook-endpoints": {"get": {"summary": "List webhook endpoints", "description": "Each endpoint with its events, status and the last 24 hours of deliveries. Also returns every event type.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}, "post": {"summary": "Create webhook endpoint", "description": "url must be public https on port 443. events: list of event types or [\"*\"] for all. brand (optional) limits it to one product's records, for example the lead and meeting events of kyberaccess only. The response carries secret once; verify each delivery with it (see Webhooks below).", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"url": "https://hooks.example.com/kyber", "events": ["invoice.paid", "proposal.signed"], "description": "Accounting sync"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/webhook-endpoints/{id}": {"get": {"summary": "Get webhook endpoint", "description": "With its last 50 deliveries.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update webhook endpoint", "description": "url, events, description, brand (empty for every brand), status (active or disabled). Turning it back on resets the failure count.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"status": "active"}}}}}}, "/webhook-endpoints/{id}/test": {"post": {"summary": "Send test event", "description": "Sends a webhook.test event now and returns the result.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/webhook-endpoints/{id}/delete": {"post": {"summary": "Delete webhook endpoint", "description": "Deletes the endpoint and its delivery log. Events stay.", "security": [{"bearer": []}], "x-scope": "admin", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/people": {"get": {"summary": "List people", "description": "Every contact across customers with customer name and brand, billing and signer flags. role: billing or signer. A product token sees its brand's customers only.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "search", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "role", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Add person", "description": "org_id and a name or email are required. Also phone, role, title, note, billing (makes them the billing contact), signer.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "name": "Dana Lee", "email": "dlee@sample.edu", "title": "Business manager", "billing": true}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/people/{id}": {"get": {"summary": "Get person", "description": "One contact with the customer and the saved email check (valid, risky, invalid, unchecked).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update person", "description": "Any field from add; omitted fields keep their value. billing: true moves the billing contact to this person.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"phone": "518-555-0100", "signer": true}}}}}}, "/people/{id}/delete": {"post": {"summary": "Delete person", "description": "Removes the contact. If they were the billing contact, the next person with an email takes over.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/products": {"get": {"summary": "List price book", "description": "Products with SKU, name, unit, price_cents, tax_rate, brand, family, band and quantity range. status: active or archived.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "family", "in": "query", "schema": {"type": "string"}}, {"name": "search", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create product", "description": "sku and name are required. price_cents (or price in dollars), unit, tax_rate (percent), tax_code, brand, family, band, min_qty, max_qty, cust_qty_min, cust_qty_max.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"sku": "KG-SETUP", "name": "KyberGate onboarding", "unit": "each", "price_cents": 50000, "brand": "kybergate"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/products/{id}": {"get": {"summary": "Get product", "description": "One product with the invoices that used its SKU (latest 50).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update product", "description": "Any field from create. Invoices already made keep their own prices.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"price_cents": 55000}}}}}}, "/products/{id}/archive": {"post": {"summary": "Archive product", "description": "It no longer shows in the line item picker. Restore with /restore.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/products/{id}/restore": {"post": {"summary": "Restore product", "description": "Back in the picker.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/plans": {"get": {"summary": "List plans", "description": "Subscription plans with interval, trial days, items, price per period and per year (period_cents, annual_cents) and active subscribers.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create plan", "description": "name and items are required. items: [{sku (from the price book), qty, pricing: book, fixed (unit_cents) or tiers ([{up_to, unit_cents}], mode volume or graduated)}]. interval month or year, interval_count, trial_days, currency, brand, code.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "KyberGate Annual", "interval": "year", "trial_days": 0, "items": [{"sku": "KG-BASIC", "qty": 500, "pricing": "fixed", "unit_cents": 500}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/plans/{id}": {"get": {"summary": "Get plan", "description": "One plan with its priced lines.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update plan", "description": "Any field from create. New subscriptions use it; existing ones keep their prices.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"trial_days": 30}}}}}}, "/plans/{id}/archive": {"post": {"summary": "Archive plan", "description": "No new subscriptions on it. Existing subscriptions continue.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/plans/{id}/restore": {"post": {"summary": "Restore plan", "description": "Open for new subscriptions again.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/coupons": {"get": {"summary": "List coupons", "description": "Coupons with label (for example 10% off once), redeemed count and state (usable, expired, used up, archived).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create coupon", "description": "code (3 to 32 letters, numbers or dashes), kind percent (percent) or amount (amount_cents), duration once, repeating (duration_months) or forever, expires_on, max_redemptions, brand, name.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"code": "WELCOME10", "kind": "percent", "percent": 10, "duration": "once", "expires_on": "2027-06-30"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/coupons/{id}": {"get": {"summary": "Get coupon", "description": "One coupon with every redemption (document and customer).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update coupon", "description": "Any field from create. The limit cannot go below the times it was already used.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"max_redemptions": 50}}}}}}, "/coupons/{id}/archive": {"post": {"summary": "Archive coupon", "description": "The code stops working. Documents that already carry it keep their discount.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/coupons/{id}/restore": {"post": {"summary": "Restore coupon", "description": "The code works again.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/vendors": {"get": {"summary": "List vendors", "description": "Vendors with payment terms, default expense account, owed_cents, bill count and spend in the last 12 months. status: all or archived. Workspace tokens only.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "search", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create vendor", "description": "name is required. email, terms_days (0 to 365, default 30), expense_account_id, notes.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "Verizon", "terms_days": 30, "email": "billing@verizon.example"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/vendors/{id}": {"get": {"summary": "Get vendor", "description": "One vendor with its latest 100 bills.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update vendor", "description": "Any field from create, or archived: true or false. A vendor with open bills cannot be archived.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"terms_days": 45}}}}}}, "/bills": {"get": {"summary": "List bills", "description": "Bills with number, vendor, vendor_ref, dates, lines, total_cents and status (draft, approved, paid, void; overdue filters approved bills past due), plus AP totals.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "vendor_id", "in": "query", "schema": {"type": "string"}}, {"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create bill", "description": "vendor_id and lines ([{account_id (expense or asset), description, amount_cents}]) are required. vendor_ref, bill_date, due_date (default from the vendor's terms), memo, recur (month, quarter, year). approve: true approves it at once.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"vendor_id": 1, "vendor_ref": "INV-88812", "bill_date": "2026-11-01", "lines": [{"account_id": 12, "description": "Fiber, November", "amount_cents": 129900}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/bills/{id}": {"get": {"summary": "Get bill", "description": "One bill with its lines and the journal entries it posted.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update bill", "description": "Drafts only. Any field from create.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"memo": "Split with KyberCopy"}}}}}}, "/bills/{id}/approve": {"post": {"summary": "Approve bill", "description": "Posts it to the ledger (expense to accounts payable) on the bill date. Refused inside a closed period, and refused (422) when a bill approval rule covers the bill: submit it instead.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/bills/{id}/submit": {"post": {"summary": "Submit bill for approval", "description": "Starts the approval chain of the rules that cover a draft bill (Ledger, Bills, Approval rules). Each approver is notified in turn and decides on the bill page; the last approval books it. Returns the bill with approval.status pending and its steps. note is shown to the approvers.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"note": "Annual renewal, budgeted"}}}}}}, "/bills/approvals": {"get": {"summary": "Bills waiting for approval", "description": "Bills whose approval chain waits on someone: step, of, approver, submitted_by, rules. Also lists the approval rules (covers, steps). Every bill also carries approval (status none, needed, pending, approved, rejected or changed, with steps).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/bills/{id}/pay": {"post": {"summary": "Record bill payment", "description": "Records money already sent: paid_on (not in the future), method (ach, check, wire, card, other), reference, from_account_id (a bank or Stripe balance account; default Bank). Nothing is sent.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"paid_on": "2026-11-20", "method": "ach", "reference": "ACH 55102"}}}}}}, "/bills/{id}/void": {"post": {"summary": "Void bill", "description": "reason is required. Whatever it posted is reversed.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Duplicate of BILL-00012"}}}}}}, "/ledger/accounts": {"get": {"summary": "Chart of accounts", "description": "Every account with code, type and balance_cents (in its normal direction) as of a date. type: asset, liability, equity, income, expense.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "as_of", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create account", "description": "code (1 to 12 letters, digits, dots or dashes, unique), name and type (asset, liability, equity, income, expense); description.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"code": "6450", "name": "Software subscriptions", "type": "expense"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/accounts/{id}": {"get": {"summary": "Account register", "description": "One account with its opening balance and every line in the range with a running balance.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}]}, "patch": {"summary": "Update account", "description": "code, name, description; type only while nothing is posted to it. archived: true or false (an account with a balance, or one the ledger posts to, cannot be archived).", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"name": "Software and SaaS"}}}}}}, "/journal-entries": {"get": {"summary": "List journal entries", "description": "Entries newest first with number, date, memo, kind, source (auto, manual, backfill), total_cents and the record it came from.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}, {"name": "source", "in": "query", "schema": {"type": "string"}}, {"name": "account_id", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Post journal entry", "description": "date, memo and two or more lines [{account_id, debit_cents or credit_cents, memo}]. Debits must equal credits. Refused inside a closed period.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"date": "2026-11-30", "memo": "Owner contribution", "lines": [{"account_id": 1, "debit_cents": 500000}, {"account_id": 30, "credit_cents": 500000}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/journal-entries/{id}": {"get": {"summary": "Get journal entry", "description": "One entry with every debit and credit line.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/journal-entries/{id}/reverse": {"post": {"summary": "Reverse journal entry", "description": "Manual entries only. Posts the opposite entry on date (default today).", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"date": "2026-12-01"}}}}}}, "/bills/{id}/file": {"get": {"summary": "Download bill receipt", "description": "The receipt file as content_base64 with filename, mime and size. 404 when the bill has none.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Upload bill receipt", "description": "content_base64 (PDF, PNG or JPEG, up to 512 KB over the API) and filename. Replaces any file already attached.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"filename": "verizon-nov.pdf", "content_base64": "JVBERi0xLjQK..."}}}}}}, "/bills/{id}/recur": {"post": {"summary": "Set bill schedule", "description": "recur: month, quarter, year, or none to stop. The next draft is dated from the bill date, never in the past.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"recur": "month"}}}}}}, "/bills/recurring/run": {"post": {"summary": "Run recurring bills", "description": "Makes the draft copy of every recurring bill whose next date has come (once per date), as the nightly job does. date (default today) for a catch-up. Nothing is paid.", "security": [{"bearer": []}], "x-scope": "ap:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/deferrals": {"get": {"summary": "Deferred revenue schedules", "description": "Every invoice whose revenue is spread over a term: start, months, recognised_cents, remaining_cents, next_date and the monthly schedule. status: open or done.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Set deferral schedule", "description": "invoice_id and months (2 to 120, or 0 to recognise it all when issued); start (default the issue date), note. Past months post at once.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"invoice_id": 1, "months": 12, "start": "2026-09-01", "note": "Annual licence"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/deferrals/{id}/clear": {"post": {"summary": "Clear deferral schedule", "description": "{id} is the invoice id. Removes the schedule set by hand; the automatic one (proposal term or plan period) applies again.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/ledger/close": {"get": {"summary": "Period close checklist", "description": "For a period end (default the last month end): automatic checks, manual items, whether it can close, the lock date and the close history.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "period", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Close the books", "description": "period_end (must have ended). Refused while an automatic check fails unless force: true with a note. Nothing posts on or before the lock date afterwards.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"period_end": "2026-10-31"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/close/tick": {"post": {"summary": "Tick close item", "description": "period_end, item (bank, credit, tax, review), done (default true), note.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"period_end": "2026-10-31", "item": "bank", "note": "Matched to the October statement"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/close/reopen": {"post": {"summary": "Reopen a period", "description": "to: the new lock date (before the current one), or empty to open everything; note is required.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"to": "2026-09-30", "note": "Late vendor bill for October"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/export": {"get": {"summary": "Accountant export", "description": "The journal for a date range as text: format csv (one row per line), qbo (QuickBooks Online journal import), xero (Xero manual journal import) or iif (QuickBooks Desktop general journal). mode=monthly sums each month into one journal; tracking=1 adds the brand as the QuickBooks class or Xero tracking; chart=1 adds the chart of accounts to an IIF. With iif, monthly or tracking, accounts follow the saved account map and the response adds the pre-export checks.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}, {"name": "format", "in": "query", "schema": {"type": "string"}}, {"name": "mode", "in": "query", "schema": {"type": "string"}}, {"name": "tracking", "in": "query", "schema": {"type": "string"}}, {"name": "chart", "in": "query", "schema": {"type": "string"}}]}}, "/ledger/export/map": {"get": {"summary": "Export account map", "description": "Every ledger account with the QuickBooks (target=qb: account name, type, number) or Xero (target=xero: code, tax rate) account it exports to, whether it is saved or the default, and any problem (QuickBooks Desktop names over 31 characters, invalid Xero codes).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "target", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Save export account map", "description": "Map accounts for one target. A row equal to the default is removed.", "security": [{"bearer": []}], "x-scope": "ledger:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"target": "qb", "accounts": [{"account_id": 12, "ext_name": "Sales", "ext_type": "INC"}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/ledger/exports": {"get": {"summary": "Export history", "description": "Accountant exports made on the Ledger, Export page: format, range, totals, file name, SHA-256 and whether it was marked imported.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/plans/{id}/portal": {"get": {"summary": "Plan portal rules", "description": "What customers may change on this plan in the portal: quantities (min_qty to max_qty), pause (max_pause_days), cancel at period end; with a one-line summary.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Set plan portal rules", "description": "allow_qty, min_qty, max_qty (null for no limit), allow_pause, max_pause_days (1 to 365), allow_cancel. Omitted fields keep their value. Upgrades make a draft invoice for staff; nothing is charged by itself.", "security": [{"bearer": []}], "x-scope": "catalog:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"allow_qty": true, "min_qty": 1, "max_qty": 500, "allow_cancel": true}}}}}}, "/statements": {"get": {"summary": "List financial statements", "description": "The statements and the date range presets they accept.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/statements/{name}": {"get": {"summary": "Get financial statement", "description": "name: profit-and-loss, cash-flow (range or from and to, with the previous period), balance-sheet, trial-balance, ar-aging, ap-aging (as_of). Money in cents.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "range", "in": "query", "schema": {"type": "string"}}, {"name": "from", "in": "query", "schema": {"type": "string"}}, {"name": "to", "in": "query", "schema": {"type": "string"}}, {"name": "as_of", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/dashboard": {"get": {"summary": "Dashboard numbers", "description": "MRR, ARR, open, overdue, paid YTD, active subscriptions, pilots: total, per brand and per Stripe account.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "account", "in": "query", "schema": {"type": "string"}}]}}, "/leads/{id}/duplicates": {"get": {"summary": "List duplicate leads", "description": "PL14: other leads from the same person (same email, or matched to the same person in Hub) that are not repeats and not merged, newest first, each in the GET /api/v1/leads/{id} shape. A product token sees only its own brand.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/leads/{id}/merge": {"post": {"summary": "Merge duplicate lead", "description": "PL14: duplicate_id is folded into this lead: its details fill blanks here, product interest, UTM and answers are joined, the earliest first reply is kept, and its meetings, one-time links, webinar registrations and Freshdesk tickets move here. The duplicate closes as disqualified (Duplicate) with merged_into, so reports count the person once. lead.updated fires on both with change merged. 422 when the leads are not the same person.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"duplicate_id": 118}}}}}}, "/leads/{id}/convert": {"post": {"summary": "Convert lead to deal", "description": "A deal for the lead's account, brand, products and people prefilled from the account (title, value, owner_id, expected_close, stage_id override). Account to Opportunity.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/owners": {"get": {"summary": "List owners", "description": "People who can own leads, deals, tasks and meetings: id, username, name, role.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/records/{type}/{id}/notes": {"get": {"summary": "List notes", "description": "Notes on a record, pinned first. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Add note", "description": "body (up to 4,000 characters; @username notifies a teammate), pinned. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"body": "Demo canceled; wants a time next week", "pinned": false}}}}}}, "/records/{type}/{id}/notes/{note}/pin": {"post": {"summary": "Pin or unpin note", "description": "Toggles the pin. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "note", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/records/{type}/{id}/notes/{note}/delete": {"post": {"summary": "Delete note", "description": "Removes the note. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "note", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/records/{type}/{id}/activities": {"get": {"summary": "List activities", "description": "Logged calls, meetings and emails, newest first, with the allowed outcomes per kind. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Log activity", "description": "kind call (Connected, Left voicemail, No answer, Busy, Wrong number), meeting (Held, No-show, Rescheduled, Canceled), email (Sent, Received) or note; subject, body, outcome, duration_min, at (YYYY-MM-DD or YYYY-MM-DDTHH:MM New York time, blank now; not in the future). {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"kind": "call", "outcome": "Left voicemail", "subject": "Rebook call", "duration_min": 3}}}}}}, "/activities/{id}/delete": {"post": {"summary": "Delete activity", "description": "Removes a logged call, meeting or email.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/records/{type}/{id}/timeline": {"get": {"summary": "Record timeline", "description": "Everything that happened, newest first, as on the record page: notes, calls, meetings, emails, tasks, deal moves, documents, field changes. Each item: at, kind, title, body, actor. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}]}}, "/records/{type}/{id}/emails": {"get": {"summary": "Emails on a record", "description": "Every email Hub sent to the company (or this person) with status, opens and clicks. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/records/{type}/{id}/fields": {"post": {"summary": "Edit record fields", "description": "Inline edit with the same validation and field history as the record page. fields: {key: value}. Company: name, owner_id, website, type, address, enrollment, notes. Person: name, email, phone, title, role, signer, note. Deal: title, value, stage_id, probability, expected_close, owner_id, source, competitor, notes. Custom fields: cf_<id> (GET /custom-fields). {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"fields": {"owner_id": 2, "website": "sampleufsd.org"}}}}}}}, "/custom-fields": {"get": {"summary": "Custom fields", "description": "Custom field definitions for customer, contact and deal with their cf_<id> key, kind and options.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "object", "in": "query", "schema": {"type": "string"}}]}}, "/records/{type}/{id}/links": {"post": {"summary": "Link records", "description": "Associate a deal, company and person: other_type, other_id, role (deal to person: Champion, Decision maker, Billing, Signer, Blocker, Influencer, User, Other). unlink: true removes it. {type} is org, person, deal or lead (a lead is worked on its person).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "type", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"other_type": "person", "other_id": 9, "role": "Champion"}}}}}}, "/orgs/{id}/lifecycle": {"post": {"summary": "Set lifecycle stage", "description": "stage: target, prospect, contacted, engaged, mql, sql, opportunity, customer, churned or disqualified (with reason). Same history as the funnel board.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"stage": "sql"}}}}}}, "/orgs/{id}/profile": {"patch": {"summary": "Update school data", "description": "nces_id, pss_id, school_type, grade_lo, grade_hi, state, county, locale, title_i, frl_pct, devices, vendor, fy_start, district_id, source, interest (brand keys).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"devices": 900, "interest": ["kyberaccess"]}}}}}}, "/orgs/{id}/duplicates": {"get": {"summary": "Possible duplicates", "description": "Companies that look like this one (same NCES ID, website, staff email domain or name), with why and level.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/orgs/{id}/merge": {"post": {"summary": "Merge companies", "description": "drop_id is folded into this company: every quote, invoice, payment, deal, task, file, note and person moves, then drop_id is deleted. Cannot be undone: confirm: true is required. A product token merges only companies filed under its brand.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"drop_id": 42, "confirm": true}}}}}}, "/orgs/{id}/convert": {"post": {"summary": "Convert account to deal", "description": "As the funnel board's Convert to deal: brand, products sized from enrollment or devices, people and close date prefilled; account to Opportunity.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/people/{id}/prospect": {"patch": {"summary": "Update buying role", "description": "committee (buying committee role), personas (brand keys), lifecycle, source.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"committee": "it_director"}}}}}}, "/people/{id}/merge": {"post": {"summary": "Merge people", "description": "drop_id (same company) is folded into this person: blanks filled, links and history moved, drop_id deleted.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"drop_id": 77}}}}}}, "/deals/{id}/delete": {"post": {"summary": "Delete deal", "description": "Removes the deal; its quotes stay and lose the link.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/deals/{id}/quote": {"post": {"summary": "Quote from deal", "description": "Draft quote from the deal's products, linked to the deal. 422 when a product needs a price typed in.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/goals": {"get": {"summary": "Sales goals", "description": "Every active goal with target, actual, pace and status this period and the last six.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/sales-dashboard": {"get": {"summary": "Sales dashboard", "description": "Pipeline by stage, forecast, won and lost, funnel and activity by person. period: 30d, 90d, ytd, 12m or all.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "period", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/win-loss": {"get": {"summary": "Win/loss report", "description": "Win rate, lost reasons, competitors and breakdowns by source, owner and brand.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "period", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/tasks/{id}/delete": {"post": {"summary": "Delete task", "description": "Removes the task.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/tasks/{id}/snooze": {"post": {"summary": "Snooze task", "description": "days: 1 (tomorrow) or 7 (a week), as the Tasks page.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"days": 1}}}}}}, "/tasks/bulk": {"post": {"summary": "Bulk tasks", "description": "ids (up to 500) and action done, tomorrow, week or delete. Tasks outside the token's brand are skipped and listed.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"ids": [1, 2], "action": "done"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/meetings": {"get": {"summary": "List meetings", "description": "when: upcoming (default), past or canceled. Each meeting: status, start, end, host_id, cohost_ids (collective), assigned_by (why round robin picked that host), person, school, company, deal, lead, outcome, cancel_reason, booked_outside_hub. host_id also matches co-hosts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "when", "in": "query", "schema": {"type": "string"}}, {"name": "host_id", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "org_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Record a meeting booked outside Hub", "description": "A demo or call booked by calendar invite, phone or your own scheduler. type_id (or your brand's booking page), start (UTC), duration_min, contact_id or name, email and school, org_id, deal_id, lead_id, notes, status (booked, held, no_show, canceled), cancel_reason, host_id. The company and person are matched or created like a booking. No email, no slot check.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"lead_id": 115, "start": "2026-12-01T15:00:00Z", "status": "booked", "notes": "Booked on Zoom"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/meetings/report": {"get": {"summary": "Meetings report (analytics)", "description": "PL13: days 7, 30, 90 or 365; meetings that started in the period. meetings, held, no_show, canceled, needs_outcome, no_show_rate (no-shows over meetings with an outcome), deals and deal_rate (held demos with a deal), won and win_rate, upcoming, booked_in_period, leads, leads_with_meeting, lead_to_meeting_rate, time_to_first_meeting {median_min, p90_min, within_7_days_rate}, booking_lead_time {median_min}, and the same counts and rates by_rep, by_brand, by_source (the lead's source, else utm_source, else how it was booked) and by_type. A product token sees only its own brand.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "days", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/meetings/{id}": {"get": {"summary": "Get meeting", "description": "One meeting with its outcome, next step and manage link (Hub bookings).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Meeting outcome", "description": "status held or no_show, staff_notes, next_step. Logs the activity on the deal. Cancel with /cancel. PL9: no_show runs the brand's no-show flow once (rebook email to the person, rebook task for the host); the meeting's reminders block shows it.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"status": "held", "next_step": "Send quote"}}}}}}, "/reminder-settings": {"get": {"summary": "Get reminder settings", "description": "PL9. brand (a product token uses its own). confirm (Still on? link in the day-before reminder), no_show_flow, sms, sms_provider_ready, templates {reminder_24, reminder_1, noshow, sms: {subject, body, custom}} with the standard wording when not customised, and the merge fields.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}, "patch": {"summary": "Update reminder settings", "description": "PL9. confirm, no_show_flow, sms (true needs the SMS provider key on the server, else 422) and templates {key: {subject, body}}; blank goes back to the standard wording. Unknown merge fields are refused; the no-show email must keep {rebook_url}.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"confirm": true, "templates": {"reminder_24": {"subject": "Tomorrow: {meeting}", "body": "Hi {first_name}, see you {when}. {confirm_line}{manage_url}"}}}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/meetings/{id}/cancel": {"post": {"summary": "Cancel meeting", "description": "reason is required. Same as the Meetings page: the Google Calendar event is removed, the activity is logged on the deal, meeting.canceled fires. A Hub booking's cancellation email goes through the outbox (held while MAIL_MODE=log); a meeting recorded from outside Hub sends none.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Canceled by phone, wants next week"}}}}}}, "/meetings/{id}/reschedule": {"post": {"summary": "Reschedule meeting", "description": "start: a UTC time from GET /meeting-types/{id}/slots. Hub bookings are slot-checked (409 when taken) and get the updated invite.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"start": "2026-12-03T16:00:00Z"}}}}}}, "/meetings/{id}/deal": {"post": {"summary": "Deal for meeting", "description": "The open deal for this meeting's brand at the company, or a new one.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/meetings/{id}/transcript": {"post": {"summary": "Add meeting transcript", "description": "AI3b. The transcript Google Meet or Granola made (Hub never joins calls). lines [{speaker, start_s, text}] or text in any common export (plain \"Speaker: text\", the Meet Doc, WebVTT, SRT, Granola Markdown, JSON); source granola, meet or api; external_id optional. The same content again answers 200 with change unchanged; new content replaces the old (200 replaced). A booked meeting is marked held. Made and replaced fire meeting.transcribed. 409 when the meeting is marked Do not transcribe, canceled or has not started.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"source": "granola", "lines": [{"speaker": "Dana Lee", "start_s": 4, "text": "We have 1,200 Chromebooks."}]}}}}}, "get": {"summary": "Get meeting transcript", "description": "AI3b. lines [{speaker, start_s, text}], speakers, line_count, duration_s, source. 404 when there is none.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/meetings/{id}/summary": {"get": {"summary": "Get meeting AI summary", "description": "AI3c. attendees [{name, role, school}], pains, current_tools, products_of_interest, objections, budget_and_timing, next_steps, suggested_tasks [{title, due_in_days, accepted}], model, stale (the transcript changed since). 404 when there is none.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/meetings/{id}/workspace": {"get": {"summary": "Get meeting workspace", "description": "PL8. brief {company, committee [{name, title, email, deal_role, booked}], lead {source, message, answers}, deals, emails, usage (product events), meetings, tasks}, agenda [{text, done}] (copied from the meeting type's agenda template), notes, outcome_reason, next_step, next_due, recap {subject, body, saved, message_id, sent_at} and followup_task. Read only; built from Hub's records, no AI. PL8b: ai {available, account_brief {headline, know, watch_out, ask, model, stale} (the company's stored AI brief, null when none), agenda_suggestion {items, why, model, stale, used_at} (null when none)}.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update meeting workspace", "description": "agenda [{text, done}] (up to 20), notes (internal; lines starting with + go in the recap), status held or no_show, outcome_reason (next_meeting, proposal, trial, nurture, not_fit, no_decision), next_step, next_due YYYY-MM-DD. Omitted fields stay. A status change works like PATCH /meetings/{id} (activity, deal, lifecycle, webhooks).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"agenda": [{"text": "Live walkthrough", "done": true}], "status": "held", "outcome_reason": "proposal", "next_step": "Send pricing for 3 buildings", "next_due": "2026-12-04"}}}}}}, "/meetings/{id}/agenda-suggestion": {"post": {"summary": "Suggest meeting agenda with AI", "description": "PL8b. Behind Settings, AI, Account brief. AI suggests 3 to 7 agenda items from the account facts, the meeting type's template and why they booked (no email addresses or phones are sent). Stored as a suggestion; use true also puts it on the agenda (ticked items stay); again true asks again. Returns the workspace. 503 when AI or the feature is off or over budget; 422 for a canceled meeting.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"use": true}}}}}}, "/meetings/{id}/recap": {"post": {"summary": "Send meeting recap", "description": "Emails the recap to the person from the brand's address: subject and body default to the saved or generated draft (covered agenda items, notes marked +, next step); to defaults to the person. dry_run true returns the draft only. Held on the server while MAIL_MODE=log. 422 for a canceled meeting.", "security": [{"bearer": []}], "x-scope": "comms:send", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"dry_run": true}}}}}}, "/meetings/{id}/recap-draft": {"post": {"summary": "Draft meeting recap with AI", "description": "PL8c. Behind Settings, AI, Draft with AI. AI writes the recap email from the covered agenda items, notes marked +, the next step and the AI summary of the transcript when there is one (internal notes, email addresses and phones are not sent). Stored as the recap draft; nothing is sent (POST /meetings/{id}/recap sends it). Returns the workspace; recap.ai_model names the model. 503 when AI or the feature is off or over budget; 422 for a canceled meeting or when nothing is covered, noted or agreed yet.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/meetings/{id}/followup": {"post": {"summary": "Follow-up task for meeting", "description": "One task for the next step, owned by the host, on the deal (else the person, else the company); title and due_date optional (default: the next step, due next_due or in two business days). Calling it again updates the same open task.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"due_date": "2026-12-04"}}}}}}, "/orgs/{id}/brief": {"get": {"summary": "Get account AI brief", "description": "AI4b. What to know before the call: headline, know, watch_out, ask (lists of short strings), model, stale (the account changed since). 404 when none was made.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/people/{id}/brief": {"get": {"summary": "Get person AI brief", "description": "AI4b2. What to know before a call with this person: headline, know, watch_out, ask (lists of short strings), model, stale (the person changed since). 404 when none was made.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/deals/{id}/brief": {"get": {"summary": "Get deal AI brief", "description": "AI4b2. Where this deal stands: headline, know, watch_out, ask (lists of short strings), model, stale (the deal changed since). Brand-scoped. 404 when none was made.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/leads/{id}/enrichment": {"get": {"summary": "Get lead AI suggestions", "description": "AI4c. suggestions [{field, label, value, why, status (pending, accepted, dismissed, skipped), ai_suggested}] for school_type, grade_lo, grade_hi, locale, state, enrollment, devices, vendor, committee and needs, made from what the lead sent and the stored school data; model, stale (the lead changed since). Every value stays AI-suggested until a person accepts it on the lead page. 404 when none.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/meeting-types": {"get": {"summary": "List meeting types", "description": "Booking pages per brand and per person, with url, length, host and active.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create meeting type", "description": "name, scope brand or user (a person's own booking page), host_id, slug, duration_min, buffer_before_min and buffer_after_min (buffer_min sets both), notice_min (minimum notice), window_days (bookable up to N days ahead, 1 to 90, default 21), max_per_day, max_per_week, holidays none or us (closed on US federal holidays), secret (unlisted: left off the team page, booking-links and /fleet), location_kind meet or phone, location, description, active, assign single, round_robin (the next free teammate: priority, then fewest meetings that week) or collective (every teammate free and attending), team [{user_id, priority 1 high, 2 normal, 3 low}] for round robin and collective.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "KyberAccess follow-up", "host_id": 2, "duration_min": 20}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/meeting-types/{id}": {"get": {"summary": "Get meeting type", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update meeting type", "description": "Any field from create; active false turns the booking page off.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"duration_min": 25}}}}}}, "/meeting-types/{id}/slots": {"get": {"summary": "Open slots", "description": "Open start times (UTC) for the next days (default 14, at most 21), and the booking_url to send for rebooking.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "days", "in": "query", "schema": {"type": "string"}}]}}, "/meeting-types/{id}/single-use-links": {"post": {"summary": "Make single-use booking link", "description": "PL10. A link that books this meeting type once, filled in for one person, then stops working (410). lead_id (fills name, email, school and role and links the meeting to the lead) or name, email, school, role; note; expires_days 1 to 90 (default 14). Works for unlisted types. -> url, state (open), expires_at.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"lead_id": 12, "expires_days": 7}}}}}}, "/webinars": {"get": {"summary": "List webinars", "description": "PL11. when upcoming (default), past or canceled; brand (a product token sees its own). -> webinars [{id, brand, kind webinar or group_demo, title, start, end, when, capacity, registered, seats_left, full, attended, no_shows, status, register_url, recording_url}].", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}, "post": {"summary": "Create webinar", "description": "PL11. title, brand (a product token uses its own), kind webinar or group_demo, starts_at (ISO, UTC), tz, duration_min, capacity (0 = no limit), host_id, join_url, description, slug, sequence_id with handoff attended or all (who is handed to the sequence after the follow-up).", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"title": "KyberGate live walkthrough", "starts_at": "2026-12-10T19:00:00Z", "duration_min": 45, "capacity": 100}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/webinars/{id}": {"get": {"summary": "Get webinar", "description": "PL11. One session with its counts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update webinar", "description": "PL11. Any field from create; recording_url; status canceled emails everyone registered a cancellation.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"recording_url": "https://example.com/rec"}}}}}}, "/webinars/{id}/registrations": {"get": {"summary": "List registrations", "description": "PL11. status registered, attended, no_show or canceled. Each has lead_id, manage_url and calendar_url.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Register for webinar", "description": "PL11. From your product's own page. person {name, email, title} (or name, email, role), school {name} (or school), page_url, utm_*. Makes a Hub lead with source webinar, emails the invite with a calendar file, then reminders 24 hours and 1 hour before. Same email twice returns the first registration (200). 409 when full. test=true checks it and writes nothing.", "security": [{"bearer": []}], "x-scope": "leads:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"person": {"name": "Dana Lee", "email": "dlee@sampleufsd.org", "title": "Director of Technology"}, "school": {"name": "Sample UFSD"}}}}}}}, "/webinars/{id}/attendance": {"post": {"summary": "Mark attendance", "description": "PL11. attended and no_show: lists of registration ids or emails; rest_no_show true marks everyone left. Attended logs an activity and fires webinar.attended.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"attended": ["dlee@sampleufsd.org"], "rest_no_show": true}}}}}}, "/webinars/{id}/followup": {"post": {"summary": "Send webinar follow-up", "description": "PL11. recording_url (if not saved yet). Attendees get the recording with thanks, no-shows a sorry-we-missed-you with it, once per person; then attendees (or everyone marked, by handoff) go to the session's sequence. Needs every registrant marked. -> emailed, enrolled, refused.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/orgs/{id}/emails": {"post": {"summary": "Email the company", "description": "One email from the brand's sender through the dashboard composer: to (addresses) or contact_ids, cc, subject, body ({link} and merge fields), event (template key), schedule. Tracked and logged on the record; held on the server while MAIL_MODE=log. Suppressed, student and personal addresses are refused (422). To a company that is not a customer this is outreach: 409 while outreach sending is off.", "security": [{"bearer": []}], "x-scope": "comms:send", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"contact_ids": [9], "subject": "Rebooking your demo", "body": "Hi {contact_first_name}, pick any time here: https://hub.kyberapps.com/book/kyberaccess/demo"}}}}}, "get": {"summary": "List company emails", "description": "Every email Hub sent to the company, newest first.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/emails/{id}": {"get": {"summary": "Get email", "description": "One email with its events (queued, logged, sent, opened, clicked, bounced).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/sequences": {"get": {"summary": "List sequences", "description": "Sequences with steps, people in them and results, plus outreach (enabled, paused, sending).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "archived", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Create sequence", "description": "name, brand, description, owner_id, win_start and win_end (send window hours), meeting_type_id ({booking_link}), scope single or suite (featured), audience prospects or customers, stop_reply, stop_meeting, stop_deal; steps to add at once. Starts as a draft.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "KyberAccess demo rebook", "steps": [{"kind": "auto_email", "subject": "Hi {first_name}", "body": "Pick a time: {booking_link}"}]}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/sequences/{id}": {"get": {"summary": "Get sequence", "description": "Steps with the business day each lands on, stats and the people enrolled.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}, "patch": {"summary": "Update sequence", "description": "Any field from create; status draft, active, paused or archived (archiving stops everyone in it).", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"status": "active"}}}}}}, "/sequences/{id}/steps": {"post": {"summary": "Add step", "description": "kind auto_email, manual_email, call, linkedin or task; wait_days (business days); subject, body with merge fields; subject_b and body_b for an A/B test; note for call and task.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"kind": "manual_email", "wait_days": 2, "subject": "Following up", "body": "Any luck, {first_name}?"}}}}}}, "/sequences/{id}/steps/{step}": {"patch": {"summary": "Update step", "description": "Any field from add step.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "step", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"wait_days": 3}}}}}}, "/sequences/{id}/steps/{step}/delete": {"post": {"summary": "Delete step", "description": "Refused when people are already past it.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "step", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/sequences/{id}/steps/{step}/move": {"post": {"summary": "Move step", "description": "direction: up or down.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "step", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"direction": "up"}}}}}}, "/sequences/{id}/enroll": {"post": {"summary": "Enroll people", "description": "contact_ids, or list_id with optional role; allow_risky; dry_run: true previews who would be enrolled and who is refused. Enrolling works while outreach sending is off, exactly as on the dashboard: state is queued and nothing is sent until sending is on.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"contact_ids": [9], "dry_run": true}}}}}}, "/sequences/{id}/enrollments": {"get": {"summary": "List enrolments", "description": "People in the sequence with status, step and next time.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "status", "in": "query", "schema": {"type": "string"}}]}}, "/sequences/{id}/ai-text/{contact_id}": {"get": {"summary": "Get personal sequence text", "description": "AI4d. The email text AI wrote for one person in this sequence: state (draft, approved, stale) and steps [{step_id, subject, body, status, model, approved_by, approved_at}]. Only approved text replaces the step templates when a step runs; outreach, checks and limits still apply. Read only; 404 when none.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string"}}]}}, "/enrollments/{id}": {"get": {"summary": "Get enrolment", "description": "One enrolment with its events (enrolled, email_sent, task_created, paused, stopped).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/enrollments/{id}/{action}": {"post": {"summary": "Pause, resume, stop, skip or send", "description": "action pause, resume, stop (reason), skip (a manual email waiting for review) or send (subject, body: approve the reviewed manual email; 409 while outreach sending is off).", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "action", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Booked by phone"}}}}}}, "/sequence-queue": {"get": {"summary": "Review queue", "description": "Manual emails waiting for review with the draft rendered for each person.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/sequence-content": {"get": {"summary": "Content library", "description": "Per product brand: pitch, proof, link, call to action and short line (used by {suite_block}).", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}}, "/sequence-content/{brand}": {"patch": {"summary": "Update content", "description": "pitch, proof, link, cta, short.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "brand", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"short": "Visitor management for schools"}}}}}}, "/enrol-rules": {"get": {"summary": "List enrolment rules", "description": "Rules with segment, target sequence, triggers, on or off and any problem, plus outreach state.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}, "post": {"summary": "Create enrolment rule", "description": "name, mode sequence (sequence_id) or interest (product_map, suite_sequence_id, cross_sequence_id; workspace tokens only), segment {interest, states, school_type, bands, title_i, roles, stages, list}, owner_id, on_accept, on_import, on_nightly, max_per_run. Starts off.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "KyberAccess NY districts", "sequence_id": 3, "segment": {"states": ["NY"], "school_type": "district"}}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/enrol-rules/{id}": {"get": {"summary": "Get enrolment rule", "description": "With the last 20 runs and previews.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update enrolment rule", "description": "Any field from create; active true or false.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"active": true}}}}}}, "/enrol-rules/{id}/delete": {"post": {"summary": "Delete enrolment rule", "description": "", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/enrol-rules/{id}/preview": {"post": {"summary": "Dry run enrolment rule", "description": "Who would be enrolled into which sequence, who is refused and why. Nothing is enrolled.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/enrol-rules/{id}/run": {"post": {"summary": "Run enrolment rule", "description": "Enrols the dry run's people now. 409 while outreach sending is off or paused.", "security": [{"bearer": []}], "x-scope": "sequences:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/replies": {"get": {"summary": "List replies", "description": "The reply inbox: classification, account, sequence and what the rules did.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "class", "in": "query", "schema": {"type": "string"}}, {"name": "owner_id", "in": "query", "schema": {"type": "string"}}, {"name": "search", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Log a reply", "description": "A reply to outreach from a mailbox forwarder: from, from_name, to, subject, text, received_at, external_id (a repeat returns the first), class (optional). Rules sort it and act.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"from": "Dana Lee <dlee@sampleufsd.org>", "subject": "Re: KyberAccess", "text": "Interested, can we talk Tuesday?", "external_id": "msg-123"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/replies/{id}": {"patch": {"summary": "Classify or handle reply", "description": "class interested, meeting, not_now, referral, ooo, objection, unsubscribe or other (runs that class's actions); until (YYYY-MM-DD) for not_now and ooo; status new or handled.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"class": "meeting"}}}}}, "get": {"summary": "Get reply", "description": "One reply with its classification, reason and the actions taken.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/replies/{id}/drafts/{draft}": {"patch": {"summary": "Edit drafted answer", "description": "subject, body.", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "draft", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"body": "Great, here is my calendar."}}}}}}, "/replies/{id}/drafts/{draft}/discard": {"post": {"summary": "Discard drafted answer", "description": "", "security": [{"bearer": []}], "x-scope": "crm:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "draft", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/replies/{id}/drafts/{draft}/send": {"post": {"summary": "Approve and send answer", "description": "Sends the drafted answer (subject and body may be edited) through the outreach gate with the brand footer and unsubscribe. 409 while outreach sending is off.", "security": [{"bearer": []}], "x-scope": "comms:send", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "draft", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/prospects": {"get": {"summary": "Prospect accounts", "description": "The Prospects list builder as data, with the funnel counts per lifecycle stage.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "stage", "in": "query", "schema": {"type": "string"}}, {"name": "state", "in": "query", "schema": {"type": "string"}}, {"name": "school_type", "in": "query", "schema": {"type": "string"}}, {"name": "band", "in": "query", "schema": {"type": "string"}}, {"name": "owner", "in": "query", "schema": {"type": "string"}}, {"name": "list", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}, {"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/review": {"get": {"summary": "Review queue", "description": "Researched accounts waiting (pending), accepted or rejected, with the match and the account as sent.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "batch_id", "in": "query", "schema": {"type": "string"}}, {"name": "search", "in": "query", "schema": {"type": "string"}}]}}, "/prospects/review/{id}": {"get": {"summary": "Get review item", "description": "", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Edit review item", "description": "Correct account fields before accepting.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"county": "Westchester"}}}}}}, "/prospects/review/{id}/accept": {"post": {"summary": "Accept review item", "description": "Creates the company (or fills the matched one) and its people. list_id, stage (target to opportunity), skip_people (indexes), owner_id, as_new. Nobody is enrolled or emailed.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"list_id": 4, "stage": "prospect"}}}}}}, "/prospects/review/{id}/reject": {"post": {"summary": "Reject review item", "description": "reason.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "Not a fit"}}}}}}, "/prospect-lists": {"get": {"summary": "List prospect lists", "description": "Static lists and smart lists (saved segments) with live counts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}}, "post": {"summary": "Create list or segment", "description": "name, kind static (org_ids) or smart (filters: stage, state, school_type, locale, band, source, owner, title_i, brand, q), description.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"name": "NY districts", "kind": "smart", "filters": {"state": "NY", "school_type": "district"}}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/prospect-lists/{id}": {"get": {"summary": "Get prospect list", "description": "With its member accounts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "patch": {"summary": "Update list", "description": "name, description; add and remove company ids on a static list.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"add": [12, 13]}}}}}}, "/prospect-lists/{id}/delete": {"post": {"summary": "Delete list", "description": "The companies stay.", "security": [{"bearer": []}], "x-scope": "prospects:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/native": {"post": {"summary": "Create invoice (made here)", "description": "A draft invoice without Stripe: org_id, lines [{description, qty, unit_price or unit_cents, sku, product}], discount_type (none, percent, fixed) with discount_value, tax_exempt, issue_date, terms, due_date, po_number, notes, memo, currency. Numbered from the brand's series. issue: true issues it at once. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "lines": [{"description": "KyberAccess annual license", "qty": 1, "unit_price": "4800"}], "terms": "net30"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/invoices/{id}/issue": {"post": {"summary": "Issue invoice", "description": "Draft to open. Nothing is emailed: POST /invoices/{id}/email sends it.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/{id}/void": {"post": {"summary": "Void invoice", "description": "Invoices made here and PO or check invoices. Paid and Stripe invoices are refused.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/{id}/duplicate": {"post": {"summary": "Duplicate invoice", "description": "A new draft with the same lines.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/{id}/uncollectible": {"post": {"summary": "Mark invoice uncollectible", "description": "For a write-off with a ledger entry use /writeoff.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/invoices/{id}/email": {"post": {"summary": "Email invoice", "description": "To the billing contact (or to, cc) with the brand's template for its state and the PDF attached, through the composer. Held on the server while MAIL_MODE=log.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/quotes/{id}/extend": {"post": {"summary": "Extend quote", "description": "valid_until (YYYY-MM-DD); an expired quote reopens.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"valid_until": "2027-01-31"}}}}}}, "/quotes/{id}/restore": {"post": {"summary": "Restore quote version", "description": "version: an older revision becomes the newest. Nothing is deleted.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"version": 1}}}}}}, "/quotes/{id}/approval": {"get": {"summary": "Quote approval state", "description": "blocked, status (off, needed, pending, approved, rejected), the rules it breaks and its requests.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}, "post": {"summary": "Request quote approval", "description": "note. withdraw: true takes a pending request back. The approver decides on the dashboard.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"note": "Multi-year discount for a district"}}}}}}, "/subscriptions/native": {"post": {"summary": "Start subscription on a plan", "description": "org_id, plan_id, qty_<SKU>, coupon, trial_days, start, terms, auto_renew. Nothing is charged; bill each period with /bill.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "requestBody": {"content": {"application/json": {"example": {"org_id": 1, "plan_id": 2, "qty_KA-SITE": "3"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}]}}, "/subscriptions/{id}/change/preview": {"post": {"summary": "Preview subscription change", "description": "quantities {SKU: qty} and or plan_id: old and new price per period, prorated amount now, days left.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"quantities": {"KA-SITE": 4}}}}}}}, "/subscriptions/{id}/change": {"post": {"summary": "Change subscription", "description": "Applies the preview: an upgrade makes a draft invoice for the prorated amount, a downgrade a credit.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"quantities": {"KA-SITE": 4}}}}}}}, "/subscriptions/{id}/pause": {"post": {"summary": "Pause subscription", "description": "resume_on (optional date) resumes by itself.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"resume_on": "2027-01-05"}}}}}}, "/subscriptions/{id}/resume": {"post": {"summary": "Resume subscription", "description": "", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/subscriptions/{id}/cancel-at-period-end": {"post": {"summary": "Cancel at period end", "description": "on: true (default), or false to undo.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"on": true}}}}}}, "/subscriptions/{id}/cancel": {"post": {"summary": "Cancel subscription now", "description": "Native subscriptions; reason. Stripe subscriptions cancel at period end instead.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"reason": "School closed"}}}}}}, "/subscriptions/{id}/auto-renew": {"post": {"summary": "Set auto-renew", "description": "on: true or false.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"on": false}}}}}}, "/subscriptions/{id}/renewal-quote": {"post": {"summary": "Renewal quote", "description": "Draft quote for the next term from the subscription's items, once per term.", "security": [{"bearer": []}], "x-scope": "quotes:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/subscriptions/{id}/bill": {"post": {"summary": "Bill subscription period", "description": "Draft invoice for the current period, once per period, coupon applied. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/subscriptions/{id}/events": {"get": {"summary": "Subscription history", "description": "Every lifecycle event: created, changed, paused, resumed, renewed, canceled, with amounts.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/renewals": {"get": {"summary": "Upcoming renewals", "description": "Subscriptions whose term ends within days (default 90) with the renewal quote and reminders sent.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "days", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/dunning-cases": {"get": {"summary": "Failed payments", "description": "Cases: open, recovered or closed, with the invoice, customer and next step.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "status", "in": "query", "schema": {"type": "string"}}, {"name": "brand", "in": "query", "schema": {"type": "string"}}]}}, "/dunning-cases/{id}": {"get": {"summary": "Get failed-payment case", "description": "With its events.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/dunning-cases/{id}/email": {"post": {"summary": "Email failed-payment notice", "description": "The payment failed email now, with pay and update-card links. Held while MAIL_MODE=log.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/dunning-cases/{id}/final": {"post": {"summary": "Apply final action", "description": "action cancel, unpaid or keep (default the brand's setting).", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"action": "unpaid"}}}}}}, "/orgs/{id}/statement": {"get": {"summary": "Customer statement", "description": "Balance forward, every invoice, payment, credit and refund with a running balance, and aging.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "start", "in": "query", "schema": {"type": "string"}}, {"name": "end", "in": "query", "schema": {"type": "string"}}, {"name": "currency", "in": "query", "schema": {"type": "string"}}]}}, "/orgs/{id}/statement/email": {"post": {"summary": "Email statement", "description": "start, end, to (default billing contact), cc, mode activity or open. PDF attached; held while MAIL_MODE=log.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"start": "2026-07-01", "end": "2026-11-30"}}}}}}, "/subscriptions/{id}/usage": {"post": {"summary": "Report usage", "description": "One record {meter (code; optional when the plan has one meter), quantity (whole units), at (YYYY-MM-DD, default today), external_id, note} or {items: [...]} up to 500. The same external_id on the same subscription is taken once; a resend answers duplicate: true. Usage bills in arrears on the next period's invoice. Brand tokens see only their brand.", "security": [{"bearer": []}], "x-scope": "subscriptions:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"meter": "students", "quantity": 1240, "at": "2026-11-27", "external_id": "kybergate:tenant_42:2026-11-27"}}}}}, "get": {"summary": "Usage this period", "description": "Per meter: counted, included, billable and the estimated charge for the current period; then the latest records.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "limit", "in": "query", "schema": {"type": "string"}}, {"name": "unbilled", "in": "query", "schema": {"type": "string"}}]}}, "/subscriptions/{id}/usage/bill": {"post": {"summary": "Bill usage now", "description": "A usage-only draft invoice for every unbilled record up to today. Nothing is emailed.", "security": [{"bearer": []}], "x-scope": "invoices:write", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {}}}}}}, "/plans/{id}/meters": {"get": {"summary": "Plan usage meters", "description": "code, name, unit, aggregate (sum, max or last), included units, pricing unit or tiers.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}]}}, "/fleet/changes": {"get": {"summary": "Fleet changes since an id or date", "description": "Hub changes a product's fleet machine should know about, oldest first: id, date, title, what, action (none, recommended or required), sections, endpoints, guide_url, ack_url and your_ack (this brand's acknowledgement). since is the last change id you handled or a date YYYY-MM-DD. Also sent as the webhook fleet.changed; public copies at /fleet/changes.json and /fleet/changes.atom.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}}, "parameters": [{"name": "since", "in": "query", "schema": {"type": "string"}}]}}, "/fleet/changes/{id}/ack": {"post": {"summary": "Acknowledge a fleet change", "description": "Say a change is done, n/a or blocked for your brand: status, note (required when blocked), commit. A product token acks only for its own brand; repeat to update.", "security": [{"bearer": []}], "x-scope": "read", "responses": {"200": {"description": "OK"}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Token lacks scope"}, "404": {"description": "Not found"}, "422": {"description": "Validation error, see error field"}, "429": {"description": "Rate limited"}, "201": {"description": "Created"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}, {"name": "Idempotency-Key", "in": "header", "schema": {"type": "string"}, "description": "Replays the stored response for the same key, token and path."}], "requestBody": {"content": {"application/json": {"example": {"status": "done", "note": "Subscribed to fleet.changed", "commit": "abc1234"}}}}}}}}