{"openapi":"3.1.0","info":{"title":"HyppoCRM API","version":"1.0.0","description":"Send your API key in the x-api-key header. A key acts as the team member who created it and can never exceed their permissions. A key with no scopes has no access; \"*\" is full access. Lists return { data, meta: { page, pageSize, total } }; errors return { error }."},"servers":[{"url":"https://hyppohq.io"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account"},{"name":"Contacts"},{"name":"Companies"},{"name":"Pipelines"},{"name":"Opportunities"},{"name":"Tasks"},{"name":"Tickets"},{"name":"Hours"},{"name":"Tracking Pixels"},{"name":"Invoices"},{"name":"Estimates"},{"name":"Books (Finance)"},{"name":"Expenses"},{"name":"Recurring Expenses"},{"name":"Products"},{"name":"Consignment"},{"name":"Product Categories"},{"name":"Product Collections"},{"name":"Tags"},{"name":"Calendar"},{"name":"Notes"},{"name":"Messages"},{"name":"Paid Ads"},{"name":"Analytics"},{"name":"Import"},{"name":"Bulk Actions"},{"name":"Blogs"},{"name":"Blog Posts"},{"name":"Blog Authors"},{"name":"Blog Categories"},{"name":"Forms"},{"name":"Frame — Projects"},{"name":"Frame — Styles"},{"name":"Frame — Splice"},{"name":"Media"},{"name":"Rentals"},{"name":"Recurring Invoices"},{"name":"Product Orders"},{"name":"Storefront Checkout"},{"name":"Parcels"},{"name":"Automations"},{"name":"Auto-Responder"},{"name":"Documents"},{"name":"Playbooks"},{"name":"Document Templates"},{"name":"Domains"},{"name":"Domain Registrants"},{"name":"Shipping & Tax"},{"name":"Tenant"},{"name":"Work Orders"},{"name":"Meeting Transcripts"},{"name":"Payments"},{"name":"Billing Templates"},{"name":"Booking"},{"name":"Campaigns"},{"name":"Email (connected mailbox)"},{"name":"Google Drive"},{"name":"Frame — Dictionaries"},{"name":"Funnels"},{"name":"Pay Periods"},{"name":"Site Audit"},{"name":"Site Blog"},{"name":"Social"},{"name":"Custom Fields"},{"name":"Webhook Subscriptions"},{"name":"Team Chat Agents"},{"name":"Skill Depot"},{"name":"Webhooks"},{"name":"Widgets"},{"name":"QR Codes"},{"name":"Unsubscribe"},{"name":"AI"},{"name":"AI Sites"},{"name":"Voice"},{"name":"Chat"},{"name":"Communities"}],"paths":{"/api/v1/me":{"get":{"operationId":"get_me","tags":["Account"],"summary":"Who this key is: the workspace it belongs to, its name, scopes and expiry, the team member it acts as, and its rate limi","description":"Who this key is: the workspace it belongs to, its name, scopes and expiry, the team member it acts as, and its rate limits. Call it once when connecting an integration to show \"Connected to <workspace>\" and to check scopes before a real call fails. Needs only a valid key (no scope). Never returns the key itself. How many requests are left comes in the X-RateLimit-* headers, as on every endpoint. From a signed-in session, key is null.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"workspace\": { \"id\", \"name\" }, \"key\": { \"id\", \"name\", \"prefix\", \"scopes\", \"created_at\", \"expires_at\", \"last_used_at\" }, \"acting_as\": { \"user_id\", \"name\", \"role\" }, \"limits\": { \"per_minute\", \"per_day\", \"exempt\" }, \"via\": \"api_key\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/openapi.json":{"get":{"operationId":"get_openapi_json","tags":["Account"],"summary":"This reference as an OpenAPI 3.1 file, generated from the same list as this page.","description":"This reference as an OpenAPI 3.1 file, generated from the same list as this page. Import it into Postman, Insomnia or a code generator, or give it to an AI agent. No key needed.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"openapi\": \"3.1.0\", \"info\": { ... }, \"paths\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/contacts":{"get":{"operationId":"get_contacts","tags":["Contacts"],"summary":"List contacts with pagination and filters","description":"List contacts with pagination and filters","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"first_name\", \"last_name\", \"email\", \"phone\", \"status\", \"tags\", ... }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"search","in":"query","required":false,"description":"Search by name, email, or phone","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status: lead, prospect, customer, churned, staff","schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"description":"Filter by tag name","schema":{"type":"string"}},{"name":"email","in":"query","required":false,"description":"Exact match on the whole email address, any case (unlike search, a partial address matches nothing). Use it to look a contact up before creating one, or use PUT /contacts/upsert.","schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"description":"Exact match on a phone number in any common format: +13215550100, (321) 555-0100 and 3215550100 all match the same contact.","schema":{"type":"string"}},{"name":"count","in":"query","required":false,"description":"Set to 'none' to skip the total row count — faster, and meta.total comes back null. Use it if you only need a page and never read the total.","schema":{"type":"string"}}]},"post":{"operationId":"post_contacts","tags":["Contacts"],"summary":"Create a new contact","description":"Create a new contact","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"first_name\", \"last_name\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","description":"First name"},"last_name":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email address"},"phone":{"type":"string","description":"Phone number"},"status":{"type":"string","description":"lead | prospect | customer | churned | staff"},"company_id":{"type":"string","format":"uuid","description":"Associated company ID"},"tags":{"type":"array","items":{"type":"string"},"description":"Tag names, up to 500 of at most 100 characters. Each becomes a managed tag on the contact. Does not fire \"Tag added\"."}},"required":["first_name"]}}}}}},"/api/v1/contacts/upsert":{"put":{"operationId":"put_contacts_upsert","tags":["Contacts"],"summary":"Create or update a contact, matched by email (any case) or, failing that, phone (any format).","description":"Create or update a contact, matched by email (any case) or, failing that, phone (any format). Updates only the fields you send; tags are added, never replaced. Returns created: true when a new contact was made (201), false when an existing one was updated (200), and the contact's custom fields in data.custom_fields. contact_created automations fire only on create; each tag the contact did not have fires the \"Tag added\" trigger, as with POST /contacts/:id/tags. Needs contacts:update to change a contact and contacts:create to make one (custom_fields need nothing more). 409 when two contacts match, or when the match is not assigned to you.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"first_name\", ..., \"custom_fields\": { \"roof_type\": \"tile\", \"sq_ft\": 2400 } }, \"created\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Matched first. Send email or phone (or both)."},"phone":{"type":"string","description":"Matched when no email matches"},"first_name":{"type":"string","description":"Required when the contact is created"},"last_name":{"type":"string","description":"Last name"},"status":{"type":"string","description":"lead | prospect | customer | churned | staff"},"tags":{"type":"array","items":{"type":"string"},"description":"Added to the contact's existing tags (up to 500). New ones fire \"Tag added\"."},"company_id":{"type":"string","format":"uuid","description":"Associated company ID"},"custom_fields":{"type":"object","description":"Custom field values by field_key, e.g. { \"roof_type\": \"tile\", \"sq_ft\": 2400 }, at most 200. Same rules as PUT /contacts/:id/custom-fields: only the keys sent change, null clears one, and an unknown key or a bad value refuses the whole upsert with 400 before anything is saved."}}}}}}}},"/api/v1/contacts/{id}":{"get":{"operationId":"get_contacts_by_id","tags":["Contacts"],"summary":"Get a single contact by ID, with its custom field values in custom_fields (keyed by field_key)","description":"Get a single contact by ID, with its custom field values in custom_fields (keyed by field_key)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"first_name\", \"last_name\", \"email\", ..., \"custom_fields\": { \"roof_type\": \"tile\", \"sq_ft\": 2400 } } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_contacts_by_id","tags":["Contacts"],"summary":"Update a contact","description":"Update a contact","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","description":"First name"},"last_name":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email address"},"status":{"type":"string","description":"Contact status"},"tags":{"type":"array","items":{"type":"string"},"description":"Replaces the contact's tags (up to 500). Tags you leave out are removed from the contact; the tags themselves stay. Sending back the list unchanged does nothing. Does not fire \"Tag added\"; use POST /contacts/:id/tags for that."}}}}}}},"delete":{"operationId":"delete_contacts_by_id","tags":["Contacts"],"summary":"Delete a contact","description":"Delete a contact","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/contacts/{id}/custom-fields":{"get":{"operationId":"get_contacts_by_id_custom_fields","tags":["Contacts"],"summary":"This contact's custom field values, keyed by field_key; every contact field is listed, null where unset.","description":"This contact's custom field values, keyed by field_key; every contact field is listed, null where unset. Scope: contacts:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"roof_type\": \"tile\", \"sq_ft\": 2400, \"has_pets\": false, \"install_date\": null } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["contacts:read"]},"put":{"operationId":"put_contacts_by_id_custom_fields","tags":["Contacts"],"summary":"Set custom field values by field_key, e.g.","description":"Set custom field values by field_key, e.g. { \"roof_type\": \"tile\", \"sq_ft\": 2400, \"has_pets\": true, \"install_date\": \"2026-11-02\" }. Only the keys sent change; null clears one. Each value must match its type (a number, true/false, YYYY-MM-DD, or one of a select field's options). An unknown key or a bad value refuses the whole request with 400, and nothing is saved. Scope: contacts:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...every contact field } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["contacts:write"]}},"/api/v1/contacts/{id}/tags":{"post":{"operationId":"post_contacts_by_id_tags","tags":["Contacts"],"summary":"Add tags to a contact without resending it.","description":"Add tags to a contact without resending it. Tags it already has are left alone. Each new tag fires the \"Tag added\" automation trigger, so tag-based workflows run. Scope: contacts:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"tags\": [\"lead\", \"vip\"], \"added\": [\"vip\"] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["contacts:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"},"description":"Tag names (or send { \"tag\": \"name\" } for one), up to 50"}},"required":["tags"]}}}}}},"/api/v1/contacts/{id}/tags/{tag}":{"delete":{"operationId":"delete_contacts_by_id_tags_by_tag","tags":["Contacts"],"summary":"Remove one tag from a contact.","description":"Remove one tag from a contact. URL-encode the name (Spring%20sale). The tag still exists for other contacts. Scope: contacts:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"tags\": [\"lead\"], \"removed\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tag","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["contacts:write"]}},"/api/v1/contacts/{id}/notes":{"get":{"operationId":"get_contacts_by_id_notes","tags":["Contacts"],"summary":"This contact's notes, newest first.","description":"This contact's notes, newest first. Scope: notes:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"body\", \"created_by\", \"author\": { \"id\", \"full_name\" }, \"created_at\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["notes:read"]},"post":{"operationId":"post_contacts_by_id_notes","tags":["Contacts"],"summary":"Add a note to this contact, written as the key's owner.","description":"Add a note to this contact, written as the key's owner. 201 when created; 200 when external_id names a note this workspace already has. Scope: notes:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"body\", \"contact_id\", \"source\", \"external_id\", \"metadata\", \"created_by\", \"created_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["notes:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"The note text"},"external_id":{"type":"string","description":"Your own id for this note (e.g. the meeting id), up to 200 characters. Sending the same id again in this workspace does not make a copy: you get the existing note back with 200. If the text or metadata differ it is updated (needs notes:update; without it, 409). 409 when the id belongs to a note on a different record."},"source":{"type":"string","description":"Short label for where the note came from, shown on the note in the CRM: 1-50 lowercase letters, digits, - or _ (e.g. ai-recorder). Default manual."},"metadata":{"type":"object","description":"Any small JSON object stored with the note (at most 4 KB). Keys _external_id and _source are reserved."}},"required":["content"]}}}}}},"/api/v1/contacts/{id}/activity":{"get":{"operationId":"get_contacts_by_id_activity","tags":["Contacts"],"summary":"One newest-first timeline of everything that happened with this contact: notes, calls, messages (SMS and email), appoint","description":"One newest-first timeline of everything that happened with this contact: notes, calls, messages (SMS and email), appointments, invoices, payments and tasks, each with a type, time (when it was created) and one-line summary. Needs contacts:read; each kind also needs its own scope (notes:read, messages:read for messages and calls, calendar:read, invoices:read, payments:read, tasks:read). Kinds the key cannot read are left out and named in meta.omitted, never refused. For the next page, pass meta.next_before as ?before=; it is null on the last page.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"type\": \"invoice\", \"id\", \"at\": \"2026-10-01T12:05:00.000Z\", \"summary\": \"Invoice INV-1001 $450.00 (paid)\", \"data\": { \"number\", \"status\", \"total\", ... } }], \"meta\": { \"limit\", \"next_before\", \"omitted\": [], \"failed\": [] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"description":"ISO time; only items created before it (from meta.next_before)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}},{"name":"types","in":"query","required":false,"description":"Comma list to narrow: note,call,message,appointment,invoice,payment,task","schema":{"type":"string"}}]}},"/api/v1/companies":{"get":{"operationId":"get_companies","tags":["Companies"],"summary":"List companies with pagination","description":"List companies with pagination","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"search","in":"query","required":false,"description":"Search by name","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page","schema":{"type":"number"}}]},"post":{"operationId":"post_companies","tags":["Companies"],"summary":"Create a company","description":"Create a company","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Company name"}},"required":["name"]}}}}}},"/api/v1/companies/{id}":{"get":{"operationId":"get_companies_by_id","tags":["Companies"],"summary":"Get a company, with custom_fields","description":"Get a company, with custom_fields","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"custom_fields\": { ... } } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_companies_by_id","tags":["Companies"],"summary":"Update a company","description":"Update a company","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_companies_by_id","tags":["Companies"],"summary":"Delete a company","description":"Delete a company","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/companies/{id}/custom-fields":{"get":{"operationId":"get_companies_by_id_custom_fields","tags":["Companies"],"summary":"This company's custom field values, keyed by field_key.","description":"This company's custom field values, keyed by field_key. Scope: companies:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"industry_code\": \"1711\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["companies:read"]},"put":{"operationId":"put_companies_by_id_custom_fields","tags":["Companies"],"summary":"Set custom field values by field_key, e.g.","description":"Set custom field values by field_key, e.g. { \"roof_type\": \"tile\", \"sq_ft\": 2400, \"has_pets\": true, \"install_date\": \"2026-11-02\" }. Only the keys sent change; null clears one. Each value must match its type (a number, true/false, YYYY-MM-DD, or one of a select field's options). An unknown key or a bad value refuses the whole request with 400, and nothing is saved. Scope: companies:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["companies:write"]}},"/api/v1/pipelines":{"get":{"operationId":"get_pipelines","tags":["Pipelines"],"summary":"List all pipelines with their stages","description":"List all pipelines with their stages","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"stages\": [{ \"id\", \"name\", \"position\" }] }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/opportunities":{"get":{"operationId":"get_opportunities","tags":["Opportunities"],"summary":"List opportunities","description":"List opportunities","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"pipeline_id","in":"query","required":false,"description":"Filter by pipeline","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"description":"open | won | lost","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}}]},"post":{"operationId":"post_opportunities","tags":["Opportunities"],"summary":"Create an opportunity","description":"Create an opportunity","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Deal name"},"pipeline_id":{"type":"string","format":"uuid","description":"Pipeline ID"},"stage_id":{"type":"string","format":"uuid","description":"Stage ID"},"value":{"type":"number","description":"Deal value"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID"},"close_date":{"type":"string","format":"date","description":"Expected close date"}},"required":["name","pipeline_id","stage_id"]}}}}}},"/api/v1/opportunities/{id}":{"get":{"operationId":"get_opportunities_by_id","tags":["Opportunities"],"summary":"Get an opportunity, with custom_fields","description":"Get an opportunity, with custom_fields","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"custom_fields\": { ... } } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_opportunities_by_id","tags":["Opportunities"],"summary":"Update an opportunity","description":"Update an opportunity","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_opportunities_by_id","tags":["Opportunities"],"summary":"Delete an opportunity","description":"Delete an opportunity","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/opportunities/{id}/custom-fields":{"get":{"operationId":"get_opportunities_by_id_custom_fields","tags":["Opportunities"],"summary":"This opportunity's custom field values, keyed by field_key.","description":"This opportunity's custom field values, keyed by field_key. Scope: opportunities:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deal_source\": \"Referral\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["opp","tunities:read"]},"put":{"operationId":"put_opportunities_by_id_custom_fields","tags":["Opportunities"],"summary":"Set custom field values by field_key, e.g.","description":"Set custom field values by field_key, e.g. { \"roof_type\": \"tile\", \"sq_ft\": 2400, \"has_pets\": true, \"install_date\": \"2026-11-02\" }. Only the keys sent change; null clears one. Each value must match its type (a number, true/false, YYYY-MM-DD, or one of a select field's options). An unknown key or a bad value refuses the whole request with 400, and nothing is saved. Scope: opportunities:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["opp","tunities:write"]}},"/api/v1/tasks":{"get":{"operationId":"get_tasks","tags":["Tasks"],"summary":"List tasks","description":"List tasks","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"completed","in":"query","required":false,"description":"Filter by completion status","schema":{"type":"boolean"}},{"name":"contact_id","in":"query","required":false,"description":"Filter by contact","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_tasks","tags":["Tasks"],"summary":"Create a task","description":"Create a task","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Task title"},"description":{"type":"string","description":"Longer details under the title, up to 10,000 characters"},"contact_id":{"type":"string","format":"uuid","description":"Associated contact"},"due_date":{"type":"string","format":"date","description":"Due date"},"priority":{"type":"string","description":"low | medium | high"},"completed":{"type":"boolean","description":"true creates the task already completed"},"external_id":{"type":"string","description":"Your own id for this task, up to 200 characters. Sending the same id again in this workspace does not make a copy: you get the existing task back with 200. If the title, description, due_date or completed differ it is updated (needs tasks:update; without it, 409)."}},"required":["title"]}}}}}},"/api/v1/tasks/{id}":{"get":{"operationId":"get_tasks_by_id","tags":["Tasks"],"summary":"Get a task","description":"Get a task","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_tasks_by_id","tags":["Tasks"],"summary":"Update a task.","description":"Update a task. Only the fields sent change.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Task title"},"description":{"type":"string","description":"Longer details under the title"},"due_date":{"type":"string","format":"date","description":"Due date, or null"},"priority":{"type":"string","description":"low | medium | high"},"completed":{"type":"boolean","description":"true completes the task (completed_at is set to now), false reopens it. Sending the value it already has changes nothing."},"completed_at":{"type":"string","format":"date-time","description":"Set the completion time yourself, or null to reopen. Send this or completed, not both."},"contact_id":{"type":"string","format":"uuid","description":"Associated contact, or null"},"opportunity_id":{"type":"string","format":"uuid","description":"Associated opportunity, or null"},"assigned_to":{"type":"string","format":"uuid","description":"Team member the task is assigned to, or null"}}}}}}},"patch":{"operationId":"patch_tasks_by_id","tags":["Tasks"],"summary":"Same as PUT: update only the fields sent.","description":"Same as PUT: update only the fields sent. Send { \"completed\": true } to complete a task.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Task title"},"description":{"type":"string","description":"Longer details under the title"},"due_date":{"type":"string","format":"date","description":"Due date, or null"},"priority":{"type":"string","description":"low | medium | high"},"completed":{"type":"boolean","description":"true completes the task (completed_at is set to now), false reopens it. Sending the value it already has changes nothing."},"completed_at":{"type":"string","format":"date-time","description":"Set the completion time yourself, or null to reopen. Send this or completed, not both."},"contact_id":{"type":"string","format":"uuid","description":"Associated contact, or null"},"opportunity_id":{"type":"string","format":"uuid","description":"Associated opportunity, or null"},"assigned_to":{"type":"string","format":"uuid","description":"Team member the task is assigned to, or null"}}}}}}},"delete":{"operationId":"delete_tasks_by_id","tags":["Tasks"],"summary":"Delete a task","description":"Delete a task","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/tickets":{"get":{"operationId":"get_tickets","tags":["Tickets"],"summary":"Support tickets: bug reports, feature requests, questions and tasks, each optionally linked to a contact, newest activit","description":"Support tickets: bug reports, feature requests, questions and tasks, each optionally linked to a contact, newest activity first. Each ticket has a per-workspace number (#1, #2 ...) and carries its contact { id, first_name, last_name, email } and assignee { id, full_name }. A member who is restricted to assigned records sees only tickets assigned to or created by them (plus every ticket of a contact assigned to them, with contact_id). The workspace needs the Tickets feature. Scope: tickets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"number\", \"title\", \"description\", \"type\", \"status\", \"priority\", \"contact_id\", \"assigned_to\", \"source\", \"external_id\", \"tags\", \"metadata\", \"created_by\", \"created_at\", \"updated_at\", \"first_response_at\", \"solved_at\", \"closed_at\", \"contact\": { ... }, \"assignee\": { ... }, \"creator\": { ... } }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"Comma list of new, open, pending, on_hold, solved, closed; \"active\" = everything not solved or closed. Default: all","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"Comma list of bug, feature, question, task, other","schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"description":"Comma list of low, normal, high, urgent","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"One contact's tickets","schema":{"type":"string","format":"uuid"}},{"name":"assigned_to","in":"query","required":false,"description":"A member user id, or \"none\" for unassigned","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Search titles (case-insensitive). \"42\" or \"#42\" also finds ticket #42","schema":{"type":"string"}},{"name":"external_id","in":"query","required":false,"description":"Exact match on your own id for the report","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["tickets:read"]},"post":{"operationId":"post_tickets","tags":["Tickets"],"summary":"Create a ticket.","description":"Create a ticket. Idempotent on external_id: if this workspace already has a ticket with the same external_id, that ticket is returned unchanged with 200 and existing: true instead of a duplicate (a new ticket is 201 with existing: false), so a retried or repeated push is safe. Unknown fields are refused. contact_id must be a contact of this workspace and assigned_to a member of it. Fires the ticket_created automation trigger and the ticket.created webhook. To file for someone who may not be a contact yet, call PUT /api/v1/contacts/upsert first and send its id. Scope: tickets:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...ticket }, \"existing\": false }  (201; 200 with \"existing\": true when external_id was already used)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["tickets:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"1 to 200 characters"},"description":{"type":"string","description":"Up to 20,000 characters"},"contact_id":{"type":"string","format":"uuid","description":"The customer it is about"},"type":{"type":"string","description":"bug | feature | question | task | other (default other)"},"status":{"type":"string","description":"new (default) | open | pending | on_hold | solved | closed"},"priority":{"type":"string","description":"low | normal (default) | high | urgent"},"assigned_to":{"type":"string","format":"uuid","description":"A member user id"},"source":{"type":"string","description":"Where it came from, up to 50 characters, e.g. \"ai-recorder\" (default \"api\")"},"external_id":{"type":"string","description":"Your id for this report, up to 200 characters, unique per workspace. Send it to make retries safe"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 20 tags of 1 to 50 characters; duplicates are dropped"},"metadata":{"type":"object","description":"A JSON object of up to 8 KB, e.g. { \"app_version\": \"2.3.1\", \"device\": \"iPhone 15\" }"}},"required":["title"]}}}}}},"/api/v1/tickets/{id}":{"get":{"operationId":"get_tickets_by_id","tags":["Tickets"],"summary":"One ticket with its contact, assignee and creator.","description":"One ticket with its contact, assignee and creator. Scope: tickets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...ticket } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tickets:read"]},"patch":{"operationId":"patch_tickets_by_id","tags":["Tickets"],"summary":"Change any of the create fields; send only what changes (null clears an optional field, [] clears tags, {} clears metada","description":"Change any of the create fields; send only what changes (null clears an optional field, [] clears tags, {} clears metadata). Sending back the object from GET also works: unchanged read-only fields are ignored and a changed one is refused. solved_at, closed_at and updated_at are kept by the database. A status change fires the ticket_status_changed automation trigger and the ticket.status_changed webhook. Scope: tickets:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...ticket } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tickets:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"1 to 200 characters"},"description":{"type":"string","description":"Up to 20,000 characters"},"status":{"type":"string","description":"new | open | pending | on_hold | solved | closed"},"priority":{"type":"string","description":"low | normal | high | urgent"},"type":{"type":"string","description":"bug | feature | question | task | other"},"contact_id":{"type":"string","format":"uuid","description":"A contact of this workspace, or null"},"assigned_to":{"type":"string","format":"uuid","description":"A member user id, or null"},"source":{"type":"string","description":"Up to 50 characters"},"external_id":{"type":"string","description":"Unique per workspace (409 if another ticket has it)"},"tags":{"type":"array","items":{"type":"string"},"description":"Replaces the tag list"},"metadata":{"type":"object","description":"Replaces the metadata object (up to 8 KB)"}}}}}}},"delete":{"operationId":"delete_tickets_by_id","tags":["Tickets"],"summary":"Delete a ticket and its whole thread.","description":"Delete a ticket and its whole thread. The key must belong to an owner or admin; set status closed to keep the history instead. Scope: tickets:delete.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tickets:delete"]}},"/api/v1/tickets/{id}/comments":{"get":{"operationId":"get_tickets_by_id_comments","tags":["Tickets"],"summary":"A ticket's thread, oldest first: replies (internal: false) and internal notes (internal: true).","description":"A ticket's thread, oldest first: replies (internal: false) and internal notes (internal: true). Pass internal=false to get only what may be shown to the customer. Comments from an outside author carry author_label and no author_user_id. Scope: tickets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"ticket_id\", \"body\", \"internal\", \"author_user_id\", \"author_label\", \"author\": { \"id\", \"full_name\", \"avatar_url\" }, \"created_at\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"internal","in":"query","required":false,"description":"false = replies only, true = internal notes only; leave out for both","schema":{"type":"boolean"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 100, max 200)","schema":{"type":"number"}}],"x-scopes":["tickets:read"]},"post":{"operationId":"post_tickets_by_id_comments","tags":["Tickets"],"summary":"Add a reply or an internal note.","description":"Add a reply or an internal note. With author_label the comment is credited to that outside author (for example your app's user who sent a follow-up); without it, to the member who owns the key. The first reply from a member stamps the ticket's first_response_at. Needs tickets:create, not tickets:update, so an app can file reports and relay follow-ups without being able to change status. Scope: tickets:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"ticket_id\", \"body\", \"internal\", \"author_user_id\", \"author_label\", \"created_at\" } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tickets:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"1 to 20,000 characters"},"internal":{"type":"boolean","description":"true for an internal note (default false, a reply)"},"author_label":{"type":"string","description":"Display name of an outside author, up to 100 characters"}},"required":["body"]}}}}}},"/api/v1/contacts/{id}/tickets":{"get":{"operationId":"get_contacts_by_id_tickets","tags":["Tickets"],"summary":"One contact's tickets, newest activity first.","description":"One contact's tickets, newest activity first. Takes the same filters as GET /tickets except contact_id. 404 when the contact is not in this workspace (or not visible to a restricted member). Scope: tickets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ ...ticket }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Comma list, or \"active\"","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"Comma list","schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"description":"Comma list","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["tickets:read"]}},"/api/v1/hours":{"get":{"operationId":"get_hours","tags":["Hours"],"summary":"List time entries, newest work date first.","description":"List time entries, newest work date first. A member sees only their own; owners and admins see everyone. Each entry carries contact, company, pay_code, user and reviewer ({ id, name }) for display. Scope: hours:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"submitted, approved or rejected","schema":{"type":"string"}},{"name":"user_id","in":"query","required":false,"description":"Filter by user (owners and admins)","schema":{"type":"string","format":"uuid"}},{"name":"company_id","in":"query","required":false,"description":"Filter by company","schema":{"type":"string","format":"uuid"}},{"name":"pay_period_id","in":"query","required":false,"description":"Filter by pay period","schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"description":"Work date >= YYYY-MM-DD","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Work date <= YYYY-MM-DD","schema":{"type":"string","format":"date"}}],"x-scopes":["hours:read"]},"post":{"operationId":"post_hours","tags":["Hours"],"summary":"Log a time entry for yourself; it goes in as submitted.","description":"Log a time entry for yourself; it goes in as submitted. A date in a closed pay period returns 409 pay_period_closed unless allow_retro is true, which files it in the open period instead. Scope: hours:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["hours:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_date":{"type":"string","format":"date","description":"YYYY-MM-DD"},"hours":{"type":"number","description":"Hours worked (> 0, ≤ 24)"},"contact_id":{"type":"string","format":"uuid","description":"Client contact (one of contact_id, company_id or project_label is required)"},"company_id":{"type":"string","format":"uuid","description":"Company"},"project_label":{"type":"string","description":"Project name"},"pay_code_id":{"type":"string","format":"uuid","description":"One of your pay codes (GET /api/v1/hours/pay-codes)"},"allow_retro":{"type":"boolean","description":"File a closed period's date in the open period"},"on_behalf_of_user_id":{"type":"string","format":"uuid","description":"Log for a colleague (owners and admins, scope hours:write:any)"},"notes":{"type":"string","description":"Notes (≤ 4000 chars)"},"calls_dialed":{"type":"number","description":"Optional activity metric"},"pickups":{"type":"number","description":"Optional activity metric"},"pitches":{"type":"number","description":"Optional activity metric"},"callbacks":{"type":"number","description":"Optional activity metric"},"appointments_booked":{"type":"number","description":"Optional activity metric"}},"required":["work_date","hours"]}}}}}},"/api/v1/hours/pay-codes":{"get":{"operationId":"get_hours_pay_codes","tags":["Hours"],"summary":"The pay codes you can log time against (the active ones assigned to you), by name.","description":"The pay codes you can log time against (the active ones assigned to you), by name. Scope: hours:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["hours:read"]}},"/api/v1/hours/{id}":{"get":{"operationId":"get_hours_by_id","tags":["Hours"],"summary":"Get a time entry, with the same names as the list.","description":"Get a time entry, with the same names as the list. Scope: hours:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["hours:read"]},"patch":{"operationId":"patch_hours_by_id","tags":["Hours"],"summary":"Edit your own entry (not once approved; it goes back to submitted), or review one with { status: approved | rejected, re","description":"Edit your own entry (not once approved; it goes back to submitted), or review one with { status: approved | rejected, review_note } (owners and admins, scope hours:approve). Scope: hours:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["hours:write"]},"delete":{"operationId":"delete_hours_by_id","tags":["Hours"],"summary":"Delete a time entry.","description":"Delete a time entry. Scope: hours:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["hours:write"]}},"/api/v1/tracking-pixels":{"get":{"operationId":"get_tracking_pixels","tags":["Tracking Pixels"],"summary":"List tracking pixels.","description":"List tracking pixels. Scope: tracking_pixels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"include_archived","in":"query","required":false,"description":"Include archived pixels","schema":{"type":"boolean"}}],"x-scopes":["tracking_pixels:read"]},"post":{"operationId":"post_tracking_pixels","tags":["Tracking Pixels"],"summary":"Create a tracking pixel.","description":"Create a tracking pixel. Scope: tracking_pixels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["tracking_pixels:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Pixel name (1–120 chars)"},"allowed_origins":{"type":"array","items":{"type":"string"},"description":"Allowed origin URLs (max 50)"}},"required":["name"]}}}}}},"/api/v1/tracking-pixels/{id}":{"get":{"operationId":"get_tracking_pixels_by_id","tags":["Tracking Pixels"],"summary":"Get a pixel.","description":"Get a pixel. Scope: tracking_pixels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tracking_pixels:read"]},"patch":{"operationId":"patch_tracking_pixels_by_id","tags":["Tracking Pixels"],"summary":"Update a pixel.","description":"Update a pixel. Scope: tracking_pixels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tracking_pixels:write"]},"delete":{"operationId":"delete_tracking_pixels_by_id","tags":["Tracking Pixels"],"summary":"Delete a pixel.","description":"Delete a pixel. Scope: tracking_pixels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["tracking_pixels:write"]}},"/api/v1/invoices":{"get":{"operationId":"get_invoices","tags":["Invoices"],"summary":"List invoices","description":"List invoices","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"draft | sent | paid | void","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"Filter by contact","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_invoices","tags":["Invoices"],"summary":"Create an invoice (auto-generates invoice number)","description":"Create an invoice (auto-generates invoice number)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"number\", \"total\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"line_items":{"type":"array","description":"[{ description, quantity, unit_price, amount }]"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID"},"tax_rate":{"type":"number","description":"Tax rate (decimal, e.g. 0.07)"},"due_date":{"type":"string","format":"date","description":"Due date"},"notes":{"type":"string","description":"Notes"}},"required":["line_items"]}}}}}},"/api/v1/invoices/{id}":{"get":{"operationId":"get_invoices_by_id","tags":["Invoices"],"summary":"Get an invoice","description":"Get an invoice","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_invoices_by_id","tags":["Invoices"],"summary":"Update an invoice","description":"Update an invoice","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_invoices_by_id","tags":["Invoices"],"summary":"Delete an invoice","description":"Delete an invoice","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/estimates":{"get":{"operationId":"get_estimates","tags":["Estimates"],"summary":"List estimates, newest first.","description":"List estimates, newest first. Scope: estimates:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"draft | sent | accepted | rejected | converted","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"One contact's estimates","schema":{"type":"string","format":"uuid"}}],"x-scopes":["estimates:read"]}},"/api/v1/estimates/{id}":{"get":{"operationId":"get_estimates_by_id","tags":["Estimates"],"summary":"Get an estimate, with its contact when you may read contacts.","description":"Get an estimate, with its contact when you may read contacts. Scope: estimates:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["estimates:read"]}},"/api/v1/books/accounts":{"get":{"operationId":"get_books_accounts","tags":["Books (Finance)"],"summary":"The chart of accounts.","description":"The chart of accounts. Use it to find the category_account_id and paid_from_account_id that POST /expenses needs. Scope: books:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"code\", \"name\", \"type\", \"detail_type\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"type","in":"query","required":false,"description":"expense, asset, revenue, liability or equity","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Match a code or name","schema":{"type":"string"}}],"x-scopes":["books:read"]}},"/api/v1/income":{"post":{"operationId":"post_income","tags":["Books (Finance)"],"summary":"Record money received outside a card processor: a bank transfer, a check, cash, a marketplace payout.","description":"Record money received outside a card processor: a bank transfer, a check, cash, a marketplace payout. It is saved as a payment, so it shows in Payments, reports and the ledger like any other. Send an idempotency_key to make retries safe. Scope: income:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"payment_id\", \"amount\", \"income_date\", \"method\", \"payer\", \"description\", \"contact_id\", \"posted_to_ledger\": true, \"ledger_error\": null } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["income:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Dollars received"},"method":{"type":"string","description":"bank_transfer (default), cash, check, wire, international_wire, zelle, venmo, cashapp, paypal, money_order, upwork or other"},"income_date":{"type":"string","format":"date","description":"YYYY-MM-DD (default today)"},"payer":{"type":"string","description":"Who paid"},"description":{"type":"string","description":"What it was for"},"contact_id":{"type":"string","format":"uuid","description":"Link to a contact"},"idempotency_key":{"type":"string","description":"Same key, same payment: a retry never records it twice"}},"required":["amount"]}}}}}},"/api/v1/books/reports":{"get":{"operationId":"get_books_reports","tags":["Books (Finance)"],"summary":"Hyppo Books financial reports computed from the ledger (cash basis).","description":"Hyppo Books financial reports computed from the ledger (cash basis). Scope: books:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"revenueTotal\": number, \"cogs\": number, \"grossProfit\": number, \"expenseTotal\": number, \"netProfit\": number, \"revenue\": [...], \"expenses\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"type","in":"query","required":false,"description":"profit-and-loss (default) | balance-sheet | cash-flow","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Start date YYYY-MM-DD (default: Jan 1 of current year). Ignored for balance-sheet.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"End / as-of date YYYY-MM-DD (default: today)","schema":{"type":"string","format":"date"}}],"x-scopes":["books:read"]}},"/api/v1/expenses":{"get":{"operationId":"get_expenses","tags":["Expenses"],"summary":"List expenses, most recent first.","description":"List expenses, most recent first. Scope: expenses:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}}],"x-scopes":["expenses:read"]},"post":{"operationId":"post_expenses","tags":["Expenses"],"summary":"Record an expense; posts to the ledger (DEBIT category / CREDIT paid-from).","description":"Record an expense; posts to the ledger (DEBIT category / CREDIT paid-from). Scope: expenses:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\": \"uuid\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["expenses:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Amount in dollars (> 0)"},"category_account_id":{"type":"string","format":"uuid","description":"Ledger expense account (the category). List via the chart of accounts."},"paid_from_account_id":{"type":"string","format":"uuid","description":"Ledger asset account the money came from (cash/bank)"},"vendor":{"type":"string","description":"Vendor name"},"expense_date":{"type":"string","format":"date","description":"YYYY-MM-DD (default: today)"},"description":{"type":"string","description":"Optional memo"}},"required":["amount","category_account_id","paid_from_account_id"]}}}}}},"/api/v1/recurring-expenses/{id}":{"get":{"operationId":"get_recurring_expenses_by_id","tags":["Recurring Expenses"],"summary":"One recurring expense.","description":"One recurring expense. Scope: expenses:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"vendor\", \"amount\", \"frequency\", \"next_run_date\", \"active\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["expenses:read"]},"put":{"operationId":"put_recurring_expenses_by_id","tags":["Recurring Expenses"],"summary":"Change a recurring expense.","description":"Change a recurring expense. Send { \"active\": false } to cancel it: no future expenses are posted, and its history stays. Scope: expenses:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["expenses:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean","description":"false stops it"},"vendor":{"type":"string","description":"Vendor"},"description":{"type":"string","description":"Description"},"amount":{"type":"number","description":"Amount per run"},"frequency":{"type":"string","description":"weekly, monthly, quarterly or yearly"},"interval_count":{"type":"number","description":"Every N periods"},"next_run_date":{"type":"string","format":"date","description":"YYYY-MM-DD"},"category_account_id":{"type":"string","format":"uuid","description":"Expense account"},"paid_from_account_id":{"type":"string","format":"uuid","description":"Paid-from account"}}}}}}}},"/api/v1/recurring-expenses":{"get":{"operationId":"get_recurring_expenses","tags":["Recurring Expenses"],"summary":"List recurring-expense templates (rent, software, subscriptions).","description":"List recurring-expense templates (rent, software, subscriptions). Scope: expenses:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"vendor\", \"amount\", \"frequency\", \"interval_count\", \"next_run_date\", \"active\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["expenses:read"]},"post":{"operationId":"post_recurring_expenses","tags":["Recurring Expenses"],"summary":"Create a recurring-expense template.","description":"Create a recurring-expense template. The daily cron posts an actual expense + ledger entry on/after next_run_date. Scope: expenses:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\": \"uuid\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["expenses:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Amount in dollars (> 0)"},"category_account_id":{"type":"string","format":"uuid","description":"Ledger expense account (the category)"},"paid_from_account_id":{"type":"string","format":"uuid","description":"Ledger asset account the money comes from"},"frequency":{"type":"string","description":"weekly | monthly (default) | yearly"},"interval_count":{"type":"number","description":"Repeat every N periods (default 1, max 60)"},"start_date":{"type":"string","format":"date","description":"First charge date YYYY-MM-DD (default: today)"},"vendor":{"type":"string","description":"Vendor name"},"description":{"type":"string","description":"Optional memo"}},"required":["amount","category_account_id","paid_from_account_id"]}}}}}},"/api/v1/products":{"get":{"operationId":"get_products","tags":["Products"],"summary":"List products","description":"List products","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ ..., \"category\": { \"id\", \"name\" } | null }], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"type","in":"query","required":false,"description":"physical | labor | materials | digital | service | other","schema":{"type":"string"}},{"name":"active","in":"query","required":false,"description":"Filter active/inactive","schema":{"type":"boolean"}},{"name":"rentable","in":"query","required":false,"description":"Filter rentable/sale-only","schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"description":"Search name and SKU (every word must match)","schema":{"type":"string"}}]},"post":{"operationId":"post_products","tags":["Products"],"summary":"Create a product","description":"Create a product","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Product name"},"price":{"type":"number","description":"Price (default: 0)"},"type":{"type":"string","description":"Product type (default: service)"},"sku":{"type":"string","description":"SKU"}},"required":["name"]}}}}}},"/api/v1/products/{id}":{"get":{"operationId":"get_products_by_id","tags":["Products"],"summary":"Get a product, with its category","description":"Get a product, with its category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"category\": { \"id\": \"uuid\", \"name\": \"...\" } | null } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_products_by_id","tags":["Products"],"summary":"Update a product","description":"Update a product","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_products_by_id","tags":["Products"],"summary":"Delete a product","description":"Delete a product","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/products/generate-seo":{"post":{"operationId":"post_products_generate_seo","tags":["Products"],"summary":"Generate SEO copy (description + meta) for a product using AI","description":"Generate SEO copy (description + meta) for a product using AI","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"description\", \"meta_title\", \"meta_description\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Product name"},"description":{"type":"string","description":"Existing description (optional, used as context)"}},"required":["name"]}}}}}},"/api/v1/inventory/lookup":{"get":{"operationId":"get_inventory_lookup","tags":["Products"],"summary":"Look up a scanned code: barcode, then serial number, then product SKU, then variant SKU.","description":"Look up a scanned code: barcode, then serial number, then product SKU, then variant SKU. item is null when the code named a product with no unit to attach; data is null when nothing matched.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"item\": { ... } | null, \"product\": { ... }, \"matched_on\": \"barcode\" | \"serial\" | \"sku\" | \"variant_sku\" } | null }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"code","in":"query","required":true,"description":"The scanned or typed code","schema":{"type":"string"}}]}},"/api/v1/inventory-items":{"get":{"operationId":"get_inventory_items","tags":["Products"],"summary":"List inventory units across products, newest first","description":"List inventory units across products, newest first","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ ..., \"product\": { \"id\", \"name\", \"sku\", \"price\" } }], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":false,"description":"Search serial number, barcode, product name and SKU (every word must match)","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"available | rented | sold | reserved | maintenance | retired","schema":{"type":"string"}},{"name":"product_id","in":"query","required":false,"description":"Units of one product","schema":{"type":"string","format":"uuid"}}]}},"/api/v1/inventory-items/{id}":{"get":{"operationId":"get_inventory_items_by_id","tags":["Products"],"summary":"Get an inventory unit with its product and who it was bought from","description":"Get an inventory unit with its product and who it was bought from","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/products/{id}/categories":{"get":{"operationId":"get_products_by_id_categories","tags":["Products"],"summary":"List the categories a product belongs to","description":"List the categories a product belongs to","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"description\", \"color\", \"sort_order\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_products_by_id_categories","tags":["Products"],"summary":"Add the product to one or more categories (additive, deduped — existing memberships are preserved)","description":"Add the product to one or more categories (additive, deduped — existing memberships are preserved)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"color\", ... }] }  // full updated category list"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"category_id":{"type":"string","format":"uuid","description":"Single category ID to add (use this OR category_ids)"},"category_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Array of category IDs to add"}}}}}}},"put":{"operationId":"put_products_by_id_categories","tags":["Products"],"summary":"Replace ALL of the product's category memberships with the provided set (use [] to clear all)","description":"Replace ALL of the product's category memberships with the provided set (use [] to clear all)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Complete list of category IDs the product should belong to"}},"required":["category_ids"]}}}}}},"/api/v1/products/{id}/categories/{category_id}":{"delete":{"operationId":"delete_products_by_id_categories_by_category_id","tags":["Products"],"summary":"Remove the product from a single category","description":"Remove the product from a single category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"removed\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/products/{id}/collections":{"get":{"operationId":"get_products_by_id_collections","tags":["Products"],"summary":"List the collections a product belongs to","description":"List the collections a product belongs to","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"description\", \"image_url\", \"published\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_products_by_id_collections","tags":["Products"],"summary":"Add the product to one or more collections (additive, deduped)","description":"Add the product to one or more collections (additive, deduped)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }  // full updated collection list"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"collection_id":{"type":"string","format":"uuid","description":"Single collection ID to add (use this OR collection_ids)"},"collection_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Array of collection IDs to add"},"sort_order":{"type":"number","description":"Sort position within each collection (default: 0)"}}}}}}},"put":{"operationId":"put_products_by_id_collections","tags":["Products"],"summary":"Replace ALL of the product's collection memberships with the provided set (use [] to clear all)","description":"Replace ALL of the product's collection memberships with the provided set (use [] to clear all)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collection_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Complete list of collection IDs the product should belong to"}},"required":["collection_ids"]}}}}}},"/api/v1/products/{id}/collections/{collection_id}":{"delete":{"operationId":"delete_products_by_id_collections_by_collection_id","tags":["Products"],"summary":"Remove the product from a single collection","description":"Remove the product from a single collection","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"removed\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/consignment":{"get":{"operationId":"get_consignment","tags":["Consignment"],"summary":"List consignment items (scope: consignment:read)","description":"List consignment items (scope: consignment:read)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ... ], \"meta\": { \"page\": 1, \"pageSize\": 50, \"total\": 0 } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"Filter by status: listed, sold, hold, paid_out, returned","schema":{"type":"string"}}],"x-scopes":["consignment:read"]},"post":{"operationId":"post_consignment","tags":["Consignment"],"summary":"List a new item for consignment against an owner (scope: consignment:write)","description":"List a new item for consignment against an owner (scope: consignment:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\": \"...\", \"status\": \"listed\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"title","in":"query","required":true,"description":"Item title","schema":{"type":"string"}},{"name":"owner_contact_id","in":"query","required":false,"description":"Owner (client) contact id","schema":{"type":"string"}},{"name":"inventory_item_id","in":"query","required":false,"description":"Linked physical unit id","schema":{"type":"string"}},{"name":"product_id","in":"query","required":false,"description":"Linked catalog product id","schema":{"type":"string"}},{"name":"list_price","in":"query","required":false,"description":"List price (default: 0)","schema":{"type":"number"}},{"name":"owner_split","in":"query","required":false,"description":"Owner's fraction of the sale (default: 0.75)","schema":{"type":"number"}},{"name":"hold_days","in":"query","required":false,"description":"Return-window hold length in days (default: 14)","schema":{"type":"number"}},{"name":"notes","in":"query","required":false,"description":"Freeform notes","schema":{"type":"string"}}],"x-scopes":["consignment:write"]}},"/api/v1/consignment/{id}":{"get":{"operationId":"get_consignment_by_id","tags":["Consignment"],"summary":"Get a consignment item (scope: consignment:read)","description":"Get a consignment item (scope: consignment:read)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["consignment:read"]},"post":{"operationId":"post_consignment_by_id","tags":["Consignment"],"summary":"Perform an action on the item.","description":"Perform an action on the item. Selling records the 75/25 split, starts the hold window, and fires the consignment_sold automation trigger. (scope: consignment:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\": \"...\", \"status\": \"sold\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"action","in":"query","required":true,"description":"One of: sell, payout, return","schema":{"type":"string"}},{"name":"sale_amount","in":"query","required":false,"description":"Required for action=sell; the gross sale amount","schema":{"type":"number"}},{"name":"invoice_id","in":"query","required":false,"description":"Optional invoice link for action=sell","schema":{"type":"string"}},{"name":"payment_id","in":"query","required":false,"description":"Optional payment link for action=sell","schema":{"type":"string"}}],"x-scopes":["consignment:write"]}},"/api/v1/product-categories":{"get":{"operationId":"get_product_categories","tags":["Product Categories"],"summary":"List all product categories for the tenant","description":"List all product categories for the tenant","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"description\", \"color\", \"sort_order\", \"created_at\", \"updated_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_product_categories","tags":["Product Categories"],"summary":"Create a product category.","description":"Create a product category. Names are unique per tenant (case-insensitive).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Category name (unique per tenant)"},"description":{"type":"string","description":"Internal description"},"color":{"type":"string","description":"Optional hex color for UI badge (e.g. \"#3B82F6\")"},"sort_order":{"type":"number","description":"Display order (default: 0)"}},"required":["name"]}}}}}},"/api/v1/product-categories/{id}":{"get":{"operationId":"get_product_categories_by_id","tags":["Product Categories"],"summary":"Get a category","description":"Get a category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_product_categories_by_id","tags":["Product Categories"],"summary":"Update a category (any subset of fields)","description":"Update a category (any subset of fields)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name"},"description":{"type":"string","description":"New description"},"color":{"type":"string","description":"New badge color"},"sort_order":{"type":"number","description":"New display order"}}}}}}},"delete":{"operationId":"delete_product_categories_by_id","tags":["Product Categories"],"summary":"Delete a category.","description":"Delete a category. Removes the category and any product memberships pointing to it.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/product-collections":{"get":{"operationId":"get_product_collections","tags":["Product Collections"],"summary":"List all product collections for the tenant","description":"List all product collections for the tenant","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"description\", \"image_url\", \"sort_order\", \"published\", \"created_at\", \"updated_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"published","in":"query","required":false,"description":"When \"true\", only return published collections","schema":{"type":"boolean"}}]},"post":{"operationId":"post_product_collections","tags":["Product Collections"],"summary":"Create a product collection.","description":"Create a product collection. Slug is unique per tenant; auto-generated from name when omitted.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name"},"slug":{"type":"string","description":"URL slug (auto-generated from name if omitted)"},"description":{"type":"string","description":"Public-facing description"},"image_url":{"type":"string","description":"Cover image URL for storefront"},"sort_order":{"type":"number","description":"Display order (default: 0)"},"published":{"type":"boolean","description":"Visible on public storefront (default: true)"}},"required":["name"]}}}}}},"/api/v1/product-collections/{id}":{"get":{"operationId":"get_product_collections_by_id","tags":["Product Collections"],"summary":"Get a collection","description":"Get a collection","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_product_collections_by_id","tags":["Product Collections"],"summary":"Update a collection (any subset of fields)","description":"Update a collection (any subset of fields)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name"},"slug":{"type":"string","description":"New slug (must remain unique per tenant)"},"description":{"type":"string","description":"New description"},"image_url":{"type":"string","description":"New cover image URL"},"sort_order":{"type":"number","description":"New display order"},"published":{"type":"boolean","description":"Toggle public visibility"}}}}}}},"delete":{"operationId":"delete_product_collections_by_id","tags":["Product Collections"],"summary":"Delete a collection.","description":"Delete a collection. Removes the collection and any product memberships pointing to it.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/tags":{"get":{"operationId":"get_tags","tags":["Tags"],"summary":"List all tags","description":"List all tags","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"color\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_tags","tags":["Tags"],"summary":"Create a tag","description":"Create a tag","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"color\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color (e.g. #6366f1)"}},"required":["name"]}}}}},"delete":{"operationId":"delete_tags","tags":["Tags"],"summary":"Delete a tag","description":"Delete a tag","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"query","required":true,"description":"Tag ID (query parameter)","schema":{"type":"string","format":"uuid"}}]}},"/api/v1/appointments/{id}/confirmation":{"get":{"operationId":"get_appointments_by_id_confirmation","tags":["Calendar"],"summary":"Where the Confirmer has got to on one appointment.","description":"Where the Confirmer has got to on one appointment. States: pending (queued), asked (texted, no answer yet), confirmed, declined, cancelled, expired (the deadline passed unanswered while auto-cancel was off, so the appointment was LEFT ALONE), abandoned (no way to reach them, or they asked to move it). 404 when the appointment is not being chased, which is most of them: the loop is per booking calendar and off by default. Scope: calendar:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"appointment_id\", \"state\", \"attempts\", \"start_at\", \"deadline_at\", \"next_action_at\", \"last_signal\", \"last_signal_at\", \"resolved_via\", \"resolved_at\", \"blocked_reason\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["calendar:read"]},"patch":{"operationId":"patch_appointments_by_id_confirmation","tags":["Calendar"],"summary":"Settle a confirmation by hand, the same way the Confirm button in the CRM does, so the confirmation row and the appointm","description":"Settle a confirmation by hand, the same way the Confirm button in the CRM does, so the confirmation row and the appointment row can never disagree. A confirm outranks a terminal state on purpose: an override that silently does nothing on an expired row is worse than no override. This is NOT a general way to cancel an appointment — it records a decision about the confirmation and mirrors it onto the appointment. Scope: calendar:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"appointment_id\", \"state\", \"changed\" } — changed is false when the signal moved nothing."}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["calendar:update"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","description":"'confirm' or 'cancel'"}},"required":["decision"]}}}}}},"/api/v1/calendar":{"get":{"operationId":"get_calendar","tags":["Calendar"],"summary":"Upcoming appointments on the tenant calendar (Google-Calendar-synced).","description":"Upcoming appointments on the tenant calendar (Google-Calendar-synced). This is \"what's on my calendar.\"","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"title\", \"start_at\", \"end_at\", \"status\", \"location\", \"contact_id\" }], \"meta\": { \"from\", \"to\", \"days\", \"count\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"days","in":"query","required":false,"description":"Look-ahead window in days (default: 7, max: 60)","schema":{"type":"number"}}]},"post":{"operationId":"post_calendar","tags":["Calendar"],"summary":"Create an appointment and sync it to the owner's connected Google Calendar.","description":"Create an appointment and sync it to the owner's connected Google Calendar. Times are ISO 8601. If end_at is omitted it defaults to start_at + duration_minutes (30 min default).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"title\", \"start_at\", \"end_at\", \"status\", \"location\", \"contact_id\", \"google_event_id\", ... }, \"warning?\": \"...\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Appointment title"},"start_at":{"type":"string","description":"ISO 8601 start datetime (e.g. 2026-07-08T15:57:00-04:00)"},"end_at":{"type":"string","description":"ISO 8601 end datetime (optional)"},"duration_minutes":{"type":"number","description":"Used when end_at is omitted (default: 30, max: 1440)"},"contact_id":{"type":"string","format":"uuid","description":"Primary contact (becomes the calendar-invite attendee)"},"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Multiple contacts; first is primary"},"assignee_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Additional user assignees"},"description":{"type":"string","description":"Notes/agenda"},"location":{"type":"string","description":"Location text"},"location_type":{"type":"string","description":"google_meet | in_person | phone | custom. google_meet mints a real Meet link."},"user_id":{"type":"string","format":"uuid","description":"Owner whose Google Calendar syncs (defaults to the API key's user)"}},"required":["title","start_at"]}}}}}},"/api/v1/calendar/{id}":{"get":{"operationId":"get_calendar_by_id","tags":["Calendar"],"summary":"One CRM appointment with its notes (description) and contact.","description":"One CRM appointment with its notes (description) and contact. The contact (id, first_name, last_name, email, phone) is included only for keys that may read contacts. Google-only events have no CRM record here.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"title\", \"description\", \"start_at\", \"end_at\", \"status\", \"location\", \"contact_id\", \"calendar_id\", \"contact\": { ... } | null, ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_calendar_by_id","tags":["Calendar"],"summary":"Update / reschedule an appointment and patch the linked Google Calendar event.","description":"Update / reschedule an appointment and patch the linked Google Calendar event. Only provided fields change. Pass start_at (with optional duration_minutes) to reschedule; original duration is preserved if end_at is omitted. Set status: \"cancelled\" to soft-cancel (fires the appointment_cancelled automation).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"title\", \"start_at\", \"end_at\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"New title"},"start_at":{"type":"string","description":"ISO 8601 start (reschedule)"},"end_at":{"type":"string","description":"ISO 8601 end"},"duration_minutes":{"type":"number","description":"Derive end_at from a moved start_at"},"status":{"type":"string","description":"scheduled | confirmed | rescheduling | cancelled | completed | no_show"},"location":{"type":"string","description":"New location"},"description":{"type":"string","description":"New notes/agenda"},"contact_id":{"type":"string","format":"uuid","description":"Replace primary contact"},"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Replace the contact set"},"assignee_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Replace the assignee set"}}}}}}},"delete":{"operationId":"delete_calendar_by_id","tags":["Calendar"],"summary":"Delete an appointment and remove the linked Google Calendar event (sends cancellation to attendees).","description":"Delete an appointment and remove the linked Google Calendar event (sends cancellation to attendees).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/notes":{"get":{"operationId":"get_notes","tags":["Notes"],"summary":"List notes for a contact, company, or opportunity","description":"List notes for a contact, company, or opportunity","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"content\", \"created_at\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"contact_id","in":"query","required":false,"description":"Filter by contact","schema":{"type":"string","format":"uuid"}},{"name":"company_id","in":"query","required":false,"description":"Filter by company","schema":{"type":"string","format":"uuid"}},{"name":"opportunity_id","in":"query","required":false,"description":"Filter by opportunity","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_notes","tags":["Notes"],"summary":"Create a note on a contact, company, or opportunity.","description":"Create a note on a contact, company, or opportunity. 201 when created; 200 when external_id names a note this workspace already has.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"body\", \"source\", \"external_id\", \"metadata\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid","description":"Contact ID (one of contact/company/opportunity required)"},"company_id":{"type":"string","format":"uuid","description":"Company ID"},"opportunity_id":{"type":"string","format":"uuid","description":"Opportunity ID"},"content":{"type":"string","description":"Note content"},"external_id":{"type":"string","description":"Your own id for this note (e.g. the meeting id), up to 200 characters. Sending the same id again in this workspace does not make a copy: you get the existing note back with 200. If the text or metadata differ it is updated (needs notes:update; without it, 409). 409 when the id belongs to a note on a different record."},"source":{"type":"string","description":"Short label for where the note came from, shown on the note in the CRM: 1-50 lowercase letters, digits, - or _ (e.g. ai-recorder). Default manual."},"metadata":{"type":"object","description":"Any small JSON object stored with the note (at most 4 KB). Keys _external_id and _source are reserved."}},"required":["content"]}}}}}},"/api/v1/notes/{id}":{"get":{"operationId":"get_notes_by_id","tags":["Notes"],"summary":"Get a note","description":"Get a note","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_notes_by_id","tags":["Notes"],"summary":"Update a note","description":"Update a note","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_notes_by_id","tags":["Notes"],"summary":"Delete a note","description":"Delete a note","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/messages":{"get":{"operationId":"get_messages","tags":["Messages"],"summary":"List messages with pagination and filters","description":"List messages with pagination and filters","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"contact_id","in":"query","required":false,"description":"Only messages for this contact","schema":{"type":"string"}},{"name":"channel","in":"query","required":false,"description":"Filter by channel: sms, email","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"description":"Filter by direction: inbound, outbound","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"count","in":"query","required":false,"description":"Set to 'none' to skip the total row count and return meta.total as null. Strongly recommended for pollers that always read the newest page: on a workspace with six figures of messages an exact total is the slowest part of the request.","schema":{"type":"string"}}]}},"/api/v1/messages/sms":{"post":{"operationId":"post_messages_sms","tags":["Messages"],"summary":"Send an SMS (requires A2P consent)","description":"Send an SMS (requires A2P consent)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"Phone number"},"body":{"type":"string","description":"Message body"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID (for consent check)"},"use_case":{"type":"string","description":"marketing | transactional"}},"required":["to","body","contact_id","use_case"]}}}}}},"/api/v1/messages/email":{"post":{"operationId":"post_messages_email","tags":["Messages"],"summary":"Send an email","description":"Send an email","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"Email address"},"subject":{"type":"string","description":"Subject line"},"body":{"type":"string","description":"Email body (plain text, auto-converted to HTML)"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID (for tracking)"},"is_marketing":{"type":"boolean","description":"Marketing email (adds unsubscribe, respects opt-out); defaults to transactional"},"from_domain":{"type":"string","description":"Send from this verified sending domain (Settings → Email Domains), e.g. \"example.com\", instead of the workspace default. A domain that is not verified returns 400 listing the ones that are; it never falls back to another domain."},"sender_domain_id":{"type":"string","format":"uuid","description":"Same as from_domain, by the email domain id. If you pass both, they must name the same domain."}},"required":["to","subject","body"]}}}}}},"/api/v1/messages/imessage":{"post":{"operationId":"post_messages_imessage","tags":["Messages"],"summary":"Send an iMessage (requires iMessage integration enabled for the tenant)","description":"Send an iMessage (requires iMessage integration enabled for the tenant)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","description":"Phone number"},"body":{"type":"string","description":"Message body"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID (for tracking)"}},"required":["to","body"]}}}}}},"/api/v1/messages/log":{"post":{"operationId":"post_messages_log","tags":["Messages"],"summary":"Record a message you ALREADY sent through your own carrier, so the CRM holds the whole conversation instead of the inbou","description":"Record a message you ALREADY sent through your own carrier, so the CRM holds the whole conversation instead of the inbound half. It sends nothing and runs no consent gate — the carrier has already delivered it, so refusing the record would only hide it. To make the CRM do the sending (with DNC and A2P consent enforced), use POST /api/v1/messages/sms instead. The tenant is always the key's own tenant, never a body field. Pass the carrier's own message id as external_id: it is both the dedupe key and what the delivery-receipt webhook and the per-tenant SMS cost log match on. Re-posting the same external_id returns 200 with the existing row instead of a conflict, so a mirror that retried after a timeout is safe. API keys only (requires messages:create and the messaging permission); browser sessions are refused.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"messageId\", \"conversationId\", \"deduped\" } }  (201 new, 200 deduped)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","description":"The number or address the message was sent FROM"},"to":{"type":"string","description":"The recipient number or address"},"body":{"type":"string","description":"Message body"},"channel":{"type":"string","description":"sms | imessage | email (defaults to sms)"},"external_id":{"type":"string","description":"The carrier's own message id. Supply it — it is the dedupe and delivery-receipt key."},"status":{"type":"string","description":"sent | failed (defaults to sent)"},"error_message":{"type":"string","description":"Carrier error text when status is failed"},"contact_id":{"type":"string","format":"uuid","description":"Contact to attach it to; null or omitted leaves it unlinked"},"conversation_id":{"type":"string","format":"uuid","description":"Existing conversation to append to"},"subject":{"type":"string","description":"Subject line (email)"},"media_urls":{"type":"array","description":"Up to 10 attachment URLs (MMS)"},"media_type":{"type":"string","description":"MIME type of the attachments"},"ai_generated":{"type":"boolean","description":"Whether an AI wrote it (defaults to true)"},"sent_at":{"type":"string","description":"ISO timestamp the carrier sent it; defaults to now"}},"required":["from","to"]}}}}}},"/api/v1/ads/overview":{"get":{"operationId":"get_ads_overview","tags":["Paid Ads"],"summary":"Amplify's cockpit, the same numbers as the website's Amplify page: the first active ad account, its autonomy mode, every","description":"Amplify's cockpit, the same numbers as the website's Amplify page: the first active ad account, its autonomy mode, every campaign with lifetime spend and real (collected CRM) revenue, the last 10 moves Amplify made and up to 20 recommendations waiting for approval. account is null when no ad account is active. Signed-in sessions only (the iPhone app); API keys are refused because the totals include CRM revenue. Requires ads:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"account\": { \"id\", \"name\", \"platform\", \"currency\" } | null, \"mode\": \"suggest\" | \"semi_auto\" | \"full_auto\", \"reconnect_soon\", \"totals\": { \"spend_cents\", \"revenue_cents\", \"conversions\", \"real_roas\" }, \"campaigns\": [ { \"id\", \"name\", \"spend_cents\", \"impressions\", \"clicks\", \"conversions\", \"ctr\", \"real_revenue_cents\", \"real_roas\" } ], \"activity\": [ { \"id\", \"description\", \"automatic\", \"improved\", \"created_at\" } ], \"pending\": [ { \"id\", \"title\", \"description\", \"type\", \"priority\", \"confidence\", \"created_at\" } ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ads/campaigns":{"get":{"operationId":"get_ads_campaigns","tags":["Paid Ads"],"summary":"What the ads did over a date range, for an API key: spend, impressions, clicks, CTR, leads and cost per lead for each ca","description":"What the ads did over a date range, for an API key: spend, impressions, clicks, CTR, leads and cost per lead for each campaign on the primary ad account (the first active one, as on the Amplify page), plus up to 20 of Amplify's pending recommendations for that account. A campaign is listed when it delivered in the range or is active. It carries no revenue of any kind: no collected CRM money, no conversion value, no ROAS. Sentences in a recommendation's title or description that talk about income are removed, and its payload and analysis are never returned. leads counts Meta lead events once each and is null off Meta; conversions is purchases + leads + registrations as synced (a count, not money). account is null and both lists are empty when no ad account is active. API keys are allowed. Requires ads:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"account\": { \"id\", \"name\", \"platform\", \"currency\", \"timezone\" } | null, \"campaigns\": [ { \"id\", \"name\", \"status\", \"objective\", \"daily_budget_cents\", \"spend_cents\", \"impressions\", \"clicks\", \"ctr\", \"leads\", \"conversions\", \"cost_per_lead_cents\", \"cost_per_conversion_cents\" } ], \"recommendations\": [ { \"id\", \"type\", \"title\", \"description\", \"priority\", \"confidence\", \"entity_type\", \"entity_id\", \"created_at\", \"expires_at\" } ] }, \"meta\": { \"since\", \"until\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"since","in":"query","required":false,"description":"First day, YYYY-MM-DD, inclusive. Default: 6 days before until.","schema":{"type":"string"}},{"name":"until","in":"query","required":false,"description":"Last day, YYYY-MM-DD, inclusive. Default: yesterday in the ad account's time zone. The range is at most 90 days.","schema":{"type":"string"}}]}},"/api/v1/ads/rebalance":{"get":{"operationId":"get_ads_rebalance","tags":["Paid Ads"],"summary":"Score every ad in every active ad set and report what the rebalancer WOULD do.","description":"Score every ad in every active ad set and report what the rebalancer WOULD do. Read-only: it changes nothing on the platform and writes no recommendations, so it is safe to poll. Each ad gets a verdict of winner / dud / hold / insufficient_data with the arithmetic behind it. A result is what the set is bought for: a call on a Calls set (optimization goal QUALITY_CALL), a lead on a lead or conversions set. An ad is only judged once it has had enough traffic to have produced 3 expected results at its own ad set's rate, and it is compared leave-one-out against its peers rather than against an absolute target cost per result. An ad set that has produced no results at all reports verdict \"not_converting\" and gets no ad-level verdicts, because rotating ads cannot fix a set converting at zero. A set bought for anything else (traffic, reach, video views) reports verdict \"not_judged\" and is left alone. Requires ads:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"windowDays\", \"dryRun\": true, \"accounts\": [ { \"adAccountId\", \"mode\", \"sets\": [ { \"adSetName\", \"verdict\", \"note\", \"activeBefore\", \"activeAfter\", \"scored\": [ { \"name\", \"verdict\", \"cplCents\", \"reason\" } ] } ], \"actions\": [ { \"kind\", \"label\", \"reason\", \"executed\", \"heldBecause\" } ] } ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"days","in":"query","required":false,"description":"Trailing window in days (default 7, clamped to 3-90). Under 3 days nothing can clear the scorer's learning floor.","schema":{"type":"number"}},{"name":"ad_account_id","in":"query","required":false,"description":"Limit to one ad account. Omit for every active account on the tenant.","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_ads_rebalance","tags":["Paid Ads"],"summary":"Run the rebalancer for real: pause the duds, then clone the winner into whatever slots that freed, then raise the budget","description":"Run the rebalancer for real: pause the duds, then clone the winner into whatever slots that freed, then raise the budget behind a set that is working. How much of that actually executes is governed by the ad account's ad_autonomy_settings.mode — \"suggest\" writes recommendations and executes nothing, \"semi_auto\" executes only the action types with auto_approve set, \"full_auto\" executes within the budget guardrails. An ad set never exceeds max_active_ads_per_set (default 6) active ads, enforced both here and by a database trigger, and the last active ad in a set is never paused. Every action lands in ad_autonomy_log with before and after state. Requires ads:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"windowDays\", \"executed\", \"held\", \"failed\", \"accounts\": [ ... same shape as GET ... ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"ad_account_id","in":"query","required":false,"description":"Limit to one ad account. Omit for every active account on the tenant.","schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","required":false,"description":"Trailing window in days (default 7, clamped to 3-90)","schema":{"type":"number"}},{"name":"dry_run","in":"query","required":false,"description":"Score and report without changing anything, overriding the autonomy mode","schema":{"type":"boolean"}}]}},"/api/v1/ads/recommendations/{id}/approve":{"post":{"operationId":"post_ads_recommendations_by_id_approve","tags":["Paid Ads"],"summary":"Approve one of Amplify's pending recommendations and carry it out: a budget change or pause goes to Meta, the rest are r","description":"Approve one of Amplify's pending recommendations and carry it out: a budget change or pause goes to Meta, the rest are recorded as approved. The row is claimed (pending to approved) in one conditional update before anything reaches Meta, so a retry or a second tap answers 409 and never applies the change twice. Signed-in people only (an API key gets 403), with ads:write. 404 when the recommendation is not in this workspace, 409 when it was already decided, 502 when Meta refused the change (it stays approved and is not retried).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"status\": \"executed\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/ads/recommendations/{id}/skip":{"post":{"operationId":"post_ads_recommendations_by_id_skip","tags":["Paid Ads"],"summary":"Skip one of Amplify's pending recommendations.","description":"Skip one of Amplify's pending recommendations. Nothing changes on the ad account. Signed-in people only, with ads:write. 404 when it is not in this workspace, 409 when it was already decided.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"status\": \"rejected\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/analytics/query":{"get":{"operationId":"get_analytics_query","tags":["Analytics"],"summary":"Ask a business question in plain English and get the number back.","description":"Ask a business question in plain English and get the number back. Read-only (GET only) and requires the analytics:read scope, PLUS the data scope for the metric (e.g. a financial question needs invoices:read, a pipeline question needs opportunities:read) — a key can only ask what its scopes allow, and it is only offered the metrics it is scoped for. An LLM maps the question to a fixed catalog of tenant-scoped metrics (never raw SQL): revenue/P&L, payments collected, net revenue after refunds, processing fees, sales tax, top clients, average invoice value, revenue trend, this-vs-last period, outstanding AR, overdue invoices (aged), invoice summary, expenses by category, subscription MRR, MRR movement, failed/dunning payments, upcoming scheduled payments, lead-source ROI, paying-client count [invoices:read]; contact count, new contacts, lead sources, lead conversion [contacts:read]; close rate, deals won, pipeline value by stage, sales velocity [opportunities:read]; open/overdue tasks, tasks completed & on-time rate [tasks:read]; email/SMS campaign performance [campaigns:read]; call activity & talk time [messages:read]; labor cost by pay code [hours:read]; work-order profitability [work_orders:read]; top products, inventory value & low stock, product margin [products:read]; rental activity [rentals:read]; appointments booked, show/no-show rates [booking:read]. Returns a factual summary plus structured data.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"question\", \"metric\", \"period\": { \"from\", \"to\" }, \"answer\": \"<factual summary>\", \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":true,"description":"The question, e.g. \"who are my biggest clients this quarter\" or \"revenue and profit in the past 45 days\". Time frames like \"this month\" / \"past 45 days\" are resolved automatically.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Optional YYYY-MM-DD to pin the period start (overrides the inferred range)","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Optional YYYY-MM-DD to pin the period end","schema":{"type":"string","format":"date"}}]}},"/api/v1/analytics/events":{"post":{"operationId":"post_analytics_events","tags":["Analytics"],"summary":"Track custom analytics events (max 50 per batch)","description":"Track custom analytics events (max 50 per batch)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"count\": 5 } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","description":"[{ event_type, event_name?, properties?, url?, session_id? }]"}},"required":["events"]}}}}}},"/api/v1/analytics/track":{"post":{"operationId":"post_analytics_track","tags":["Analytics"],"summary":"Track a single analytics event (lighter alternative to /events)","description":"Track a single analytics event (lighter alternative to /events)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event_type":{"type":"string","description":"Event type identifier"},"event_name":{"type":"string","description":"Event name"},"properties":{"type":"object","description":"Custom properties"},"url":{"type":"string","description":"Page URL"},"session_id":{"type":"string","description":"Session ID"}},"required":["event_type"]}}}}}},"/api/v1/import/contacts":{"post":{"operationId":"post_import_contacts","tags":["Import"],"summary":"Bulk import contacts (runs in background, max 10K rows)","description":"Bulk import contacts (runs in background, max 10K rows)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ first_name, last_name?, email?, phone?, company_name?, tags? }]"}},"required":["rows"]}}}}}},"/api/v1/import/products":{"post":{"operationId":"post_import_products","tags":["Import"],"summary":"Bulk import products (runs in background)","description":"Bulk import products (runs in background)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ name, price?, type?, sku? }]"}},"required":["rows"]}}}}}},"/api/v1/import/invoices":{"post":{"operationId":"post_import_invoices","tags":["Import"],"summary":"Bulk import invoices (runs in background)","description":"Bulk import invoices (runs in background)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ description, quantity?, unit_price?, contact_email? }]"}},"required":["rows"]}}}}}},"/api/v1/import/estimates":{"post":{"operationId":"post_import_estimates","tags":["Import"],"summary":"Bulk import estimates (runs in background)","description":"Bulk import estimates (runs in background)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ contact_email?, line_items, status?, ... }]"}},"required":["rows"]}}}}}},"/api/v1/import/payments":{"post":{"operationId":"post_import_payments","tags":["Import"],"summary":"Bulk import payments (runs in background)","description":"Bulk import payments (runs in background)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ amount, invoice_id?, contact_email?, paid_at?, ... }]"}},"required":["rows"]}}}}}},"/api/v1/import/rentals":{"post":{"operationId":"post_import_rentals","tags":["Import"],"summary":"Bulk import rentals (runs in background)","description":"Bulk import rentals (runs in background)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"[{ product_id, contact_email?, start_at, end_at, rate_type, ... }]"}},"required":["rows"]}}}}}},"/api/v1/bulk/contacts/filter":{"get":{"operationId":"get_bulk_contacts_filter","tags":["Bulk Actions"],"summary":"The ids of every contact matching a search, status or tag, to pass to a bulk action.","description":"The ids of every contact matching a search, status or tag, to pass to a bulk action. A member limited to assigned contacts gets only theirs. Scope: bulk:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ids\": [\"uuid\", ...], \"count\": 120 }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"search","in":"query","required":false,"description":"Name, email or phone","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Contact status","schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"description":"Tag name","schema":{"type":"string"}}],"x-scopes":["bulk:write"]}},"/api/v1/bulk/contacts":{"post":{"operationId":"post_bulk_contacts","tags":["Bulk Actions"],"summary":"Bulk operations on contacts (tag, consent, automation, email, sms, dnc, delete).","description":"Bulk operations on contacts (tag, consent, automation, email, sms, dnc, delete). Every action but delete runs in the background and answers 202 with a job id. Delete answers 200 when the contacts are gone and also needs the contacts:delete scope.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"jobId\": \"uuid\" } (delete: { \"deleted\": 12 })"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","description":"tag | consent | automation | email | sms | dnc | delete"},"contactIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Array of contact IDs"},"tagName":{"type":"string","description":"Tag name (when action=tag)"},"useCase":{"type":"string","description":"marketing | transactional (when action=consent or sms)"},"optedIn":{"type":"boolean","description":"Opt in/out (when action=consent)"},"automationId":{"type":"string","format":"uuid","description":"Automation ID (when action=automation)"},"subject":{"type":"string","description":"Email subject (when action=email)"},"body":{"type":"string","description":"Email/SMS body (when action=email or sms)"},"reason":{"type":"string","description":"DNC reason (when action=dnc)"}},"required":["action","contactIds"]}}}}}},"/api/v1/blogs":{"get":{"operationId":"get_blogs","tags":["Blogs"],"summary":"List all blogs","description":"List all blogs","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"is_default\", \"custom_domain\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_blogs","tags":["Blogs"],"summary":"Create a blog","description":"Create a blog","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Blog name (e.g. \"AI Blog\")"},"slug":{"type":"string","description":"URL slug (auto-generated if omitted)"},"description":{"type":"string","description":"Blog description"},"logo_url":{"type":"string","description":"Blog logo URL"},"is_default":{"type":"boolean","description":"Set as default blog"}},"required":["name"]}}}}}},"/api/v1/blogs/{id}":{"get":{"operationId":"get_blogs_by_id","tags":["Blogs"],"summary":"Get a blog","description":"Get a blog","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_blogs_by_id","tags":["Blogs"],"summary":"Update a blog","description":"Update a blog","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Blog name"},"slug":{"type":"string","description":"URL slug"},"custom_domain":{"type":"string","description":"Custom domain (e.g. blog.example.com)"},"published":{"type":"boolean","description":"Published status"}}}}}}},"delete":{"operationId":"delete_blogs_by_id","tags":["Blogs"],"summary":"Delete a blog (posts become unassigned)","description":"Delete a blog (posts become unassigned)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/blogs/{id}/posts/{postId}/audio":{"post":{"operationId":"post_blogs_by_id_posts_by_postId_audio","tags":["Blog Posts"],"summary":"Narrate a post in the blog’s voice (an audio player appears on the post).","description":"Narrate a post in the blog’s voice (an audio player appears on the post). If the text has not changed since the last run, the existing audio is returned at no cost; send { \"force\": true } to make it again. Long posts can take a minute. Scope: blog:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"audio_url\", \"audio_duration_sec\", \"regenerated\": true, \"chars\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["blog:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Re-create even if the text is unchanged"}}}}}}},"delete":{"operationId":"delete_blogs_by_id_posts_by_postId_audio","tags":["Blog Posts"],"summary":"Remove a post’s narration and its file.","description":"Remove a post’s narration and its file. Scope: blog:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["blog:write"]}},"/api/v1/blogs/{blogId}/posts":{"get":{"operationId":"get_blogs_by_blogId_posts","tags":["Blog Posts"],"summary":"List posts in a blog","description":"List posts in a blog","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_blogs_by_blogId_posts","tags":["Blog Posts"],"summary":"Create a blog post","description":"Create a blog post","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Post title"},"slug":{"type":"string","description":"URL slug (or urlSlug)"},"rawHTML":{"type":"string","description":"Post content as HTML"},"body":{"type":"string","description":"Post content (TipTap HTML)"},"imageUrl":{"type":"string","description":"Cover image URL"},"imageAltText":{"type":"string","description":"Cover image alt text"},"description":{"type":"string","description":"Excerpt / summary"},"author_id":{"type":"string","format":"uuid","description":"Author ID"},"categories":{"type":"array","items":{"type":"string"},"description":"Category names"},"tags":{"type":"array","items":{"type":"string"},"description":"Tag names"},"status":{"type":"string","description":"\"PUBLISHED\" or \"DRAFT\""},"publishedAt":{"description":"Publish date (auto-set if omitted)"},"canonicalLink":{"type":"string","description":"Canonical URL for SEO"}},"required":["title","slug"]}}}}}},"/api/v1/blogs/{blogId}/posts/{postId}":{"get":{"operationId":"get_blogs_by_blogId_posts_by_postId","tags":["Blog Posts"],"summary":"Get a blog post","description":"Get a blog post","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_blogs_by_blogId_posts_by_postId","tags":["Blog Posts"],"summary":"Update a blog post","description":"Update a blog post","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_blogs_by_blogId_posts_by_postId","tags":["Blog Posts"],"summary":"Delete a blog post","description":"Delete a blog post","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"blogId","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/blog/authors":{"get":{"operationId":"get_blog_authors","tags":["Blog Authors"],"summary":"List blog authors","description":"List blog authors","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"avatar_url\", \"bio\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_blog_authors","tags":["Blog Authors"],"summary":"Create a blog author","description":"Create a blog author","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Author name"},"slug":{"type":"string","description":"URL slug (auto-generated if omitted)"},"avatar_url":{"type":"string","description":"Avatar image URL"},"bio":{"type":"string","description":"Short bio"}},"required":["name"]}}}}}},"/api/v1/blog/authors/{id}":{"get":{"operationId":"get_blog_authors_by_id","tags":["Blog Authors"],"summary":"Get a blog author","description":"Get a blog author","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_blog_authors_by_id","tags":["Blog Authors"],"summary":"Update a blog author","description":"Update a blog author","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_blog_authors_by_id","tags":["Blog Authors"],"summary":"Delete a blog author","description":"Delete a blog author","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/blog/categories":{"get":{"operationId":"get_blog_categories","tags":["Blog Categories"],"summary":"List blog categories","description":"List blog categories","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"image_url\", \"position\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_blog_categories","tags":["Blog Categories"],"summary":"Create a blog category","description":"Create a blog category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Category name"},"slug":{"type":"string","description":"URL slug (auto-generated if omitted)"},"image_url":{"type":"string","description":"Category image URL"},"description":{"type":"string","description":"Category description"}},"required":["name"]}}}}}},"/api/v1/blog/categories/{id}":{"get":{"operationId":"get_blog_categories_by_id","tags":["Blog Categories"],"summary":"Get a blog category","description":"Get a blog category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_blog_categories_by_id","tags":["Blog Categories"],"summary":"Update a blog category","description":"Update a blog category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_blog_categories_by_id","tags":["Blog Categories"],"summary":"Delete a blog category","description":"Delete a blog category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/forms":{"get":{"operationId":"get_forms","tags":["Forms"],"summary":"List forms and quizzes.","description":"List forms and quizzes. A quiz has kind: \"quiz\" and its scoring and reports in quiz. Scope: forms:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["f","ms:read"]},"post":{"operationId":"post_forms","tags":["Forms"],"summary":"Create a form, or a quiz with kind: \"quiz\".","description":"Create a form, or a quiz with kind: \"quiz\". Same rules as the form builder: a quiz needs a name field (full_name or first_name), an email or phone, and its TCPA consent boxes, or it is refused with 400. A new form starts unpublished: PATCH { \"published\": true } to put it live. Unknown keys are refused by name. 409 when the slug is taken. Scope: forms:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"kind\", \"fields\", \"quiz\", \"settings\", \"published\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["f","ms:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Form name"},"slug":{"type":"string","description":"URL slug: lowercase letters, numbers and hyphens, unique in the workspace"},"fields":{"type":"array","items":{"type":"object"},"description":"In screen order: { name, label, type, required, placeholder, options, map_to }. type: text, email, phone, textarea, select, checkbox, number, date, hidden, consent_transactional, consent_marketing, email_consent_transactional, email_consent_marketing. A quiz question is a select with quiz: { section, help, category, scores (points per option), offer_map, problem_map }."},"kind":{"type":"string","description":"form (default) | quiz"},"quiz":{"type":"object","description":"Quiz only: { intro, gate, submit_label, categories, offers, default_offer, bands, reports, result }. Each report is { id, offer, problem, title, body, cta_label, cta_url }, picked by offer x problem with \"*\" as the fallback for either; body tokens: {first_name} {score} {band} {problem} {offer}."},"settings":{"type":"object","description":"redirect_url, thank_you_message, notify_emails, privacy_policy_url, terms_url, submit_label, appearance, auto_responder, ..."},"tag_name":{"type":"string","description":"Tag added to each contact it creates"},"pipeline_id":{"type":"string","format":"uuid","description":"Pipeline new contacts enter"},"lead_source":{"type":"string","description":"Lead source stamped on new contacts"},"track_in_pixel":{"type":"boolean","description":"Send submissions to the tracking pixel (default true)"},"is_application":{"type":"boolean","description":"Review submissions; approving invites the person to the client portal (default false)"},"embed_allowed_origins":{"type":"array","items":{"type":"string"},"description":"Allowed sites: the websites that may embed and submit it, like \"https://example.com\" or \"*.example.com\" for its subdomains. Empty (the default) means any site. Saved in canonical form; a line that is not a website is refused with 400"}},"required":["name","slug","fields"]}}}}}},"/api/v1/forms/{id}":{"get":{"operationId":"get_forms_by_id","tags":["Forms"],"summary":"Get a form or quiz with its fields, settings and quiz config.","description":"Get a form or quiz with its fields, settings and quiz config. Scope: forms:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"kind\", \"fields\", \"quiz\", \"settings\", \"published\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["f","ms:read"]},"patch":{"operationId":"patch_forms_by_id","tags":["Forms"],"summary":"Change a form or quiz.","description":"Change a form or quiz. Send only the keys to change; each one replaces the stored value whole, so send the full fields, settings or quiz rather than a piece of one. The result must pass the same quiz rules as POST. Read-only keys sent back unchanged (id, tenant_id, created_at) are ignored. 409 when the slug is taken. Scope: forms:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["f","ms:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Form name"},"slug":{"type":"string","description":"URL slug: lowercase letters, numbers and hyphens, unique in the workspace"},"fields":{"type":"array","items":{"type":"object"},"description":"In screen order: { name, label, type, required, placeholder, options, map_to }. type: text, email, phone, textarea, select, checkbox, number, date, hidden, consent_transactional, consent_marketing, email_consent_transactional, email_consent_marketing. A quiz question is a select with quiz: { section, help, category, scores (points per option), offer_map, problem_map }."},"kind":{"type":"string","description":"form (default) | quiz"},"quiz":{"type":"object","description":"Quiz only: { intro, gate, submit_label, categories, offers, default_offer, bands, reports, result }. Each report is { id, offer, problem, title, body, cta_label, cta_url }, picked by offer x problem with \"*\" as the fallback for either; body tokens: {first_name} {score} {band} {problem} {offer}."},"settings":{"type":"object","description":"redirect_url, thank_you_message, notify_emails, privacy_policy_url, terms_url, submit_label, appearance, auto_responder, ..."},"tag_name":{"type":"string","description":"Tag added to each contact it creates"},"pipeline_id":{"type":"string","format":"uuid","description":"Pipeline new contacts enter"},"lead_source":{"type":"string","description":"Lead source stamped on new contacts"},"track_in_pixel":{"type":"boolean","description":"Send submissions to the tracking pixel (default true)"},"is_application":{"type":"boolean","description":"Review submissions; approving invites the person to the client portal (default false)"},"embed_allowed_origins":{"type":"array","items":{"type":"string"},"description":"Allowed sites: the websites that may embed and submit it, like \"https://example.com\" or \"*.example.com\" for its subdomains. Empty (the default) means any site. Saved in canonical form; a line that is not a website is refused with 400"},"published":{"type":"boolean","description":"Live at /f/{workspace}/{slug} when true"}}}}}}}},"/api/v1/forms/{id}/submissions":{"get":{"operationId":"get_forms_by_id_submissions","tags":["Forms"],"summary":"Submissions, newest first.","description":"Submissions, newest first. A quiz submission adds quiz_result (score out of 100, band, a score per category, the #1 problem and the offer) and result_url, the report page the person was sent to. Scope: forms:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"contact_id\", \"data\", \"source_url\", \"approval_status\", \"quiz_result\", \"result_url\", \"created_at\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default: 50, max: 100)","schema":{"type":"number"}},{"name":"contact_id","in":"query","required":false,"description":"Only this contact's submissions","schema":{"type":"string","format":"uuid"}}],"x-scopes":["f","ms:read"]}},"/api/v1/forms/{id}/submit":{"post":{"operationId":"post_forms_by_id_submit","tags":["Forms"],"summary":"Submit a form (public, no auth).","description":"Submit a form (public, no auth). A quiz is scored on the server; result_url is its report page, null for a plain form. When the form is a step in a published funnel with a Meta pixel, the server sends Meta a Lead with submission_id as its event id; a page that fires its own browser Lead should pass { eventID: submission_id } so Meta counts it once.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"submission_id\": \"uuid\", \"result_url\": \"string | null\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"Field values"},"source_url":{"type":"string","description":"The page the form was submitted on"},"fbp, fbc":{"type":"string","description":"The page's Meta _fbp / _fbc cookies, for the server Lead's match"}},"required":["data"]}}}}}},"/api/v1/frame/projects/{id}/segments":{"patch":{"operationId":"patch_frame_projects_by_id_segments","tags":["Frame — Projects"],"summary":"Correct the transcript text of a project’s caption segments.","description":"Correct the transcript text of a project’s caption segments. Scope: frame:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["frame:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object"},"description":"[{ \"id\": \"uuid\", \"text\": \"corrected words\" }]"}},"required":["segments"]}}}}}},"/api/v1/frame/projects":{"get":{"operationId":"get_frame_projects","tags":["Frame — Projects"],"summary":"List video projects","description":"List video projects","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"uploading | transcribing | editing | rendering | completed | failed","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Search by title","schema":{"type":"string"}}]},"post":{"operationId":"post_frame_projects","tags":["Frame — Projects"],"summary":"Create project + run full pipeline (transcribe → render)","description":"Create project + run full pipeline (transcribe → render)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"transcribing\", \"render_id\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"video_url":{"type":"string","description":"Public URL to video file (.mp4, .mov, .webm)"},"title":{"type":"string","description":"Project title (auto-generated if omitted)"},"language":{"type":"string","description":"Language code (default: en)"},"style_id":{"type":"string","format":"uuid","description":"Caption style ID (omit for Aura AI styling)"},"aura":{"type":"boolean","description":"Enable Aura — AI Creative Director (default: true)"},"b_roll":{"type":"boolean","description":"Enable B-roll auto-placement (default: false)"},"b_roll_percentage":{"type":"number","description":"B-roll coverage 0-100 (default: 30)"},"webhook_url":{"type":"string","description":"URL to receive completion callback"}},"required":["video_url"]}}}}}},"/api/v1/frame/projects/{id}":{"get":{"operationId":"get_frame_projects_by_id","tags":["Frame — Projects"],"summary":"Get a video project with segments","description":"Get a video project with segments","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_frame_projects_by_id","tags":["Frame — Projects"],"summary":"Update a video project","description":"Update a video project","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_frame_projects_by_id","tags":["Frame — Projects"],"summary":"Delete a video project and its storage files","description":"Delete a video project and its storage files","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/frame/projects/{id}/render":{"post":{"operationId":"post_frame_projects_by_id_render","tags":["Frame — Projects"],"summary":"Trigger a captioned video render","description":"Trigger a captioned video render","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"renderId\": \"uuid\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/frame/renders/{id}":{"get":{"operationId":"get_frame_renders_by_id","tags":["Frame — Projects"],"summary":"Poll render status and progress","description":"Poll render status and progress","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"status\", \"progress\", \"output_url\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/frame/styles":{"get":{"operationId":"get_frame_styles","tags":["Frame — Styles"],"summary":"List caption styles (system + custom)","description":"List caption styles (system + custom)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_frame_styles","tags":["Frame — Styles"],"summary":"Create a custom caption style","description":"Create a custom caption style","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Style name"},"slug":{"type":"string","description":"URL-safe slug (a-z, 0-9, hyphens)"},"config":{"type":"object","description":"CaptionStyleConfig (font, colors, animation, position, etc.)"}},"required":["name","slug","config"]}}}}}},"/api/v1/frame/styles/{id}":{"patch":{"operationId":"patch_frame_styles_by_id","tags":["Frame — Styles"],"summary":"Update a custom caption style","description":"Update a custom caption style","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_frame_styles_by_id","tags":["Frame — Styles"],"summary":"Delete a custom caption style","description":"Delete a custom caption style","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/frame/projects/{id}/splice":{"get":{"operationId":"get_frame_projects_by_id_splice","tags":["Frame — Splice"],"summary":"List splice jobs and clips for a project","description":"List splice jobs and clips for a project","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"jobs\": [...], \"clips\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_frame_projects_by_id_splice","tags":["Frame — Splice"],"summary":"Start AI clip extraction (Splice)","description":"Start AI clip extraction (Splice)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"queued\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"target_clip_count":{"type":"number","description":"Number of clips to extract (1-20, default: 10)"},"min_duration_s":{"type":"number","description":"Minimum clip length in seconds (default: 30)"},"max_duration_s":{"type":"number","description":"Maximum clip length in seconds (default: 90)"},"caption_style_id":{"type":"string","format":"uuid","description":"Caption style for extracted clips"}}}}}}}},"/api/v1/frame/splice/clips/{clipId}":{"patch":{"operationId":"patch_frame_splice_clips_by_clipId","tags":["Frame — Splice"],"summary":"Update a splice clip (title, trim, status)","description":"Update a splice clip (title, trim, status)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"clipId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Clip title"},"start_ms":{"type":"number","description":"Trim start (milliseconds)"},"end_ms":{"type":"number","description":"Trim end (milliseconds)"},"status":{"type":"string","description":"draft | selected"}}}}}}},"delete":{"operationId":"delete_frame_splice_clips_by_clipId","tags":["Frame — Splice"],"summary":"Delete a splice clip","description":"Delete a splice clip","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"clipId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/frame/splice/{jobId}/render":{"post":{"operationId":"post_frame_splice_by_jobId_render","tags":["Frame — Splice"],"summary":"Batch render selected clips","description":"Batch render selected clips","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"render_ids\": [\"uuid\", ...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clip_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Array of clip IDs to render"}},"required":["clip_ids"]}}}}}},"/api/v1/media":{"get":{"operationId":"get_media","tags":["Media"],"summary":"List media files and folders for the current level (scope: media:read)","description":"List media files and folders for the current level (scope: media:read)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...files], \"folders\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"folder_id","in":"query","required":false,"description":"Filter by parent folder ID. Use \"root\" for top-level.","schema":{"type":"string","format":"uuid"}},{"name":"file_type","in":"query","required":false,"description":"image | video | audio | document | other","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Search by file name (case-insensitive)","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["media:read"]}},"/api/v1/media/upload":{"post":{"operationId":"post_media_upload","tags":["Media"],"summary":"Upload a file (multipart/form-data) OR import from a URL (application/json).","description":"Upload a file (multipart/form-data) OR import from a URL (application/json). 5GB max per file. Stores in media-public or media-private Supabase bucket. (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"file_name\", \"file_url\", \"file_type\", \"mime_type\", \"file_size\", \"storage_path\", \"is_public\", \"folder_id\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["media:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"description":"Multipart file upload (when Content-Type: multipart/form-data). Required for direct upload."},"folder_id":{"type":"string","format":"uuid","description":"Target folder (null = root). Sent as form field or JSON."},"is_public":{"type":"boolean","description":"Public bucket (default true) — false stores in media-private with a 1-year signed URL."},"url":{"type":"string","description":"Source URL (when Content-Type: application/json). Required for URL import. File is referenced (not re-hosted) with storage_path \"external/<url>\"."},"file_name":{"type":"string","description":"Override file name (URL import only)"},"alt_text":{"type":"string","description":"Alt text (URL import only)"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags (URL import only)"}}}}}}}},"/api/v1/media/{id}":{"get":{"operationId":"get_media_by_id","tags":["Media"],"summary":"Get a single media file (scope: media:read)","description":"Get a single media file (scope: media:read)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"file_name\", \"file_url\", \"file_type\", \"mime_type\", \"file_size\", \"alt_text\", \"tags\", \"is_public\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["media:read"]},"patch":{"operationId":"patch_media_by_id","tags":["Media"],"summary":"Update file metadata (scope: media:write)","description":"Update file metadata (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["media:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","description":"Rename file"},"alt_text":{"type":"string","description":"Alt text for accessibility/SEO"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"folder_id":{"type":"string","format":"uuid","description":"Move to a different folder (null = root)"}}}}}}},"delete":{"operationId":"delete_media_by_id","tags":["Media"],"summary":"Delete a file.","description":"Delete a file. Also removes the underlying object from Supabase Storage unless it was a URL import (storage_path starting with \"external/\"). (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["media:write"]}},"/api/v1/media/folders":{"get":{"operationId":"get_media_folders","tags":["Media"],"summary":"List folders at a given level (scope: media:read)","description":"List folders at a given level (scope: media:read)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"parent_id\", \"created_at\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"parent_id","in":"query","required":false,"description":"Parent folder ID. Omit for root-level folders.","schema":{"type":"string","format":"uuid"}}],"x-scopes":["media:read"]},"post":{"operationId":"post_media_folders","tags":["Media"],"summary":"Create a folder.","description":"Create a folder. Returns 409 if a folder with the same name already exists at that level. (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"parent_id\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["media:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Folder name (unique per parent)"},"parent_id":{"type":"string","format":"uuid","description":"Parent folder (omit for root)"}},"required":["name"]}}}}}},"/api/v1/media/folders/{id}":{"patch":{"operationId":"patch_media_folders_by_id","tags":["Media"],"summary":"Rename or move a folder (scope: media:write)","description":"Rename or move a folder (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["media:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name"},"parent_id":{"type":"string","format":"uuid","description":"New parent folder (null = root)"}}}}}}},"delete":{"operationId":"delete_media_folders_by_id","tags":["Media"],"summary":"Delete a folder (scope: media:write)","description":"Delete a folder (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["media:write"]}},"/api/v1/media/uploads":{"post":{"operationId":"post_media_uploads","tags":["Media"],"summary":"Step 1 of a signed upload, for files too big for a request body (up to 5GB).","description":"Step 1 of a signed upload, for files too big for a request body (up to 5GB). Returns a one-time signed URL: PUT the raw bytes to signed_url with Content-Type set to mime_type (no API key or Authorization header; the URL carries the token, valid 2 hours), then call POST /api/v1/media/uploads/complete. Stores in media-private unless is_public is true. (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"bucket\", \"path\", \"token\", \"signed_url\" } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["media:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","description":"File name with its extension, e.g. reel.mp4 (the stored key keeps the extension; Instagram decides reel vs image from it)"},"mime_type":{"type":"string","description":"e.g. video/mp4"},"file_size":{"type":"number","description":"Size in bytes, 1 to 5368709120 (5GB)"},"folder_id":{"type":"string","format":"uuid","description":"Target folder in this workspace (null = root)"},"is_public":{"type":"boolean","description":"Public bucket (default false: media-private, served by a 1-year signed URL)"}},"required":["file_name","mime_type","file_size"]}}}}}},"/api/v1/media/uploads/complete":{"post":{"operationId":"post_media_uploads_complete","tags":["Media"],"summary":"Step 2 of a signed upload: checks the object was uploaded and creates the media file.","description":"Step 2 of a signed upload: checks the object was uploaded and creates the media file. Sending the same bucket and path again returns the first file with 200 and meta.idempotent. 400 when nothing was PUT to the signed URL yet. (scope: media:write)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"file_name\", \"file_url\", \"file_type\", \"mime_type\", \"file_size\", \"storage_path\", \"is_public\", \"folder_id\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["media:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bucket":{"type":"string","description":"bucket from step 1 (media-public | media-private)"},"path":{"type":"string","description":"path from step 1"},"file_name":{"type":"string","description":"Display name"},"mime_type":{"type":"string","description":"e.g. video/mp4"},"file_size":{"type":"number","description":"Size in bytes"},"folder_id":{"type":"string","format":"uuid","description":"Folder (default: the folder from step 1; null = root)"},"width":{"type":"number","description":"Pixel width"},"height":{"type":"number","description":"Pixel height"},"alt_text":{"type":"string","description":"Alt text"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 50 tags"}},"required":["bucket","path","file_name","mime_type","file_size"]}}}}}},"/api/v1/rentals":{"get":{"operationId":"get_rentals","tags":["Rentals"],"summary":"List rentals","description":"List rentals","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"reserved | active | returned | overdue | cancelled","schema":{"type":"string"}},{"name":"product_id","in":"query","required":false,"description":"Filter by product","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_rentals","tags":["Rentals"],"summary":"Create a rental","description":"Create a rental","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"Rental product ID"},"rate_type":{"type":"string","description":"hourly | daily | weekly | monthly"},"start_at":{"type":"string","format":"date-time","description":"Rental start"},"end_at":{"type":"string","format":"date-time","description":"Rental end"}},"required":["product_id","rate_type","start_at","end_at"]}}}}}},"/api/v1/rentals/{id}":{"get":{"operationId":"get_rentals_by_id","tags":["Rentals"],"summary":"Get a rental","description":"Get a rental","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_rentals_by_id","tags":["Rentals"],"summary":"Update a rental","description":"Update a rental","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_rentals_by_id","tags":["Rentals"],"summary":"Delete a rental (reserved/cancelled only)","description":"Delete a rental (reserved/cancelled only)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/rentals/{id}/return":{"post":{"operationId":"post_rentals_by_id_return","tags":["Rentals"],"summary":"Process return with damage assessment","description":"Process return with damage assessment","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"damage_amount":{"type":"number","description":"Damage cost"},"damage_notes":{"type":"string","description":"Damage description"}}}}}}}},"/api/v1/rentals/availability":{"get":{"operationId":"get_rentals_availability","tags":["Rentals"],"summary":"Check rental availability","description":"Check rental availability","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"available\": 3, \"total\": 5 }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"product_id","in":"query","required":true,"description":"Product ID","schema":{"type":"string","format":"uuid"}},{"name":"start_at","in":"query","required":true,"description":"Start date","schema":{"type":"string","format":"date-time"}},{"name":"end_at","in":"query","required":true,"description":"End date","schema":{"type":"string","format":"date-time"}}]}},"/api/v1/recurring-invoices":{"get":{"operationId":"get_recurring_invoices","tags":["Recurring Invoices"],"summary":"List recurring invoice schedules","description":"List recurring invoice schedules","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"active | paused | ended","schema":{"type":"string"}}]},"post":{"operationId":"post_recurring_invoices","tags":["Recurring Invoices"],"summary":"Create a recurring invoice schedule","description":"Create a recurring invoice schedule","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"active\", \"next_run_date\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid","description":"Contact ID"},"frequency":{"type":"string","description":"weekly | monthly | quarterly | yearly"},"line_items":{"type":"array","description":"[{ description, quantity, unit_price }]"},"start_date":{"type":"string","format":"date","description":"First invoice date"},"end_date":{"type":"string","format":"date","description":"Optional end date"}},"required":["contact_id","frequency","line_items","start_date"]}}}}}},"/api/v1/recurring-invoices/{id}":{"get":{"operationId":"get_recurring_invoices_by_id","tags":["Recurring Invoices"],"summary":"Get a recurring invoice schedule","description":"Get a recurring invoice schedule","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"put_recurring_invoices_by_id","tags":["Recurring Invoices"],"summary":"Update a recurring invoice schedule","description":"Update a recurring invoice schedule","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_recurring_invoices_by_id","tags":["Recurring Invoices"],"summary":"Delete a recurring invoice schedule","description":"Delete a recurring invoice schedule","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/recurring-invoices/{id}/run":{"post":{"operationId":"post_recurring_invoices_by_id_run","tags":["Recurring Invoices"],"summary":"Manually trigger invoice generation for a recurring template","description":"Manually trigger invoice generation for a recurring template","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"invoice_id\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/product-orders":{"get":{"operationId":"get_product_orders","tags":["Product Orders"],"summary":"List product orders","description":"List product orders","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"draft | pending | paid | processing | shipped | delivered | cancelled | refunded","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"Filter by contact","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 20)","schema":{"type":"number"}}]},"post":{"operationId":"post_product_orders","tags":["Product Orders"],"summary":"Create a product order","description":"Create a product order","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"order_number\", \"status\", \"total\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid","description":"Contact ID"},"items":{"type":"array","description":"[{ product_id, quantity, unit_price? }]"},"shipping_address":{"type":"object","description":"Shipping address"}},"required":["items"]}}}}}},"/api/v1/product-orders/{id}":{"get":{"operationId":"get_product_orders_by_id","tags":["Product Orders"],"summary":"Get a product order","description":"Get a product order","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_product_orders_by_id","tags":["Product Orders"],"summary":"Update a product order (status, fulfillment)","description":"Update a product order (status, fulfillment)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/product-checkout":{"post":{"operationId":"post_product_checkout","tags":["Storefront Checkout"],"summary":"Public product checkout — creates order and Stripe Checkout session (CORS enabled)","description":"Public product checkout — creates order and Stripe Checkout session (CORS enabled)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"order_id\", \"order_number\", \"total\", \"checkout_url\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string","description":"Tenant ID or slug"},"items":{"type":"array","description":"[{ product_id, quantity }]"},"customer":{"type":"object","description":"Customer info (email, name, phone)"}},"required":["tenant_id","items"]}}}}}},"/api/v1/storefront-checkout":{"post":{"operationId":"post_storefront_checkout","tags":["Storefront Checkout"],"summary":"Public mixed-cart checkout — products + rentals in a single Stripe session (CORS enabled)","description":"Public mixed-cart checkout — products + rentals in a single Stripe session (CORS enabled)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"product_order_id\", \"rental_order_id\", \"order_number\", \"total\", \"checkout_url\", \"paid\", \"shipping_cost\", \"shipping_method\", \"coupon_discount\", \"gift_card_amount\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_slug":{"type":"string","description":"Tenant slug or ID"},"name":{"type":"string","description":"Buyer name"},"email":{"type":"string","description":"Buyer email"},"purchase_items":{"type":"array","description":"[{ product_id, quantity, variant_id? }]"},"rental_items":{"type":"array","description":"[{ product_id, quantity, rate_type }] with start_at and end_at"},"purchase_coupon_code":{"type":"string","description":"Product coupon (not applied to gift cards)"},"fulfillment_method":{"type":"string","description":"'pickup' (default) or 'shipping'"},"shipping_address":{"type":"object","description":"{ street1, street2?, city, state, zip, country? }"},"shipping_rate_id":{"type":"string","description":"Carrier rate from /api/v1/shipping-rates. Omit to use the store flat rules."},"gift":{"type":"object","description":"{ is_gift, recipient_name?, recipient_email?, message? } (message up to 300 characters)"},"gift_card_code":{"type":"string","description":"Store gift card to redeem"},"success_url":{"type":"string","description":"Where to send the shopper after paying, up to 1000 characters. Used only when it is an https page on the store web address set in Settings, Storefront (www optional); otherwise the hosted shop. Gets order=<order_number>&total=<total>&session_id={CHECKOUT_SESSION_ID} appended (only session_id for rentals alone)."},"cancel_url":{"type":"string","description":"Where to send the shopper if they leave the payment page, up to 1000 characters. Same rule as success_url; otherwise the hosted checkout."}},"required":["tenant_slug","name","email"]}}}}}},"/api/v1/storefront-shipping":{"get":{"operationId":"get_storefront_shipping","tags":["Storefront Checkout"],"summary":"Public flat shipping rules and a headline such as \"Free shipping on orders of $75 or more\" (CORS, cached)","description":"Public flat shipping rules and a headline such as \"Free shipping on orders of $75 or more\" (CORS, cached)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"flat_shipping\": { \"enabled\", \"label\", \"rate\", \"free_over\", \"allowed_countries\", \"free_product_ids\", \"zones\", \"headline\" } | null, \"carrier_rates\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"tenant_slug","in":"query","required":true,"description":"Tenant slug or ID","schema":{"type":"string"}}]},"post":{"operationId":"post_storefront_shipping","tags":["Storefront Checkout"],"summary":"Public cart quote before checkout: server prices, coupon, flat shipping and gift card.","description":"Public cart quote before checkout: server prices, coupon, flat shipping and gift card. Nothing is reserved (CORS enabled)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"subtotal\", \"coupon\", \"shipping\": { \"cost\", \"label\", \"method\", \"free\", \"free_over\", \"remaining_for_free\", ... } | null, \"tax\", \"total\", \"gift_card\", \"amount_due\", \"carrier_rates\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_slug":{"type":"string","description":"Tenant slug or ID"},"items":{"type":"array","description":"[{ product_id, quantity, variant_id? }]"},"fulfillment_method":{"type":"string","description":"'shipping' (default) or 'pickup'"},"destination":{"type":"object","description":"{ country?, state? } (blank country means US)"},"coupon_code":{"type":"string","description":"Product coupon to try"},"gift_card_code":{"type":"string","description":"Gift card to try"}},"required":["tenant_slug","items"]}}}}}},"/api/v1/storefront-feed/{tenantSlug}":{"get":{"operationId":"get_storefront_feed_by_tenantSlug","tags":["Storefront Checkout"],"summary":"Public Google Merchant Center product feed (RSS 2.0 XML, g: namespace).","description":"Public Google Merchant Center product feed (RSS 2.0 XML, g: namespace). 404 until turned on in Settings > Storefront. Cached for an hour","responses":{"200":{"description":"Success","content":{"application/json":{"example":"<rss version=\"2.0\" xmlns:g=\"http://base.google.com/ns/1.0\"> with one <item> per active store product"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"tenantSlug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/rental-checkout":{"post":{"operationId":"post_rental_checkout","tags":["Storefront Checkout"],"summary":"Public rental checkout with pricing rules (CORS enabled)","description":"Public rental checkout with pricing rules (CORS enabled)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"order_id\", \"order_number\", \"total\", \"deposit_total\", \"checkout_url\", \"pending_approval\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string","description":"Tenant ID or slug"},"items":{"type":"array","description":"[{ product_id, start_at, end_at, rate_type, quantity? }]"},"customer":{"type":"object","description":"Customer info"}},"required":["tenant_id","items"]}}}}}},"/api/v1/rental-blackout-check":{"post":{"operationId":"post_rental_blackout_check","tags":["Storefront Checkout"],"summary":"Check rental availability and blackout dates across multiple products (public, CORS)","description":"Check rental availability and blackout dates across multiple products (public, CORS)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"results\": { [productId]: { \"blocked\", \"blocked_dates\", ... } } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string","description":"Tenant ID or slug"},"items":{"type":"array","description":"[{ product_id, start_at, end_at }]"}},"required":["tenant_id","items"]}}}}}},"/api/v1/rental-price-preview":{"get":{"operationId":"get_rental_price_preview","tags":["Storefront Checkout"],"summary":"Calculate effective rental price with all pricing rules applied (public)","description":"Calculate effective rental price with all pricing rules applied (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"subtotal\", \"periods\", \"effectiveRate\", \"baseRate\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"product_id","in":"query","required":true,"description":"Rental product ID","schema":{"type":"string","format":"uuid"}},{"name":"tenant_slug","in":"query","required":true,"description":"Tenant slug or ID","schema":{"type":"string"}},{"name":"rate_type","in":"query","required":true,"description":"hourly | daily | weekly | monthly | custom","schema":{"type":"string"}},{"name":"start_at","in":"query","required":true,"description":"Start date","schema":{"type":"string","format":"date-time"}},{"name":"end_at","in":"query","required":true,"description":"End date","schema":{"type":"string","format":"date-time"}},{"name":"quantity","in":"query","required":false,"description":"Quantity (default 1)","schema":{"type":"number"}}]}},"/api/v1/rental-drafts":{"post":{"operationId":"post_rental_drafts","tags":["Storefront Checkout"],"summary":"Save or update a rental order draft (autosave-friendly)","description":"Save or update a rental order draft (autosave-friendly)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"id\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Existing draft ID (omit to create new)"},"snapshot":{"type":"object","description":"Draft snapshot payload"}},"required":["snapshot"]}}}}},"delete":{"operationId":"delete_rental_drafts","tags":["Storefront Checkout"],"summary":"Delete a saved rental order draft","description":"Delete a saved rental order draft","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"query","required":true,"description":"Draft ID","schema":{"type":"string","format":"uuid"}}]}},"/api/v1/verify-payment":{"post":{"operationId":"post_verify_payment","tags":["Storefront Checkout"],"summary":"Fallback payment verification when customer returns from Stripe (idempotent)","description":"Fallback payment verification when customer returns from Stripe (idempotent)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"updated\": true, \"status\": \"paid\" | \"reserved\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","description":"Stripe Checkout session ID"}},"required":["session_id"]}}}}}},"/api/v1/parcels":{"get":{"operationId":"get_parcels","tags":["Parcels"],"summary":"Search residential parcels, as the Parcels browse page does: 50 a page, never past the first 500 matches.","description":"Search residential parcels, as the Parcels browse page does: 50 a page, never past the first 500 matches. Parcels are county records shared by every workspace with Parcels. Scope: parcels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"parcel_id\", \"owner_name\", \"situs_addr1\", \"situs_city\", \"just_value\", \"signal_score\", \"signal_count\", ... }], \"meta\": { \"page\", \"page_size\", \"estimated_total\", \"capped_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"owner","in":"query","required":false,"description":"Owner name contains","schema":{"type":"string"}},{"name":"address","in":"query","required":false,"description":"Property address contains","schema":{"type":"string"}},{"name":"signals","in":"query","required":false,"description":"Distress signals within days, e.g. lis_pendens:90,probate:30 (up to 4)","schema":{"type":"string"}},{"name":"absentee","in":"query","required":false,"description":"1 for absentee owners only, 0 to leave them out","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"1 for company owners only, 0 for people only","schema":{"type":"string"}},{"name":"homestead","in":"query","required":false,"description":"1 for homesteaded only, 0 to leave them out","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"value_desc (default), value_asc, year_built_desc or signal_score_desc","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page, 1 to 10","schema":{"type":"integer"}}],"x-scopes":["parcels:read"]}},"/api/v1/parcels/{id}":{"get":{"operationId":"get_parcels_by_id","tags":["Parcels"],"summary":"One parcel with its distress signals, newest first.","description":"One parcel with its distress signals, newest first. A signal's type and dates only, never the record it came from. Scope: parcels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"parcel_id\", \"owner_name\", \"owner_addr1\", \"situs_addr1\", \"just_value\", \"assessed_value\", \"year_built\", \"last_sale_price\", ..., \"signals\": [{ \"id\", \"signal_type\", \"observed_at\", \"expires_at\" }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["parcels:read"]}},"/api/v1/parcels/lists":{"get":{"operationId":"get_parcels_lists","tags":["Parcels"],"summary":"The workspace's saved parcel lists, newest first.","description":"The workspace's saved parcel lists, newest first. Scope: parcels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"last_run_at\", \"last_run_count\", \"created_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["parcels:read"]}},"/api/v1/parcels/lists/{id}":{"get":{"operationId":"get_parcels_lists_by_id","tags":["Parcels"],"summary":"One saved list and its top 500 parcels by signal score, with the full count in member_count.","description":"One saved list and its top 500 parcels by signal score, with the full count in member_count. 404 when the list isn't yours. Scope: parcels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"last_run_at\", \"last_run_count\", \"member_count\", \"parcels\": [{ \"id\", \"owner_name\", \"situs_addr1\", \"just_value\", \"signal_score\", ... }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["parcels:read"]}},"/api/v1/automations":{"get":{"operationId":"get_automations","tags":["Automations"],"summary":"List the workspace's automations, newest first, as the Automations page shows them.","description":"List the workspace's automations, newest first, as the Automations page shows them. Each one's trigger details are its tag_name and to_status only; its steps and settings are never returned. Scope: automations:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"enabled\", \"trigger_type\", \"trigger_tag\", \"trigger_to_status\", \"folder_id\", \"schedule_cron\", \"last_run_at\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"folder_id","in":"query","required":false,"description":"Only the automations in this folder (default: the ones in no folder)","schema":{"type":"string","format":"uuid"}},{"name":"all","in":"query","required":false,"description":"Set to 1 to get every automation, in any folder","schema":{"type":"string"}}],"x-scopes":["automations:read"]},"post":{"operationId":"post_automations","tags":["Automations"],"summary":"Build a workflow as the editor saves it: one trigger node, its steps, and the lines between them.","description":"Build a workflow as the editor saves it: one trigger node, its steps, and the lines between them. Node ids are yours to choose (\"trigger\", \"sms1\"); the response gives each node its stored id. Created OFF unless enabled is true. Each step leads to ONE next step, and a condition to one on \"true\" and one on \"false\", because the engine follows a single line per handle: a text then an email is a chain, trigger → send_sms → send_email, never two lines out of the trigger. Emails go from the workspace's sender (Settings → Email). Scope: automations:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"enabled\", \"trigger_type\", ..., \"nodes\": [{ \"id\", \"type\", \"subtype\", \"config\", \"position_x\", \"position_y\" }], \"edges\": [{ \"source_node_id\", \"target_node_id\", \"source_handle\" }] } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["automations:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Workflow name"},"nodes":{"type":"array","description":"[{ id, type: trigger|action|condition|delay|transform, subtype, config, position_x?, position_y? }]. E.g. { id: \"t\", type: \"trigger\", subtype: \"form_submitted\", config: { form_id } }, { id: \"sms1\", type: \"action\", subtype: \"send_sms\", config: { message } }, { id: \"wait1\", type: \"delay\", subtype: \"wait_duration\", config: { days: 1 } }, { id: \"mail1\", type: \"action\", subtype: \"send_email\", config: { email_subject, email_body, sender_domain_id? } } (sender_domain_id picks one of the verified sending domains in the workspace; omit it for the default). Merge fields like {{contact.first_name}} work as in the editor."},"edges":{"type":"array","description":"[{ source_node_id, target_node_id, source_handle? }]; source_handle is \"default\", or \"true\" / \"false\" out of a condition"},"enabled":{"type":"boolean","description":"Turn it on now (default false). Refused while nothing is connected to the trigger."},"folder_id":{"type":"string","format":"uuid","description":"Put it in this folder"},"schedule_cron":{"type":"string","description":"For a schedule trigger"},"schedule_timezone":{"type":"string","description":"For a schedule trigger"}},"required":["name","nodes"]}}}}}},"/api/v1/automations/{id}/runs":{"get":{"operationId":"get_automations_by_id_runs","tags":["Automations"],"summary":"An automation's latest runs, newest first, each with its steps in the order they ran: status, error and duration, never ","description":"An automation's latest runs, newest first, each with its steps in the order they ran: status, error and duration, never what a run was triggered with or what a step produced. 404 when the automation isn't yours. Scope: automations:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"status\", \"error\", \"created_at\", \"steps\": [{ \"id\", \"node_type\", \"node_subtype\", \"status\", \"error\", \"duration_ms\", \"executed_at\" }] }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many runs (default 20, at most 50)","schema":{"type":"integer"}}],"x-scopes":["automations:read"]}},"/api/v1/automations/{id}":{"get":{"operationId":"get_automations_by_id","tags":["Automations"],"summary":"One workflow with its nodes and edges, to edit and send back with PATCH.","description":"One workflow with its nodes and edges, to edit and send back with PATCH. HTTP step passwords, tokens and header values read as \"[redacted]\"; send them back unchanged to keep them. This is what the steps send, which automations:read never shows. Scope: automations:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"enabled\", \"version\", \"trigger_type\", ..., \"nodes\": [...], \"edges\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["automations:update"]},"patch":{"operationId":"patch_automations_by_id","tags":["Automations"],"summary":"Rename a workflow, switch it on or off, or replace its graph.","description":"Rename a workflow, switch it on or off, or replace its graph. Nodes and edges go together and replace the whole graph, under the same rules as POST. Keep the node ids GET returned: a node with a new id is a new step, and anyone waiting on a step that is gone stops there. 409 for a workflow from the old list editor. Scope: automations:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"nodes\": [...], \"edges\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["automations:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Workflow name"},"enabled":{"type":"boolean","description":"On or off"},"nodes":{"type":"array","description":"The whole graph's nodes (with edges)"},"edges":{"type":"array","description":"The whole graph's edges (with nodes)"},"schedule_cron":{"type":"string","description":"For a schedule trigger; null clears it"},"schedule_timezone":{"type":"string","description":"For a schedule trigger; null clears it"}}}}}}}},"/api/v1/automations/folders":{"get":{"operationId":"get_automations_folders","tags":["Automations"],"summary":"List automation folders","description":"List automation folders","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"parent_id\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"parent_id","in":"query","required":false,"description":"Filter by parent folder","schema":{"type":"string","format":"uuid"}},{"name":"all","in":"query","required":false,"description":"Set to 1 to get all folders (default: root only)","schema":{"type":"string"}}]},"post":{"operationId":"post_automations_folders","tags":["Automations"],"summary":"Create an automation folder","description":"Create an automation folder","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Folder name"},"parent_id":{"type":"string","format":"uuid","description":"Parent folder ID (omit for root)"}},"required":["name"]}}}}}},"/api/v1/automations/folders/{id}":{"patch":{"operationId":"patch_automations_folders_by_id","tags":["Automations"],"summary":"Update an automation folder","description":"Update an automation folder","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_automations_folders_by_id","tags":["Automations"],"summary":"Delete an automation folder","description":"Delete an automation folder","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/auto-responder":{"get":{"operationId":"get_auto_responder","tags":["Auto-Responder"],"summary":"The workspace's Auto-Responder: its settings (null before the first save), training data, and how many replies it sent a","description":"The workspace's Auto-Responder: its settings (null before the first save), training data, and how many replies it sent and handed to a person. ready is false until the workspace has a card on file; it can't be switched on before then. channels and models are what the settings offer. Needs auto_responders:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"responder\": { \"id\", \"name\", \"enabled\", \"channels\", \"respond_during\", \"escalation_keywords\", \"max_auto_replies\", \"model\", \"system_prompt_override\", \"min_delay_seconds\", \"max_delay_seconds\", \"ctas\", \"keyword_rules\", \"comment_rules\", \"welcome_message\", \"updated_at\" } | null, \"context_items\": [{ \"id\", \"type\", \"title\", \"content\", \"priority\", \"enabled\", \"updated_at\" }], \"stats\": { \"responses\", \"escalations\", \"avg_latency_ms\" }, \"ready\", \"channels\", \"models\", \"limits\": { \"prompt\", \"context_title\", \"context_content\", \"max_auto_replies\" } } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"patch_auto_responder","tags":["Auto-Responder"],"summary":"Change the Auto-Responder settings.","description":"Change the Auto-Responder settings. Only the fields sent change; the first save creates it, switched off. Switching it on needs a card on file (409 otherwise). Signed-in people only. Needs auto_responders:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"enabled\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"On or off"},"channels":{"type":"array","items":{"type":"string"},"description":"sms, email, instagram, facebook (imessage when it is on)"},"respond_during":{"type":"string","description":"always, business_hours_only or after_hours_only"},"escalation_keywords":{"type":"array","items":{"type":"string"},"description":"Words that hand the conversation to a person"},"max_auto_replies":{"type":"number","description":"Replies per conversation before a person takes over, 1 to 100"},"model":{"type":"string","description":"gpt-4o-mini, gpt-4.1-nano or gpt-4o"},"system_prompt_override":{"description":"Instructions for the AI"},"min_delay_seconds":{"type":"number","description":"Shortest wait before replying, 0 to 120"},"max_delay_seconds":{"type":"number","description":"Longest wait before replying, 0 to 120"}}}}}}}},"/api/v1/auto-responder/context":{"post":{"operationId":"post_auto_responder_context","tags":["Auto-Responder"],"summary":"Add training data to the Auto-Responder.","description":"Add training data to the Auto-Responder. 409 before its settings were first saved. Signed-in people only. Needs auto_responders:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"type\", \"title\", \"content\", \"priority\", \"enabled\", \"updated_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"faq, product, service, policy or custom"},"title":{"type":"string","description":"Up to 300 characters"},"content":{"type":"string","description":"What the AI should know, up to 20,000 characters"},"enabled":{"type":"boolean","description":"Default true"}},"required":["type","title","content"]}}}}}},"/api/v1/auto-responder/context/{id}":{"patch":{"operationId":"patch_auto_responder_context_by_id","tags":["Auto-Responder"],"summary":"Change training data.","description":"Change training data. Only the fields sent change. Signed-in people only. Needs auto_responders:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"type\", \"title\", \"content\", \"priority\", \"enabled\", \"updated_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_auto_responder_context_by_id","tags":["Auto-Responder"],"summary":"Delete training data.","description":"Delete training data. Signed-in people only. Needs auto_responders:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/documents":{"get":{"operationId":"get_documents","tags":["Documents"],"summary":"List documents","description":"List documents","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (max 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"Filter by document status","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"Filter by contact","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_documents","tags":["Documents"],"summary":"Create a document with recipients","description":"Create a document with recipients","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"number\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Document title"},"content":{"type":"string","description":"Document HTML/template"},"recipients":{"type":"array","description":"[{ email, name, role? }]"},"contact_id":{"type":"string","format":"uuid","description":"Associated contact"}},"required":["title","content","recipients"]}}}}}},"/api/v1/documents/{id}":{"get":{"operationId":"get_documents_by_id","tags":["Documents"],"summary":"Get a document with recipients","description":"Get a document with recipients","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_documents_by_id","tags":["Documents"],"summary":"Update a document","description":"Update a document","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_documents_by_id","tags":["Documents"],"summary":"Delete a document","description":"Delete a document","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/documents/{id}/audit":{"get":{"operationId":"get_documents_by_id_audit","tags":["Documents"],"summary":"Get audit trail for a document","description":"Get audit trail for a document","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/documents/{id}/send":{"post":{"operationId":"post_documents_by_id_send","tags":["Documents"],"summary":"Send a document to recipients via email","description":"Send a document to recipients via email","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"shareUrl\", \"emailSent\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/documents/sign":{"post":{"operationId":"post_documents_sign","tags":["Documents"],"summary":"Sign a document publicly (token-based, no auth)","description":"Sign a document publicly (token-based, no auth)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"share_token":{"type":"string","description":"Public sign token"},"signature":{"type":"string","description":"Signature data URL"},"fields":{"type":"object","description":"Field values to record"}},"required":["share_token","signature"]}}}}}},"/api/v1/wiki/spaces":{"get":{"operationId":"get_wiki_spaces","tags":["Playbooks"],"summary":"List the workspace's Playbooks spaces, then the shared ones, in the sidebar's order.","description":"List the workspace's Playbooks spaces, then the shared ones, in the sidebar's order. Archived spaces are left out.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"icon\", \"description\", \"is_system\", \"sort_order\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/wiki/spaces/{id}/pages":{"get":{"operationId":"get_wiki_spaces_by_id_pages","tags":["Playbooks"],"summary":"List a space's pages without their bodies, in the space's order.","description":"List a space's pages without their bodies, in the space's order. Archived pages and pages your role may not read are left out. 404 when the space isn't yours or shared.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"parent_id\", \"title\", \"excerpt\", \"status\", \"verified_at\", \"verify_expires_at\", \"updated_at\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/wiki/pages/{id}":{"get":{"operationId":"get_wiki_pages_by_id","tags":["Playbooks"],"summary":"Get one page with its markdown body.","description":"Get one page with its markdown body. 404 when it is missing or your role may not read it.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"title\", \"body_md\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/document-templates":{"get":{"operationId":"get_document_templates","tags":["Document Templates"],"summary":"List document templates","description":"List document templates","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_document_templates","tags":["Document Templates"],"summary":"Create a document template","description":"Create a document template","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"content":{"type":"string","description":"Template HTML/markup"},"description":{"type":"string","description":"Description"},"field_schema":{"type":"object","description":"Field schema definition"}},"required":["name","content"]}}}}}},"/api/v1/document-templates/{id}":{"get":{"operationId":"get_document_templates_by_id","tags":["Document Templates"],"summary":"Get a document template","description":"Get a document template","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_document_templates_by_id","tags":["Document Templates"],"summary":"Update a document template","description":"Update a document template","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_document_templates_by_id","tags":["Document Templates"],"summary":"Delete a document template","description":"Delete a document template","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/domains":{"get":{"operationId":"get_domains","tags":["Domains"],"summary":"List connected domains","description":"List connected domains","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"name\", \"status\", \"verified\", \"expires_at\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_domains","tags":["Domains"],"summary":"Connect an existing domain to the tenant (owner or admin).","description":"Connect an existing domain to the tenant (owner or admin). A domain another workspace already uses, or one already set up on HyppoCRM, returns 409; when DNS proof can settle it, the message names the TXT record to add.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name (e.g. example.com)"},"attach_to_project":{"type":"boolean","description":"Also serve the domain from HyppoCRM"}},"required":["domain"]}}}}}},"/api/v1/domains/{domain}":{"get":{"operationId":"get_domains_by_domain","tags":["Domains"],"summary":"Get details for a specific domain","description":"Get details for a specific domain","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}},{"name":"refresh","in":"query","required":false,"description":"Set to 1 to force re-check","schema":{"type":"string"}}]},"delete":{"operationId":"delete_domains_by_domain","tags":["Domains"],"summary":"Disconnect a domain","description":"Disconnect a domain","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/domains/{domain}/records":{"get":{"operationId":"get_domains_by_domain_records","tags":["Domains"],"summary":"List DNS records","description":"List DNS records","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_domains_by_domain_records","tags":["Domains"],"summary":"Create a DNS record","description":"Create a DNS record","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A | AAAA | CNAME | MX | TXT | NS | SRV"},"name":{"type":"string","description":"Record name (subdomain or @)"},"value":{"type":"string","description":"Record value"},"ttl":{"type":"number","description":"TTL in seconds"}},"required":["type","name","value"]}}}}}},"/api/v1/domains/{domain}/records/{id}":{"patch":{"operationId":"patch_domains_by_domain_records_by_id","tags":["Domains"],"summary":"Update a DNS record","description":"Update a DNS record","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_domains_by_domain_records_by_id","tags":["Domains"],"summary":"Delete a DNS record","description":"Delete a DNS record","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/domains/{domain}/auth-code":{"get":{"operationId":"get_domains_by_domain_auth_code","tags":["Domains"],"summary":"Get the authorization code for domain transfer.","description":"Get the authorization code for domain transfer. Owner or admin, signed-in session only (API keys are refused). Domains linked by support need support to release the code.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"code\", \"unlock_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/domains/{domain}/auto-renew":{"patch":{"operationId":"patch_domains_by_domain_auto_renew","tags":["Domains"],"summary":"Enable or disable auto-renewal","description":"Enable or disable auto-renewal","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"auto_renew":{"type":"boolean","description":"Enable/disable auto-renew"}},"required":["auto_renew"]}}}}}},"/api/v1/domains/{domain}/renew":{"post":{"operationId":"post_domains_by_domain_renew","tags":["Domains"],"summary":"Renew a domain.","description":"Renew a domain. Owner or admin with the payment settings permission, and a card on file (402 otherwise).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"expires_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"years":{"type":"number","description":"Number of years"}},"required":["years"]}}}}}},"/api/v1/domains/{domain}/refresh-transfer":{"post":{"operationId":"post_domains_by_domain_refresh_transfer","tags":["Domains"],"summary":"Reconcile a pending domain transfer status","description":"Reconcile a pending domain transfer status","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"status\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/domains/search":{"get":{"operationId":"get_domains_search","tags":["Domains"],"summary":"Search domain availability","description":"Search domain availability","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"domain\", \"available\", \"price\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"domain","in":"query","required":true,"description":"Domain to search","schema":{"type":"string"}},{"name":"years","in":"query","required":false,"description":"Registration period (default 1)","schema":{"type":"number"}},{"name":"kind","in":"query","required":false,"description":"register | transfer (default register)","schema":{"type":"string"}}]}},"/api/v1/domains/purchase":{"post":{"operationId":"post_domains_purchase","tags":["Domains"],"summary":"Purchase a new domain.","description":"Purchase a new domain. Owner or admin with the payment settings permission.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"domain\", \"order_id\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name"},"years":{"type":"number","description":"Registration period"},"registrant_id":{"type":"string","format":"uuid","description":"Domain registrant profile ID"}},"required":["domain","years","registrant_id"]}}}}}},"/api/v1/domains/claim":{"post":{"operationId":"post_domains_claim","tags":["Domains"],"summary":"HyppoAI support only (signed-in staff session).","description":"HyppoAI support only (signed-in staff session). Links a domain HyppoCRM already holds to this workspace. Tenants and API keys get 403.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name"},"registrant_id":{"type":"string","format":"uuid","description":"Domain registrant profile ID"}},"required":["domain","registrant_id"]}}}}}},"/api/v1/domains/transfer-in":{"post":{"operationId":"post_domains_transfer_in","tags":["Domains"],"summary":"Transfer a domain from another registrar.","description":"Transfer a domain from another registrar. Owner or admin with the payment settings permission, and a card on file (402 otherwise).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"status\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain name"},"auth_code":{"type":"string","description":"Authorization code from current registrar"},"registrant_id":{"type":"string","format":"uuid","description":"Domain registrant profile ID"}},"required":["domain","auth_code","registrant_id"]}}}}}},"/api/v1/domains/verify":{"post":{"operationId":"post_domains_verify","tags":["Domains"],"summary":"Verify the custom domain already saved on a blog, the storefront or the client portal (owner or admin).","description":"Verify the custom domain already saved on a blog, the storefront or the client portal (owner or admin). The hostname is read from the saved setting and attached to hosting if needed. 409 when another workspace holds it, or when the hostname was used or is claimed by another workspace; if a TXT ownership record is needed, it is returned in \"proof\".","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"verified\", \"records\", \"dns\", \"vercel\", \"message\", \"proof\"? }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"blog | store | portal"},"blogId":{"type":"string","format":"uuid","description":"Required when type is blog"}},"required":["type"]}}}}}},"/api/v1/domain-registrants":{"get":{"operationId":"get_domain_registrants","tags":["Domain Registrants"],"summary":"List domain registrant profiles","description":"List domain registrant profiles","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_domain_registrants","tags":["Domain Registrants"],"summary":"Create a domain registrant profile","description":"Create a domain registrant profile","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name"},"email":{"type":"string","description":"Email"},"phone":{"type":"string","description":"Phone (E.164 format)"},"address":{"type":"object","description":"Mailing address"}},"required":["name","email","phone","address"]}}}}}},"/api/v1/domain-registrants/{id}":{"patch":{"operationId":"patch_domain_registrants_by_id","tags":["Domain Registrants"],"summary":"Update a registrant profile","description":"Update a registrant profile","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_domain_registrants_by_id","tags":["Domain Registrants"],"summary":"Delete a registrant profile","description":"Delete a registrant profile","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/shipping-rates":{"post":{"operationId":"post_shipping_rates","tags":["Shipping & Tax"],"summary":"Get real-time shipping rates from USPS, FedEx, UPS (public, CORS)","description":"Get real-time shipping rates from USPS, FedEx, UPS (public, CORS)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"provider\", \"service\", \"price\", \"delivery_days\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_address":{"type":"object","description":"Origin address"},"to_address":{"type":"object","description":"Destination address"},"parcel":{"type":"object","description":"{ length, width, height, weight }"}},"required":["from_address","to_address","parcel"]}}}}}},"/api/v1/tax-preview":{"post":{"operationId":"post_tax_preview","tags":["Shipping & Tax"],"summary":"Calculate estimated tax for purchase and rental subtotals (public, CORS)","description":"Calculate estimated tax for purchase and rental subtotals (public, CORS)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"product_tax_total\", \"rental_tax_total\", \"total_tax\", ... }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string","description":"Tenant ID or slug"},"product_subtotal_cents":{"type":"number","description":"Product subtotal"},"rental_subtotal_cents":{"type":"number","description":"Rental subtotal"},"address":{"type":"object","description":"Customer billing address"}},"required":["tenant_id"]}}}}}},"/api/v1/tax-report":{"get":{"operationId":"get_tax_report","tags":["Shipping & Tax"],"summary":"Download tax report as CSV","description":"Download tax report as CSV","responses":{"200":{"description":"Success","content":{"application/json":{"example":"CSV file"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"start_date","in":"query","required":true,"description":"Range start (YYYY-MM-DD)","schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":true,"description":"Range end (YYYY-MM-DD)","schema":{"type":"string","format":"date"}}]}},"/api/v1/tenant/switch":{"post":{"operationId":"post_tenant_switch","tags":["Tenant"],"summary":"Switch active tenant (for users with multiple memberships)","description":"Switch active tenant (for users with multiple memberships)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"tenant_id\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string","format":"uuid","description":"Target tenant ID"}},"required":["tenant_id"]}}}}},"delete":{"operationId":"delete_tenant_switch","tags":["Tenant"],"summary":"Clear the tenant-switch cookie and revert to default","description":"Clear the tenant-switch cookie and revert to default","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/work-orders":{"get":{"operationId":"get_work_orders","tags":["Work Orders"],"summary":"Field-service work orders: the recurring job a route trade (pest control, HVAC, lawn) schedules again and again.","description":"Field-service work orders: the recurring job a route trade (pest control, HVAC, lawn) schedules again and again. Includes line items and the contact. Scope: work_orders:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"title\", \"status\", \"next_due_at\", \"work_order_line_items\": [...], \"contact\": { ... } }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"active, paused, completed or cancelled","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"One customer's work orders","schema":{"type":"string","format":"uuid"}},{"name":"assigned_user_id","in":"query","required":false,"description":"One technician's work orders","schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["w","k_","ders:read"]},"post":{"operationId":"post_work_orders","tags":["Work Orders"],"summary":"Create a work order, with optional line items.","description":"Create a work order, with optional line items. next_due_at is worked out from recurrence_rule. Scope: work_orders:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...work order with line items } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["w","k_","ders:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"e.g. \"Quarterly Pest Service\""},"contact_id":{"type":"string","format":"uuid","description":"The customer"},"service_type":{"type":"string","description":"Free text, e.g. pest_control (filters job_completed automations)"},"status":{"type":"string","description":"active (default), paused, completed, cancelled"},"address_line1, city, state, postal_code":{"type":"string","description":"Service address"},"lat, lng":{"type":"number","description":"For the dispatch map"},"price":{"type":"number","description":"Price per visit"},"billing_interval":{"type":"string","description":"e.g. monthly, quarterly"},"recurrence_rule":{"type":"object","description":"Omit for a one-off job. { \"freq\": \"weekly\" | \"monthly\", \"interval\": N (3 = quarterly), \"anchor\": \"week_of_month\" | \"day_of_week\" | \"day_of_month\", \"byday\": \"2SU\" (2nd Sunday; -1FR = last Friday; \"WE\" for day_of_week), \"bymonthday\": 1..31 or -1 (last day) }. Examples: monthly + week_of_month + 2SU = 2nd Sunday of each month; weekly + day_of_week + WE + interval 2 = every other Wednesday; monthly + day_of_month + -1 = last day of the month."},"next_due_at":{"type":"string","format":"date-time","description":"Computed from recurrence_rule unless you send it"},"auto_invoice_on_complete":{"type":"boolean","description":"Default true: completing a visit builds an invoice from the line items"},"invoice_auto_send":{"type":"boolean","description":"Default true: also email that invoice with a pay link (false leaves a draft)"},"line_items":{"type":"array","items":{"type":"object"},"description":"[{ \"description\", \"quantity\", \"unit_price\" }]"}},"required":["title"]}}}}}},"/api/v1/work-orders/{id}":{"get":{"operationId":"get_work_orders_by_id","tags":["Work Orders"],"summary":"One work order with line items, contact and company.","description":"One work order with line items, contact and company. Scope: work_orders:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["w","k_","ders:read"]},"patch":{"operationId":"patch_work_orders_by_id","tags":["Work Orders"],"summary":"Change any of the create fields.","description":"Change any of the create fields. Sending line_items replaces the whole set; leave it out to keep them. Changing recurrence_rule recomputes next_due_at. Scope: work_orders:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["w","k_","ders:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"e.g. \"Quarterly Pest Service\""},"contact_id":{"type":"string","format":"uuid","description":"The customer"},"service_type":{"type":"string","description":"Free text, e.g. pest_control (filters job_completed automations)"},"status":{"type":"string","description":"active (default), paused, completed, cancelled"},"address_line1, city, state, postal_code":{"type":"string","description":"Service address"},"lat, lng":{"type":"number","description":"For the dispatch map"},"price":{"type":"number","description":"Price per visit"},"billing_interval":{"type":"string","description":"e.g. monthly, quarterly"},"recurrence_rule":{"type":"object","description":"Omit for a one-off job. { \"freq\": \"weekly\" | \"monthly\", \"interval\": N (3 = quarterly), \"anchor\": \"week_of_month\" | \"day_of_week\" | \"day_of_month\", \"byday\": \"2SU\" (2nd Sunday; -1FR = last Friday; \"WE\" for day_of_week), \"bymonthday\": 1..31 or -1 (last day) }. Examples: monthly + week_of_month + 2SU = 2nd Sunday of each month; weekly + day_of_week + WE + interval 2 = every other Wednesday; monthly + day_of_month + -1 = last day of the month."},"next_due_at":{"type":"string","format":"date-time","description":"Computed from recurrence_rule unless you send it"},"auto_invoice_on_complete":{"type":"boolean","description":"Default true: completing a visit builds an invoice from the line items"},"invoice_auto_send":{"type":"boolean","description":"Default true: also email that invoice with a pay link (false leaves a draft)"},"line_items":{"type":"array","items":{"type":"object"},"description":"[{ \"description\", \"quantity\", \"unit_price\" }]"}}}}}}},"delete":{"operationId":"delete_work_orders_by_id","tags":["Work Orders"],"summary":"Delete a work order and its line items.","description":"Delete a work order and its line items. Scope: work_orders:delete.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["w","k_","ders:delete"]}},"/api/v1/work-orders/{id}/complete":{"post":{"operationId":"post_work_orders_by_id_complete","tags":["Work Orders"],"summary":"Close out a visit.","description":"Close out a visit. This stamps last_serviced_at and moves next_due_at on by the recurrence rule, and marks the appointment completed with the check-out time and place. If the work order has auto_invoice_on_complete on (the default), it creates a draft invoice from the line items, due in 14 days, for someone to review and send. It never invoices one visit twice. It also fires the job_completed automation trigger. Scope: work_orders:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"work_order_id\", \"next_due_at\", \"invoice\": { \"invoice_id\", \"sent\": false }, \"run_ids\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["w","k_","ders:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"appointment_id":{"type":"string","format":"uuid","description":"The calendar visit to mark completed"},"serviced_at":{"type":"string","format":"date-time","description":"Defaults to now"},"check_out_lat, check_out_lng":{"type":"number","description":"Where the technician checked out"},"log_visit":{"type":"boolean","description":"With no appointment_id: first log this service as a visit at next_due_at, as the website does for a recurring job"}}}}}}}},"/api/v1/meeting-transcripts":{"get":{"operationId":"get_meeting_transcripts","tags":["Meeting Transcripts"],"summary":"A contact's Google Meet transcripts, newest call first.","description":"A contact's Google Meet transcripts, newest call first. Read-only: transcripts arrive automatically from Meet and are never written over the API. They need their own scope (not contacts:read) because a full call transcript is more sensitive than contact fields. content can be long, so for a pre-meeting brief ask for limit=1 or 2. Scope: meeting_transcripts:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"contact_id\", \"appointment_id\", \"title\", \"category\", \"tags\", \"meeting_code\", \"language\", \"content\", \"started_at\", \"ended_at\", \"source\": \"meet_api | drive_import\", \"created_at\" }], \"meta\": { \"contact_id\", \"count\", \"limit\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"contact_id","in":"query","required":true,"description":"The contact (400 without it)","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Default 5, max 50","schema":{"type":"number"}}],"x-scopes":["meeting_transcripts:read"]}},"/api/v1/payments":{"get":{"operationId":"get_payments","tags":["Payments"],"summary":"Every payment the CRM recorded: card, ACH, terminal, subscription renewals, refunds and disputes, plus income recorded b","description":"Every payment the CRM recorded: card, ACH, terminal, subscription renewals, refunds and disputes, plus income recorded by hand. Amounts are in cents. Built for polling: pass since to get only what changed. Scope: payments:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"amount\", \"currency\", \"status\", \"method\", \"contact_id\", \"invoice_id\", \"created_at\", ... }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"succeeded, failed, refunded, pending ...","schema":{"type":"string"}},{"name":"method","in":"query","required":false,"description":"card, ach, pos, cash ...","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"One customer","schema":{"type":"string","format":"uuid"}},{"name":"since","in":"query","required":false,"description":"Only payments created after this time","schema":{"type":"string","format":"date-time"}}],"x-scopes":["payments:read"]}},"/api/v1/subscriptions":{"get":{"operationId":"get_subscriptions","tags":["Payments"],"summary":"Recurring subscriptions, most recently changed first.","description":"Recurring subscriptions, most recently changed first. status (active, past_due, trialing, cancelled) follows Stripe and Square, so polling with since shows a renewal going past_due or a cancellation. Amounts are in cents. Scope: subscriptions:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"contact_id\", \"status\", \"amount\", ..., \"updated_at\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"active, past_due, trialing or cancelled","schema":{"type":"string"}},{"name":"contact_id","in":"query","required":false,"description":"One customer","schema":{"type":"string","format":"uuid"}},{"name":"since","in":"query","required":false,"description":"Only subscriptions changed after this time","schema":{"type":"string","format":"date-time"}}],"x-scopes":["subscriptions:read"]}},"/api/v1/billing-templates":{"get":{"operationId":"get_billing_templates","tags":["Billing Templates"],"summary":"Saved starting points for invoices, estimates and recurring invoices: line items plus defaults (tax, discount, terms, de","description":"Saved starting points for invoices, estimates and recurring invoices: line items plus defaults (tax, discount, terms, deposit, agreement, payment plan). A template is authorized as the document it makes: invoice and recurring templates need invoices scopes, estimate templates need estimates scopes. Without doc_type you get every type you may read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"doc_type\", \"name\", \"description\", \"line_items\", \"defaults\", \"sort_order\", \"is_active\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"doc_type","in":"query","required":false,"description":"invoice, estimate or recurring_invoice","schema":{"type":"string"}},{"name":"include_archived","in":"query","required":false,"description":"true to include archived ones","schema":{"type":"boolean"}},{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}]},"post":{"operationId":"post_billing_templates","tags":["Billing Templates"],"summary":"Save a template.","description":"Save a template. Scope: invoices:write, or estimates:write for an estimate template.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["invoices:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"doc_type":{"type":"string","description":"invoice, estimate or recurring_invoice"},"name":{"type":"string","description":"Template name"},"line_items":{"type":"array","items":{"type":"object"},"description":"At least one line, in the same shape as that document’s line items"},"description":{"type":"string","description":"Notes for your team"},"defaults":{"type":"object","description":"Defaults for that document type, e.g. { \"tax_rate\": 0.07, \"due_in_days\": 15, \"terms_conditions\": \"...\" }"},"sort_order":{"type":"number","description":"Order in the picker"}},"required":["doc_type","name","line_items"]}}}}}},"/api/v1/billing-templates/{id}":{"get":{"operationId":"get_billing_templates_by_id","tags":["Billing Templates"],"summary":"One template.","description":"One template. Needs the read scope for its document type.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_billing_templates_by_id","tags":["Billing Templates"],"summary":"Change a template.","description":"Change a template. Needs the write scope for its document type.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name"},"description":{"type":"string","description":"Description"},"line_items":{"type":"array","items":{"type":"object"},"description":"Replace the lines"},"defaults":{"type":"object","description":"Replace the defaults"},"sort_order":{"type":"number","description":"Order"},"is_active":{"type":"boolean","description":"false archives it"}}}}}}},"delete":{"operationId":"delete_billing_templates_by_id","tags":["Billing Templates"],"summary":"Archive a template (as the dashboard does); documents made from it are untouched.","description":"Archive a template (as the dashboard does); documents made from it are untouched. Needs the write scope for its document type.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"is_active\": false } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/booking":{"post":{"operationId":"post_booking","tags":["Booking"],"summary":"Create a booking calendar (a bookable page with its own slots).","description":"Create a booking calendar (a bookable page with its own slots). If one with the same slug exists it is returned instead (200). Scope: calendar:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["calendar:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"e.g. \"Website Consultation\""},"slug":{"type":"string","description":"URL name; made from the name if omitted"},"description":{"type":"string","description":"Shown on the booking page"},"duration_min":{"type":"number","description":"Appointment length in minutes"},"location":{"type":"string","description":"Where it happens"},"round_robin":{"type":"boolean","description":"Share bookings across the team"}},"required":["name"]}}}}}},"/api/v1/booking/{id}/slots":{"get":{"operationId":"get_booking_by_id_slots","tags":["Booking"],"summary":"Open times on one day, after working hours, overrides and existing appointments.","description":"Open times on one day, after working hours, overrides and existing appointments. Scope: booking:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"time\": \"09:00\", \"startAtUtc\", \"availableMembers\": [...], \"spotsRemaining\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"description":"YYYY-MM-DD","schema":{"type":"string","format":"date"}}],"x-scopes":["booking:read"]}},"/api/v1/booking/{id}/book":{"post":{"operationId":"post_booking_by_id_book","tags":["Booking"],"summary":"Book an open slot for someone.","description":"Book an open slot for someone. Creates or matches the contact and runs the same confirmations and automations as the public booking page. Scope: booking:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...the booking } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["booking:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"YYYY-MM-DD"},"time":{"type":"string","description":"HH:MM, one of the open slots"},"bookerName":{"type":"string","description":"Their name"},"bookerEmail":{"type":"string","description":"Their email"},"bookerPhone":{"type":"string","description":"Their phone"},"notes":{"type":"string","description":"Anything they said"}},"required":["date","time","bookerName","bookerEmail"]}}}}}},"/api/v1/booking/{id}/overrides":{"get":{"operationId":"get_booking_by_id_overrides","tags":["Booking"],"summary":"One-off date changes for a booking calendar: days off and extra hours.","description":"One-off date changes for a booking calendar: days off and extra hours. Scope: calendar:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"kind\", \"date\", \"end_date\", \"start_time\", \"end_time\", \"label\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string","format":"date"}}],"x-scopes":["calendar:read"]},"post":{"operationId":"post_booking_by_id_overrides","tags":["Booking"],"summary":"Add a day off or extra hours, e.g.","description":"Add a day off or extra hours, e.g. \"open at 1pm on the 13th\". Scope: calendar:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["calendar:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","description":"closed (no bookings) or open (extra hours)"},"date":{"type":"string","format":"date","description":"YYYY-MM-DD"},"end_date":{"type":"string","format":"date","description":"For a range of days"},"start_time":{"type":"string","description":"HH:MM, for open"},"end_time":{"type":"string","description":"HH:MM, for open"},"label":{"type":"string","description":"e.g. \"Holiday\""}},"required":["kind","date"]}}}}},"delete":{"operationId":"delete_booking_by_id_overrides","tags":["Booking"],"summary":"Remove one override.","description":"Remove one override. Scope: calendar:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"override_id","in":"query","required":true,"description":"The override","schema":{"type":"string","format":"uuid"}}],"x-scopes":["calendar:write"]}},"/api/v1/email-campaigns":{"get":{"operationId":"get_email_campaigns","tags":["Campaigns"],"summary":"Email campaigns, newest first.","description":"Email campaigns, newest first. Scope: campaigns:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"subject\", \"status\", ... }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["campaigns:read"]},"post":{"operationId":"post_email_campaigns","tags":["Campaigns"],"summary":"Create an email campaign as a draft.","description":"Create an email campaign as a draft. Nothing is sent until you call send. Scope: campaigns:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"draft\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["campaigns:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Internal name"},"subject":{"type":"string","description":"Subject line"},"body":{"type":"string","description":"Email body (HTML allowed)"},"recipient_filter":{"type":"object","description":"Who gets it: { \"contactIds\": [...] } for a fixed list, or { \"search\", \"status\", \"tag\" } to match contacts. Add \"requireSmsOptIn\": true to send only to contacts with a live marketing text (A2P) opt-in at least 10 days old; a text STOP takes them off the next send. Opt-outs and the Do Not Call list are always removed."},"from_domain":{"type":"string","description":"Send this campaign from one of your verified sending domains (Settings → Email Domains), e.g. \"example.com\", instead of the workspace default. Tracking and unsubscribe links use that domain's link host when it has one. A domain that is not verified returns 400 listing the ones that are."},"sender_domain_id":{"type":"string","format":"uuid","description":"Same as from_domain, by the email domain id. If you pass both, they must name the same domain. If the domain stops being verified before the send, the send is refused rather than sent from another domain."}},"required":["name","subject","body"]}}}}}},"/api/v1/email-campaigns/{id}":{"get":{"operationId":"get_email_campaigns_by_id","tags":["Campaigns"],"summary":"One email campaign with its counts.","description":"One email campaign with its counts. Scope: campaigns:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["campaigns:read"]}},"/api/v1/email-campaigns/{id}/send":{"post":{"operationId":"post_email_campaigns_by_id_send","tags":["Campaigns"],"summary":"Send a draft email campaign.","description":"Send a draft email campaign. Opt-outs and the Do Not Call list are removed, and each email gets tracking and a one-click unsubscribe. Only a draft sends, so a retry cannot send twice. Refused with a 400 when it falls inside this workspace's minimum gap between marketing campaigns (24h by default), or while another campaign is being sent. The error names that campaign and when the next send is available, so do not loop on it. An API key cannot skip the gap: only someone signed in can, from the Marketing page. Scope: campaigns:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (202)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["campaigns:write"]}},"/api/v1/sms-campaigns":{"get":{"operationId":"get_sms_campaigns","tags":["Campaigns"],"summary":"SMS campaigns, newest first.","description":"SMS campaigns, newest first. Scope: campaigns:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"status\", ... }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}}],"x-scopes":["campaigns:read"]},"post":{"operationId":"post_sms_campaigns","tags":["Campaigns"],"summary":"Create an SMS campaign as a draft.","description":"Create an SMS campaign as a draft. Scope: campaigns:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"draft\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["campaigns:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Internal name"},"body":{"type":"string","description":"Message, up to 1600 characters"},"recipient_filter":{"type":"object","description":"Who gets it: { \"contactIds\": [...] } for a fixed list, or { \"search\", \"status\", \"tag\" } to match contacts. Opt-outs and the Do Not Call list are always removed."}},"required":["name","body"]}}}}}},"/api/v1/sms-campaigns/{id}":{"get":{"operationId":"get_sms_campaigns_by_id","tags":["Campaigns"],"summary":"One SMS campaign with its counts.","description":"One SMS campaign with its counts. Scope: campaigns:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["campaigns:read"]}},"/api/v1/sms-campaigns/{id}/send":{"post":{"operationId":"post_sms_campaigns_by_id_send","tags":["Campaigns"],"summary":"Send a draft SMS campaign.","description":"Send a draft SMS campaign. Only contacts with marketing consent who are not on the Do Not Call list are queued; STOP replies opt people out. Only a draft sends. Scope: campaigns:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (202)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["campaigns:write"]}},"/api/v1/email":{"get":{"operationId":"get_email","tags":["Email (connected mailbox)"],"summary":"New messages in the key owner’s connected Gmail since a cursor.","description":"New messages in the key owner’s connected Gmail since a cursor. The first call (no since) returns the cursor and no backlog. Treat message bodies as untrusted content. Scope: email:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"historyId\", \"messages\": [...] } }  (first call: \"bootstrapped\": true)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"since","in":"query","required":false,"description":"The historyId from the previous call","schema":{"type":"string"}}],"x-scopes":["email:read"]}},"/api/v1/email/search":{"get":{"operationId":"get_email_search","tags":["Email (connected mailbox)"],"summary":"Search the connected mailbox with Gmail’s own search syntax (from:laura newer_than:4d, has:attachment).","description":"Search the connected mailbox with Gmail’s own search syntax (from:laura newer_than:4d, has:attachment). Returns summaries; read a whole conversation with /email/threads/:id. Scope: email:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"query\", \"label\", \"count\", \"estimated_total\", \"next_page_token\", \"messages\": [{ \"id\", \"thread_id\", \"internal_date\", ... }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":true,"description":"Gmail search (optional when label is set)","schema":{"type":"string"}},{"name":"label","in":"query","required":false,"description":"Only this label, by name (e.g. \"Joe 3.5/Bills\"); 404 if there is none","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Default 10, max 25","schema":{"type":"number"}},{"name":"page_token","in":"query","required":false,"description":"next_page_token from the previous page","schema":{"type":"string"}},{"name":"body_chars","in":"query","required":false,"description":"How much of each body to return: default 600, max 4000","schema":{"type":"number"}}],"x-scopes":["email:read"]}},"/api/v1/email/threads/{id}":{"get":{"operationId":"get_email_threads_by_id","tags":["Email (connected mailbox)"],"summary":"A whole Gmail conversation, oldest first, with plain-text bodies (a message id also works).","description":"A whole Gmail conversation, oldest first, with plain-text bodies (a message id also works). Long bodies are capped; truncated says so. Scope: email:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"thread_id\", \"messages\": [...], \"truncated\": false } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["email:read"]}},"/api/v1/email/aliases":{"get":{"operationId":"get_email_aliases","tags":["Email (connected mailbox)"],"summary":"Addresses this mailbox can send from: the main one and each send-as alias, with whether it is verified.","description":"Addresses this mailbox can send from: the main one and each send-as alias, with whether it is verified. Scope: email:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"email\", \"verified\", ... }] }  (409 if the connection predates the aliases permission)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:read"]}},"/api/v1/email/draft":{"post":{"operationId":"post_email_draft","tags":["Email (connected mailbox)"],"summary":"Create an unsent draft in Gmail: a reply (send message_id) or a new email (send to and subject).","description":"Create an unsent draft in Gmail: a reply (send message_id) or a new email (send to and subject). It never sends; a person sends it from Gmail. Scope: email:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"draft_id\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"The text"},"message_id":{"type":"string","description":"Reply to this message (in its thread)"},"to":{"type":"string","description":"New email: recipient"},"subject":{"type":"string","description":"New email: subject"},"from":{"type":"string","description":"Send-as alias (see /email/aliases)"}},"required":["body"]}}}}}},"/api/v1/email/drafts":{"get":{"operationId":"get_email_drafts","tags":["Email (connected mailbox)"],"summary":"Drafts in the connected mailbox.","description":"Drafts in the connected mailbox. With q, matching drafts come back with their full body. Scope: email:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...drafts ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":false,"description":"Filter by recipient, subject or text","schema":{"type":"string"}}],"x-scopes":["email:read"]},"patch":{"operationId":"patch_email_drafts","tags":["Email (connected mailbox)"],"summary":"Rewrite one draft in place: same thread, recipient and subject, new body.","description":"Rewrite one draft in place: same thread, recipient and subject, new body. Scope: email:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"draft_id\", \"thread_id\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draft_id":{"type":"string","description":"The draft"},"body":{"type":"string","description":"New text"}},"required":["draft_id","body"]}}}}},"delete":{"operationId":"delete_email_drafts","tags":["Email (connected mailbox)"],"summary":"Delete drafts.","description":"Delete drafts. Only drafts: sent and received mail can never be touched here. Scope: email:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\", \"failed\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draft_id":{"type":"string","description":"One draft, or send draft_ids for several"}},"required":["draft_id"]}}}}}},"/api/v1/email/notify-self":{"post":{"operationId":"post_email_notify_self","tags":["Email (connected mailbox)"],"summary":"Email the key's owner from their own connected Gmail: it goes to that mailbox's address and nowhere else (the recipient ","description":"Email the key's owner from their own connected Gmail: it goes to that mailbox's address and nowhere else (the recipient is never taken from the request). Shows as unread in their inbox. For agents reporting to the person who made the key. Scope: email:notify_self (email:write does not include it).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"to\" } }  (201; 409 if Gmail isn't connected)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:notify_self"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"Up to 200 characters, one line"},"text":{"type":"string","description":"Plain-text body"},"html":{"type":"string","description":"HTML body, sent alongside the text"}},"required":["subject","text"]}}}}}},"/api/v1/email/labels":{"post":{"operationId":"post_email_labels","tags":["Email (connected mailbox)"],"summary":"Sort mail in the connected mailbox: put labels under an agent folder (\"Joe 3.5/Bills\") on up to 1000 messages and mark t","description":"Sort mail in the connected mailbox: put labels under an agent folder (\"Joe 3.5/Bills\") on up to 1000 messages and mark them read or unread. Missing folder labels are created. Only those labels and UNREAD can change: never INBOX, TRASH, SPAM, IMPORTANT, STARRED, categories or the owner's own labels, so nothing is archived, deleted or sent. Undo by swapping add and remove. Scope: email:label (email:write does not include it).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"modified\", \"added\", \"removed\", \"created\" } }  (400 names a refused label; 409 if Gmail isn't connected)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["email:label"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message_ids":{"type":"array","items":{"type":"string"},"description":"Gmail message ids, up to 1000"},"add":{"type":"array","items":{"type":"string"},"description":"\"UNREAD\" (mark unread) or labels like \"Joe 3.5/Bills\""},"remove":{"type":"array","items":{"type":"string"},"description":"\"UNREAD\" (mark read) or labels under \"Joe 3.5/\""}},"required":["message_ids"]}}}}}},"/api/v1/drive/files":{"get":{"operationId":"get_drive_files","tags":["Google Drive"],"summary":"Search the key owner’s connected Google Drive with Drive’s query syntax (name contains 'proposal', fullText contains 'es","description":"Search the key owner’s connected Google Drive with Drive’s query syntax (name contains 'proposal', fullText contains 'estimate'). Trashed files never appear. Read-only. Scope: drive:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"files\": [...], \"nextPageToken\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":false,"description":"Drive query","schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"description":"Files per page","schema":{"type":"number"}},{"name":"pageToken","in":"query","required":false,"description":"From the previous page","schema":{"type":"string"}}],"x-scopes":["drive:read"]}},"/api/v1/drive/files/{id}/content":{"get":{"operationId":"get_drive_files_by_id_content","tags":["Google Drive"],"summary":"A file’s content.","description":"A file’s content. Google Docs, Sheets and Slides are exported to the format you ask for; other files download as they are. Text formats come back as JSON; binary formats as the file. Scope: drive:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...text content } }  (binary formats: the file itself)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"as","in":"query","required":false,"description":"md, text, pdf, html, zip or raw","schema":{"type":"string"}}],"x-scopes":["drive:read"]}},"/api/v1/frame/dictionaries":{"get":{"operationId":"get_frame_dictionaries","tags":["Frame — Dictionaries"],"summary":"Custom word lists that help captions spell names, brands and jargon right.","description":"Custom word lists that help captions spell names, brands and jargon right. Scope: frame:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"terms\", \"created_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["frame:read"]},"post":{"operationId":"post_frame_dictionaries","tags":["Frame — Dictionaries"],"summary":"Create a word list.","description":"Create a word list. Scope: frame:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["frame:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"List name"},"terms":{"type":"array","items":{"type":"string"},"description":"Words and phrases"}},"required":["name","terms"]}}}}}},"/api/v1/frame/dictionaries/{id}":{"patch":{"operationId":"patch_frame_dictionaries_by_id","tags":["Frame — Dictionaries"],"summary":"Rename a list or replace its words.","description":"Rename a list or replace its words. Scope: frame:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["frame:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"List name"},"terms":{"type":"array","items":{"type":"string"},"description":"Replace the words"}}}}}}},"delete":{"operationId":"delete_frame_dictionaries_by_id","tags":["Frame — Dictionaries"],"summary":"Delete a word list.","description":"Delete a word list. Scope: frame:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["frame:write"]}},"/api/v1/funnels":{"get":{"operationId":"get_funnels","tags":["Funnels"],"summary":"The workspace’s funnels, newest first, each with its number of steps.","description":"The workspace’s funnels, newest first, each with its number of steps. Archived funnels are left out unless you ask for status=archived, as on the Funnels page. API keys are allowed. Scope: funnels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"status\", \"created_at\", \"updated_at\", \"step_count\" }], \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 50, max 100)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"draft, published or archived","schema":{"type":"string"}}],"x-scopes":["funnels:read"]},"post":{"operationId":"post_funnels","tags":["Funnels"],"summary":"Create an empty funnel, as a draft.","description":"Create an empty funnel, as a draft. Add its steps with POST /funnels/:id/steps, then POST /funnels/:id/publish to put it live. 409 when the slug is taken. Scope: funnels:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"status\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["funnels:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Up to 120 characters"},"slug":{"type":"string","description":"Its address: /fn/<workspace>/<slug>"},"description":{"type":"string","description":"Up to 500 characters"},"pixel_id":{"type":"string","format":"uuid","description":"One of your tracking pixels"},"meta_pixel_id":{"type":"string","description":"A Meta pixel id, digits only"}},"required":["name","slug"]}}}}}},"/api/v1/funnels/{id}":{"get":{"operationId":"get_funnels_by_id","tags":["Funnels"],"summary":"One funnel and its steps in order, each with the URL it is served at once published.","description":"One funnel and its steps in order, each with the URL it is served at once published. Scope: funnels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"status\", \"publish_version\", ..., \"steps\": [{ \"id\", \"name\", \"slug\", \"kind\", \"position\", \"template_key\", \"url\", ... }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:read"]},"patch":{"operationId":"patch_funnels_by_id","tags":["Funnels"],"summary":"Rename a funnel or change its pixels.","description":"Rename a funnel or change its pixels. Publishing is POST /funnels/:id/publish. Scope: funnels:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name"},"description":{"type":"string","description":"Description"},"pixel_id":{"type":"string","format":"uuid","description":"One of your tracking pixels, or null"},"meta_pixel_id":{"type":"string","description":"A Meta pixel id, or null"}}}}}}}},"/api/v1/funnels/{id}/steps":{"post":{"operationId":"post_funnels_by_id_steps","tags":["Funnels"],"summary":"Add a step, last unless you give a position.","description":"Add a step, last unless you give a position. A page takes the finished page as html (a full HTML document; host its images with the media API and use their URLs), a platform template as template_key + content, or a page hosted elsewhere as live_url. In html, {{next_url}} becomes the next step's address and any other {{word}} is blanked at publish. The tracking pixel and UTM forwarding are added at publish. Pages run sandboxed: scripts and forms work, cookies and localStorage do not. Booking steps need booking_calendar_id, form steps form_id, external steps external_url. Nothing is live until the next publish. Scope: funnels:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"kind\", \"position\", \"template_key\", ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Step name"},"slug":{"type":"string","description":"Its address within the funnel; fixed once created"},"kind":{"type":"string","description":"page (default), booking, form or external"},"html":{"type":"string","description":"The whole page, up to 3 MB (page steps)"},"template_key":{"type":"string","description":"A platform template, instead of html"},"content":{"type":"object","description":"The template's fields"},"live_url":{"type":"string","description":"Send visitors to a page hosted elsewhere"},"booking_calendar_id":{"type":"string","format":"uuid","description":"Booking steps"},"form_id":{"type":"string","format":"uuid","description":"Form steps"},"external_url":{"type":"string","description":"External steps"},"position":{"type":"integer","description":"0-based place in the funnel"}},"required":["name","slug"]}}}}}},"/api/v1/funnels/{id}/steps/{stepId}":{"patch":{"operationId":"patch_funnels_by_id_steps_by_stepId","tags":["Funnels"],"summary":"Edit a step.","description":"Edit a step. html replaces the page. Live on the next publish. Scope: funnels:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Step name"},"html":{"type":"string","description":"The whole page (page steps)"},"template_key":{"type":"string","description":"Switch to a platform template"},"content":{"type":"object","description":"The template's fields"},"live_url":{"type":"string","description":"Page hosted elsewhere, or null"},"position":{"type":"integer","description":"0-based place in the funnel"}}}}}}},"delete":{"operationId":"delete_funnels_by_id_steps_by_stepId","tags":["Funnels"],"summary":"Remove a step and the page html it was given.","description":"Remove a step and the page html it was given. Scope: funnels:delete.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:delete"]}},"/api/v1/funnels/{id}/publish":{"post":{"operationId":"post_funnels_by_id_publish","tags":["Funnels"],"summary":"The dashboard's Publish button: renders every page step, wires each booking step to the next one, and puts the funnel li","description":"The dashboard's Publish button: renders every page step, wires each booking step to the next one, and puts the funnel live. Run it after every page change; pages can take up to a minute to refresh everywhere. A calendar already sending bookers elsewhere is left alone and listed in redirect_conflicts. Scope: funnels:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"pages_rendered\", \"redirect_conflicts\": [{ \"calendar\", \"current\", \"wanted\" }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:update"]}},"/api/v1/funnels/{id}/changes":{"get":{"operationId":"get_funnels_by_id_changes","tags":["Funnels"],"summary":"The funnel’s change log (its Changes tab): its own entries plus those of its pixel and the calendars its steps book into","description":"The funnel’s change log (its Changes tab): its own entries plus those of its pixel and the calendars its steps book into, newest first. Lets you line changes up against the numbers. Scope: funnels:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"occurred_at\", \"category\", \"title\", \"detail\", \"step_key\", \"affects_numbers\", \"source\", \"ref\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Default 200, max 500","schema":{"type":"number"}}],"x-scopes":["funnels:read"]},"post":{"operationId":"post_funnels_by_id_changes","tags":["Funnels"],"summary":"Log a change to the funnel, e.g.","description":"Log a change to the funnel, e.g. from a deploy script or an ad tool, so nobody has to open the dashboard. Entries made with a key are marked source \"api\". Scope: funnels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"What changed, up to 200 characters"},"category":{"type":"string","description":"page, copy, design, calendar, tracking, ads, automation, offer, fix or other (default)"},"detail":{"type":"string","description":"More detail"},"occurred_at":{"type":"string","format":"date-time","description":"When (default now)"},"step_key":{"type":"string","description":"Which step"},"affects_numbers":{"type":"boolean","description":"Flag it on the funnel’s charts"},"ref":{"type":"string","description":"A commit, ticket or URL"}},"required":["title"]}}}}}},"/api/v1/funnels/{id}/changes/{changeId}":{"patch":{"operationId":"patch_funnels_by_id_changes_by_changeId","tags":["Funnels"],"summary":"Edit one change-log entry.","description":"Edit one change-log entry. Scope: funnels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Title"},"category":{"type":"string","description":"Category"},"detail":{"type":"string","description":"Detail"},"occurred_at":{"type":"string","format":"date-time","description":"When"},"step_key":{"type":"string","description":"Step"},"affects_numbers":{"type":"boolean","description":"Flag"},"ref":{"type":"string","description":"Reference"}}}}}}},"delete":{"operationId":"delete_funnels_by_id_changes_by_changeId","tags":["Funnels"],"summary":"Remove one change-log entry.","description":"Remove one change-log entry. Scope: funnels:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["funnels:write"]}},"/api/v1/pay-periods/current":{"get":{"operationId":"get_pay_periods_current","tags":["Pay Periods"],"summary":"The one call to make on a schedule: the open period, its deadlines, who has not filed, and payday.","description":"The one call to make on a schedule: the open period, its deadlines, who has not filed, and payday. Dollar figures need the view_revenue permission. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...the open period, its deadlines, payday, who has not filed } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"user_id","in":"query","required":false,"description":"Answer for this person’s schedule (default: yours, then the workspace default)","schema":{"type":"string","format":"uuid"}}],"x-scopes":["pay_periods:read"]}},"/api/v1/pay-periods":{"get":{"operationId":"get_pay_periods","tags":["Pay Periods"],"summary":"Pay periods, newest first.","description":"Pay periods, newest first. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...periods ], \"meta\": { \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"open, closed or paid","schema":{"type":"string"}},{"name":"schedule_id","in":"query","required":false,"description":"One pay schedule","schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"description":"Periods ending on or after","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Periods starting on or before","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","required":false,"description":"How many","schema":{"type":"number"}}],"x-scopes":["pay_periods:read"]}},"/api/v1/pay-periods/{id}":{"get":{"operationId":"get_pay_periods_by_id","tags":["Pay Periods"],"summary":"One pay period.","description":"One pay period. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:read"]},"patch":{"operationId":"patch_pay_periods_by_id","tags":["Pay Periods"],"summary":"Move one period’s deadlines or payday, e.g.","description":"Move one period’s deadlines or payday, e.g. for a holiday week. Scope: pay_periods:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"submit_deadline_at":{"type":"string","format":"date-time","description":"When hours are due"},"approve_deadline_at":{"type":"string","format":"date-time","description":"When approvals are due"},"payday_observed_on":{"type":"string","format":"date","description":"YYYY-MM-DD"}}}}}}}},"/api/v1/pay-periods/{id}/summary":{"get":{"operationId":"get_pay_periods_by_id_summary","tags":["Pay Periods"],"summary":"Everything payroll needs for one period: hours and cost per person, what is still pending, unattributed time, and who fi","description":"Everything payroll needs for one period: hours and cost per person, what is still pending, unattributed time, and who filed nothing. Dollar figures need view_revenue; the whole-team roll-up is owners and admins only. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...per-person hours and cost, pending, unattributed, not filed } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:read"]}},"/api/v1/pay-periods/{id}/approve-all":{"post":{"operationId":"post_pay_periods_by_id_approve_all","tags":["Pay Periods"],"summary":"Approve every entry still pending in the period, posting labour cost to the books exactly as the review screen does.","description":"Approve every entry still pending in the period, posting labour cost to the books exactly as the review screen does. Safe to retry. Scope: hours:approve.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...how many were approved } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["hours:approve"]}},"/api/v1/pay-periods/{id}/close":{"post":{"operationId":"post_pay_periods_by_id_close","tags":["Pay Periods"],"summary":"Close a period: freeze its figures.","description":"Close a period: freeze its figures. Refused while entries are pending (the error lists them) unless you send approve_pending or force. Closing a closed period returns it unchanged. Scope: pay_periods:close.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"closed\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:close"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"approve_pending":{"type":"boolean","description":"Approve pending entries first"},"force":{"type":"boolean","description":"Close even with pending entries"}}}}}}}},"/api/v1/pay-periods/{id}/mark-paid":{"post":{"operationId":"post_pay_periods_by_id_mark_paid","tags":["Pay Periods"],"summary":"Record that a closed period was paid, and how.","description":"Record that a closed period was paid, and how. No money moves: this only writes it down so the period stops showing as owed. Scope: pay_periods:close.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"paid\" }, \"meta\": { \"changed\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:close"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payroll_reference":{"type":"string","description":"e.g. \"Zelle batch 10/15\""},"paid_on":{"type":"string","format":"date","description":"YYYY-MM-DD (default today)"}},"required":["payroll_reference"]}}}}}},"/api/v1/pay-periods/{id}/reopen":{"post":{"operationId":"post_pay_periods_by_id_reopen","tags":["Pay Periods"],"summary":"Reopen a closed period, with a reason.","description":"Reopen a closed period, with a reason. Owner only, and refused once it is marked paid. Scope: pay_periods:close.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"open\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:close"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Why it is being reopened"}},"required":["reason"]}}}}}},"/api/v1/pay-schedules":{"get":{"operationId":"get_pay_schedules","tags":["Pay Periods"],"summary":"Pay schedules (weekly, biweekly, semimonthly, monthly) and their upcoming periods.","description":"Pay schedules (weekly, biweekly, semimonthly, monthly) and their upcoming periods. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...schedules ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["pay_periods:read"]},"post":{"operationId":"post_pay_schedules","tags":["Pay Periods"],"summary":"Create a pay schedule.","description":"Create a pay schedule. Scope: pay_periods:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["pay_periods:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"e.g. \"Field team\""},"anchor_period_end":{"type":"string","format":"date","description":"YYYY-MM-DD: the last day of any one period"},"frequency":{"type":"string","description":"weekly, biweekly (default), semimonthly or monthly"},"timezone":{"type":"string","description":"e.g. America/New_York"},"submit_deadline_days, submit_deadline_time":{"description":"Hours due N days after the period ends, at HH:MM"},"approve_deadline_days, approve_deadline_time":{"description":"Approvals due N days after, at HH:MM"},"payday_offset_days":{"type":"number","description":"Payday N days after the period ends"},"payday_shift":{"type":"string","description":"previous_business_day, next_business_day or none"},"auto_close":{"type":"boolean","description":"Close periods automatically"},"reminder_offsets_hours":{"type":"array","items":{"type":"number"},"description":"Reminder times relative to the deadline"}},"required":["name","anchor_period_end"]}}}}}},"/api/v1/pay-schedules/{id}":{"get":{"operationId":"get_pay_schedules_by_id","tags":["Pay Periods"],"summary":"One pay schedule.","description":"One pay schedule. Scope: pay_periods:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:read"]},"patch":{"operationId":"patch_pay_schedules_by_id","tags":["Pay Periods"],"summary":"Change a pay schedule; open periods are re-stamped with the new deadlines.","description":"Change a pay schedule; open periods are re-stamped with the new deadlines. Scope: pay_periods:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... }, \"meta\": { \"periods_restamped\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["pay_periods:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name"},"is_default":{"type":"boolean","description":"Make it the workspace default"},"anchor_period_end":{"type":"string","format":"date","description":"YYYY-MM-DD"},"submit_deadline_days, approve_deadline_days, payday_offset_days":{"type":"number","description":"Deadlines"},"auto_close":{"type":"boolean","description":"Auto close"}}}}}}}},"/api/v1/site-audit/jobs":{"get":{"operationId":"get_site_audit_jobs","tags":["Site Audit"],"summary":"Website audit videos you have requested, newest first.","description":"Website audit videos you have requested, newest first. Scope: site_audit:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...audits ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"contact_id","in":"query","required":false,"description":"One contact’s audits","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"How many","schema":{"type":"number"}}],"x-scopes":["site_audit:read"]},"post":{"operationId":"post_site_audit_jobs","tags":["Site Audit"],"summary":"Request an audit video of a website.","description":"Request an audit video of a website. It is matched to a contact by domain unless you name one. Scope: site_audit:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...the audit job } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["site_audit:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The website"},"contact_id":{"type":"string","format":"uuid","description":"The contact it is for"}},"required":["url"]}}}}}},"/api/v1/site-audit/jobs/{id}":{"get":{"operationId":"get_site_audit_jobs_by_id","tags":["Site Audit"],"summary":"One audit, with short-lived video and poster links once it is ready.","description":"One audit, with short-lived video and poster links once it is ready. Scope: site_audit:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"video_url\", \"poster_url\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["site_audit:read"]}},"/api/v1/site-audit/contacts":{"get":{"operationId":"get_site_audit_contacts","tags":["Site Audit"],"summary":"Find a contact to audit by name or email, with the website for each (their website field, or their email’s domain).","description":"Find a contact to audit by name or email, with the website for each (their website field, or their email’s domain). Up to 25. Scope: site_audit:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...up to 25 contacts, each with a website ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":false,"description":"Name or email","schema":{"type":"string"}}],"x-scopes":["site_audit:read"]}},"/api/v1/sites/{id}/blog":{"get":{"operationId":"get_sites_by_id_blog","tags":["Site Blog"],"summary":"Blog posts on one website.","description":"Blog posts on one website. Scope: sites:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ...posts ] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["sites:read"]},"post":{"operationId":"post_sites_by_id_blog","tags":["Site Blog"],"summary":"Add a blog post to a website.","description":"Add a blog post to a website. camelCase field names (as GoHighLevel uses) are accepted too. Scope: sites:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["sites:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Title"},"slug":{"type":"string","description":"URL name"},"content":{"type":"string","description":"Body (HTML or markdown)"},"excerpt":{"type":"string","description":"Summary"},"featured_image":{"type":"string","description":"Image URL"},"published":{"type":"boolean","description":"Publish now"},"published_at":{"type":"string","format":"date-time","description":"Publish time"}},"required":["title","slug"]}}}}}},"/api/v1/sites/{id}/blog/{postId}":{"get":{"operationId":"get_sites_by_id_blog_by_postId","tags":["Site Blog"],"summary":"One site blog post.","description":"One site blog post. Scope: sites:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["sites:read"]},"patch":{"operationId":"patch_sites_by_id_blog_by_postId","tags":["Site Blog"],"summary":"Change a site blog post.","description":"Change a site blog post. Scope: sites:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["sites:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Title"},"content":{"type":"string","description":"Body"},"published":{"type":"boolean","description":"Publish or unpublish"}}}}}}},"delete":{"operationId":"delete_sites_by_id_blog_by_postId","tags":["Site Blog"],"summary":"Delete a site blog post.","description":"Delete a site blog post. Scope: sites:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"postId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["sites:write"]}},"/api/v1/social/posts":{"post":{"operationId":"post_social_posts","tags":["Social"],"summary":"Publish now to the workspace’s connected social accounts: LinkedIn (default), Instagram and Facebook.","description":"Publish now to the workspace’s connected social accounts: LinkedIn (default), Instagram and Facebook. Other platforms return a clear error. Scope: social:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ...the result per platform } }  (201)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["social:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post text, up to 3000 characters"},"platforms":{"type":"array","items":{"type":"string"},"description":"e.g. [\"linkedin\", \"instagram\"] (default [\"linkedin\"])"},"media_urls":{"type":"array","items":{"type":"string"},"description":"Up to 10 image or video URLs (an Instagram carousel)"},"thumbnail_url":{"type":"string","description":"Instagram reel cover"}},"required":["content"]}}}}}},"/api/v1/social/connections":{"get":{"operationId":"get_social_connections","tags":["Social"],"summary":"The workspace’s connected social accounts, for picking connection_ids.","description":"The workspace’s connected social accounts, for picking connection_ids. Enabled accounts only unless include_disabled=true; credentials are never returned. Scope: social:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"tenant_id\", \"user_id\", \"platform\", \"account_name\", \"account_id\", \"scopes\", \"enabled\", \"connected_at\", \"expires_at\", \"created_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"platform","in":"query","required":false,"description":"Only this platform, e.g. instagram","schema":{"type":"string"}},{"name":"include_disabled","in":"query","required":false,"description":"true also lists disabled accounts (replaced on re-connect or deselected); posts cannot target them","schema":{"type":"boolean"}}],"x-scopes":["social:read"]}},"/api/v1/social/scheduled-posts":{"get":{"operationId":"get_social_scheduled_posts","tags":["Social"],"summary":"Posts with a schedule, earliest slot first (at most 200).","description":"Posts with a schedule, earliest slot first (at most 200). Scope: social:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"status\", \"scheduled_at\", \"published_at\", \"content\", \"media_urls\", \"media_type\", \"tags\", \"error\", \"targets\": [{ \"id\", \"social_connection_id\", \"platform\", \"status\", \"external_url\", \"error\", \"published_at\" }] }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"from","in":"query","required":false,"description":"Only slots at or after this ISO 8601 time","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Only slots at or before this ISO 8601 time","schema":{"type":"string","format":"date-time"}},{"name":"status","in":"query","required":false,"description":"Comma list of draft | scheduled | publishing | published | failed | partially_failed (default scheduled)","schema":{"type":"string"}}],"x-scopes":["social:read"]},"post":{"operationId":"post_social_scheduled_posts","tags":["Social"],"summary":"Schedule a post on one or more connected accounts; it publishes automatically within about 5 minutes of scheduled_at.","description":"Schedule a post on one or more connected accounts; it publishes automatically within about 5 minutes of scheduled_at. A post whose slot was missed by more than 6 hours is not published. Send client_ref to make retries safe: the same ref returns the first post with 200 and meta.idempotent instead of scheduling it twice. Scope: social:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"scheduled\", \"scheduled_at\", \"published_at\", \"content\", \"media_urls\", \"media_type\", \"tags\", \"error\", \"targets\": [{ \"id\", \"social_connection_id\", \"platform\", \"status\": \"pending\", \"external_url\", \"error\", \"published_at\" }] } }  (201; 200 with \"meta\": { \"idempotent\": true } for a repeated client_ref)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["social:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post text (caption, or the YouTube description), up to 3000 characters"},"connection_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"1 to 10 enabled connection ids from GET /api/v1/social/connections. YouTube and TikTok need a video in media_urls; Google Business needs an image or no media (400 otherwise)"},"scheduled_at":{"type":"string","format":"date-time","description":"ISO 8601 with a time zone, e.g. 2026-11-08T14:00:00-05:00; 2 minutes to 90 days ahead"},"media_urls":{"type":"array","items":{"type":"string"},"description":"Up to 10 http(s) URLs. A video URL must end in .mp4, .mov, .webm, .avi or .mkv (before any ?query) to post as a reel or video"},"media_type":{"type":"string","description":"text_only | image | video | carousel (default: inferred: any video URL makes it video, 2+ URLs carousel, 1 image, none text_only). A type that contradicts media_urls is a 400"},"youtube_title":{"type":"string","description":"YouTube title, up to 100 characters (default: the start of content)"},"thumbnail_url":{"type":"string","description":"Cover image for an Instagram reel or YouTube video; use a JPEG"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 10 tags (not starting with ref:)"},"client_ref":{"type":"string","description":"Your own id for this post, up to 100 characters (stored as the tag ref:<client_ref>)"}},"required":["content","connection_ids","scheduled_at"]}}}}}},"/api/v1/social/scheduled-posts/{id}":{"delete":{"operationId":"delete_social_scheduled_posts_by_id","tags":["Social"],"summary":"Cancel a scheduled post.","description":"Cancel a scheduled post. 409 once it has started publishing or is published. Scope: social:delete.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["social:delete"]}},"/api/v1/custom-fields":{"get":{"operationId":"get_custom_fields","tags":["Custom Fields"],"summary":"List custom field definitions, optionally for one entity_type (contact, company, opportunity, location, work_order).","description":"List custom field definitions, optionally for one entity_type (contact, company, opportunity, location, work_order). Scope: custom_fields:read; a key without it still sees the fields of records it can read (contacts:read shows contact fields).","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"entity_type\", \"name\", \"field_key\", \"field_type\", \"options\", \"position\", \"created_at\" }], \"meta\": { \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"entity_type","in":"query","required":false,"description":"contact | company | opportunity | location | work_order","schema":{"type":"string"}}],"x-scopes":["custom_fields:read"]},"post":{"operationId":"post_custom_fields","tags":["Custom Fields"],"summary":"Define a custom field.","description":"Define a custom field. Types: text, textarea, number, date (YYYY-MM-DD), boolean, select (needs options). field_key is unique per entity type. Owners and admins only. Scope: custom_fields:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"field_key\", ... } }  (409 if the key is taken)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["custom_fields:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Label shown in the CRM"},"field_key":{"type":"string","description":"lowercase_with_underscores; the key used in values"},"entity_type":{"type":"string","description":"contact (default), company, opportunity, location, work_order"},"field_type":{"type":"string","description":"text (default), textarea, number, date, boolean, select"},"options":{"type":"array","items":{"type":"string"},"description":"Choices, for select fields"},"position":{"type":"number","description":"Sort order"}},"required":["name","field_key"]}}}}}},"/api/v1/custom-fields/{id}":{"get":{"operationId":"get_custom_fields_by_id","tags":["Custom Fields"],"summary":"Get one definition.","description":"Get one definition. Scope: custom_fields:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["custom_fields:read"]},"patch":{"operationId":"patch_custom_fields_by_id","tags":["Custom Fields"],"summary":"Rename, reorder, or change a select field's options.","description":"Rename, reorder, or change a select field's options. The key, entity type and field type cannot change, because stored values depend on them. Scope: custom_fields:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["custom_fields:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New label"},"options":{"type":"array","items":{"type":"string"},"description":"Replace the choices (select fields)"},"position":{"type":"number","description":"Sort order"}}}}}}},"delete":{"operationId":"delete_custom_fields_by_id","tags":["Custom Fields"],"summary":"Delete a field and every value stored for it.","description":"Delete a field and every value stored for it. Scope: custom_fields:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["custom_fields:write"]}},"/api/v1/webhooks/subscriptions":{"get":{"operationId":"get_webhooks_subscriptions","tags":["Webhook Subscriptions"],"summary":"List this workspace's webhook subscriptions (never their secrets).","description":"List this workspace's webhook subscriptions (never their secrets). meta.events lists every event you can subscribe to. Scope: webhooks:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"url\", \"description\", \"events\", \"enabled\", \"consecutive_failures\", \"disabled_reason\", \"created_at\", \"updated_at\" }], \"meta\": { \"events\": [...] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["webhooks:read"]},"post":{"operationId":"post_webhooks_subscriptions","tags":["Webhook Subscriptions"],"summary":"Get an HTTPS POST when something happens, instead of polling.","description":"Get an HTTPS POST when something happens, instead of polling. Events: contact.created, contact.tag_added, contact.status_changed, opportunity.stage_changed, invoice.sent, invoice.paid, payment.received, appointment.created, appointment.cancelled, booking.created, form.submitted, estimate.accepted, ticket.created, ticket.status_changed, checkout.abandoned, order.paid, order.shipped, order.delivered, order.refunded, order.cancelled, subscription.activated, subscription.renewed, subscription.payment_failed, subscription.payment_recovered, subscription.cancel_requested, subscription.cancelled, subscription.paused, subscription.resumed, subscription.skipped, review.received (or \"*\" for all). Each delivery is JSON { \"id\", \"event\", \"created_at\", \"tenant_id\", \"data\" } where data holds the ids involved (contact_id, invoice_id, appointment_id ...; form answers for form.submitted; ticket_id, ticket_number, external_id, status, type and priority for tickets, plus from_status on ticket.status_changed; order_id, order_number, order_total (dollars), status, from_status, product_id and product_ids for orders, plus carrier, tracking_number and tracking_url on order.shipped and refund_type and refund_amount on order.refunded; subscription_id, plan and product_id for subscriptions, plus amount_cents, stripe_invoice_id, next_billing_date (renewed), attempt_count, next_retry_at and invoice_url (payment_failed); review_id, rating and source for review.received, never the review text); fetch the full record with the API. Headers: X-Hyppo-Event, X-Hyppo-Delivery (the delivery id, use it to ignore repeats) and X-Hyppo-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\"> keyed with your secret. Recompute it over the raw body, compare in constant time, and reject a t more than 5 minutes old. Answer 2xx within 10 seconds; anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, and a subscription that fails 20 deliveries in a row is switched off (its creator is emailed). The URL must be public HTTPS; redirects are not followed. Up to 10 subscriptions per workspace. Scope: webhooks:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"url\", \"events\", \"enabled\", ..., \"secret\": \"whsec_...\" } }  (the secret is shown only here: store it)"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["webhooks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public https:// URL that receives the POSTs"},"events":{"type":"array","items":{"type":"string"},"description":"Events to send, or [\"*\"] for all"},"description":{"type":"string","description":"A label, e.g. \"Zapier: new leads\""}},"required":["url","events"]}}}}}},"/api/v1/webhooks/subscriptions/{id}":{"get":{"operationId":"get_webhooks_subscriptions_by_id","tags":["Webhook Subscriptions"],"summary":"Get one subscription.","description":"Get one subscription. Scope: webhooks:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["webhooks:read"]},"patch":{"operationId":"patch_webhooks_subscriptions_by_id","tags":["Webhook Subscriptions"],"summary":"Change the URL, events or description, or switch it off and on (switching on clears the failure count).","description":"Change the URL, events or description, or switch it off and on (switching on clears the failure count). Scope: webhooks:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["webhooks:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"New https:// URL"},"events":{"type":"array","items":{"type":"string"},"description":"Replace the event list"},"description":{"type":"string","description":"Label"},"enabled":{"type":"boolean","description":"false pauses deliveries; true resumes"}}}}}}},"delete":{"operationId":"delete_webhooks_subscriptions_by_id","tags":["Webhook Subscriptions"],"summary":"Remove a subscription and its delivery log.","description":"Remove a subscription and its delivery log. Scope: webhooks:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["webhooks:write"]}},"/api/v1/webhooks/subscriptions/{id}/test":{"post":{"operationId":"post_webhooks_subscriptions_by_id_test","tags":["Webhook Subscriptions"],"summary":"Send a sample webhook.test event now and see what your endpoint answered.","description":"Send a sample webhook.test event now and see what your endpoint answered. Use it before going live. A test is never retried. Scope: webhooks:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"delivery_id\", \"delivered\": true, \"response_status\": 200, \"error\": null } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["webhooks:write"]}},"/api/v1/webhooks/subscriptions/{id}/deliveries":{"get":{"operationId":"get_webhooks_subscriptions_by_id_deliveries","tags":["Webhook Subscriptions"],"summary":"The newest deliveries for a subscription: event, status (pending, delivered, failed, dead), attempts, the response code ","description":"The newest deliveries for a subscription: event, status (pending, delivered, failed, dead), attempts, the response code from your endpoint, last error and next retry. Scope: webhooks:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"event\", \"status\", \"attempt\", \"response_status\", \"last_error\", \"next_retry_at\", \"delivered_at\", \"created_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many (default and max 100)","schema":{"type":"number"}}],"x-scopes":["webhooks:read"]}},"/api/v1/webhooks/deliveries/{id}/resend":{"post":{"operationId":"post_webhooks_deliveries_by_id_resend","tags":["Webhook Subscriptions"],"summary":"Send a failed or dead delivery again now, with a fresh set of retries.","description":"Send a failed or dead delivery again now, with a fresh set of retries. Scope: webhooks:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"delivery_id\", \"status\": \"delivered\", \"response_status\", \"error\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["webhooks:write"]}},"/api/v1/team/agent-tasks/claim":{"post":{"operationId":"post_team_agent_tasks_claim","tags":["Team Chat Agents"],"summary":"Agent keys only.","description":"Agent keys only. Claim your oldest open task: it moves to in_progress until the lease runs out (default 15 minutes). data is null when there is nothing to do. A task whose lease lapses three times fails. Make the agent and its key in Team Chat (Agents). Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"title\", \"instructions\", \"status\": \"in_progress\", \"source\", \"channel_id\", \"thread_root_id\", \"contact_id\", \"decision\", \"hop_count\", ... } | null }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"lease_seconds":{"type":"number","description":"60 to 3600 (default 900)"}}}}}}}},"/api/v1/team/agent-tasks":{"get":{"operationId":"get_team_agent_tasks","tags":["Team Chat Agents"],"summary":"Tasks you can see, newest first.","description":"Tasks you can see, newest first. An agent key sees its own tasks and the hand-offs it made. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ ... ], \"meta\": { \"agents\": { \"<id>\": { \"name\", \"user_id\" } }, \"needs_approval\": 0, \"next_before\": null } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"Comma list: queued, in_progress, needs_approval, done, failed, canceled","schema":{"type":"string"}},{"name":"agent_id","in":"query","required":false,"description":"One agent","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"1 to 100 (default 50)","schema":{"type":"number"}},{"name":"before","in":"query","required":false,"description":"created_at of the last task you have, for the next page","schema":{"type":"string"}}],"x-scopes":["team_chat:read"]},"post":{"operationId":"post_team_agent_tasks","tags":["Team Chat Agents"],"summary":"File a task for an agent.","description":"File a task for an agent. From an agent key it is a hand-off (at most 5 in a row). With channel_id and no thread_root_id, a \"New task\" post is made there and becomes the task thread. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","description":"The agent to do it"},"title":{"type":"string","description":"Up to 200 characters"},"instructions":{"type":"string","description":"Up to 8,000 characters"},"channel_id":{"type":"string","format":"uuid","description":"Where the work and its result are posted"},"thread_root_id":{"type":"string","format":"uuid","description":"An existing thread in that channel"},"contact_id":{"type":"string","format":"uuid","description":"The contact it is about"},"parent_task_id":{"type":"string","format":"uuid","description":"Agents: the task you are handing off from"}},"required":["agent_id","title"]}}}}}},"/api/v1/team/agent-tasks/{id}":{"get":{"operationId":"get_team_agent_tasks_by_id","tags":["Team Chat Agents"],"summary":"One task.","description":"One task. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/agent-tasks/{id}/complete":{"post":{"operationId":"post_team_agent_tasks_by_id_complete","tags":["Team Chat Agents"],"summary":"Agent keys only, on a task you claimed.","description":"Agent keys only, on a task you claimed. The result is posted in the task thread as the agent. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"done\" }, \"meta\": { \"posted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","description":"Up to 8,000 characters"}}}}}}}},"/api/v1/team/agent-tasks/{id}/fail":{"post":{"operationId":"post_team_agent_tasks_by_id_fail","tags":["Team Chat Agents"],"summary":"Agent keys only.","description":"Agent keys only. Give up on a claimed task; the reason is posted in the thread. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"failed\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"What went wrong, up to 2,000 characters"}},"required":["error"]}}}}}},"/api/v1/team/agent-tasks/{id}/request-approval":{"post":{"operationId":"post_team_agent_tasks_by_id_request_approval","tags":["Team Chat Agents"],"summary":"Agent keys only.","description":"Agent keys only. Park a claimed task until a person approves. The person who asked is @mentioned in the thread. Approval puts the task back in the queue with decision \"approved\"; claim it again to carry on. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"needs_approval\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"string","description":"What you want to do, up to 4,000 characters"}},"required":["request"]}}}}}},"/api/v1/team/agent-tasks/{id}/extend":{"post":{"operationId":"post_team_agent_tasks_by_id_extend","tags":["Team Chat Agents"],"summary":"Agent keys only.","description":"Agent keys only. Keep a long task claimed: resets its lease. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"lease_seconds":{"type":"number","description":"60 to 3600 (default 900)"}}}}}}}},"/api/v1/team/agent-tasks/{id}/approve":{"post":{"operationId":"post_team_agent_tasks_by_id_approve","tags":["Team Chat Agents"],"summary":"People only: the person who asked, or a workspace admin.","description":"People only: the person who asked, or a workspace admin. Puts a task waiting for approval back in the queue with decision \"approved\". Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"queued\", \"decision\": \"approved\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Optional, up to 1,000 characters"}}}}}}}},"/api/v1/team/agent-tasks/{id}/reject":{"post":{"operationId":"post_team_agent_tasks_by_id_reject","tags":["Team Chat Agents"],"summary":"People only: the person who asked, or a workspace admin.","description":"People only: the person who asked, or a workspace admin. Cancels a task waiting for approval, with decision \"rejected\". Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"canceled\", \"decision\": \"rejected\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Optional, up to 1,000 characters"}}}}}}}},"/api/v1/team/agent-tasks/{id}/cancel":{"post":{"operationId":"post_team_agent_tasks_by_id_cancel","tags":["Team Chat Agents"],"summary":"People only: the person who asked, or a workspace admin.","description":"People only: the person who asked, or a workspace admin. Cancels any open task. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ..., \"status\": \"canceled\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Optional, up to 1,000 characters"}}}}}}}},"/api/v1/team/skills":{"get":{"operationId":"get_team_skills","tags":["Skill Depot"],"summary":"The team library: rules, knowledge and skills (the AI Org Chart agents load skills from it too), each with its current v","description":"The team library: rules, knowledge and skills (the AI Org Chart agents load skills from it too), each with its current version and the agents using it. A search (q) needs every word in the name, slug, tags, description or body, best match first. meta says what you may do. Agent keys are refused. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ { \"id\", \"slug\", \"name\", \"kind\", \"audience\", \"guarded\", \"tags\", \"archived\", \"current_version\": { \"id\", \"version\", \"description\", \"paths\", \"check_rule\", \"sha256\" }, \"used_by\": [] } ], \"meta\": { \"can_write\", \"can_decide\", \"super_admin\", \"truncated\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"kind","in":"query","required":false,"description":"Comma list: rule, knowledge, skill","schema":{"type":"string"}},{"name":"audience","in":"query","required":false,"description":"team (teammates' Claude Code), reviewer (PR Reviewer) or agents (AI Org Chart)","schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"description":"One tag","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Search words","schema":{"type":"string"}},{"name":"archived","in":"query","required":false,"description":"true for archived only, false for live only","schema":{"type":"boolean"}},{"name":"include_body","in":"query","required":false,"description":"Add each current version's body","schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"description":"1 to 500 (default 500)","schema":{"type":"number"}}],"x-scopes":["team_chat:read"]},"post":{"operationId":"post_team_skills","tags":["Skill Depot"],"summary":"Add an item at version 1.","description":"Add an item at version 1. A workspace owner or admin signed in to the app, or the API key of a platform super admin; a guarded item takes a platform super admin. Everyone else proposes instead (POST /api/v1/team/skills/proposals). 409 when the slug is taken. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"skill\": { ... }, \"current\": { ... }, \"versions\": [ ... ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The title, up to 80 characters"},"slug":{"type":"string","description":"Lowercase letters, numbers and single hyphens, up to 64; made from the name when omitted"},"description":{"type":"string","description":"When to use it, up to 1,024 characters"},"body":{"type":"string","description":"Markdown. A rule up to 2,000 characters, knowledge 3,000, a skill 100,000"},"kind":{"type":"string","description":"skill (default), rule or knowledge"},"audience":{"type":"array","items":{"type":"string"},"description":"Any of team, reviewer, agents (default agents)"},"guarded":{"type":"boolean","description":"Money, security, consent or merge-gate material (default false)"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 20"},"paths":{"type":"array","items":{"type":"string"},"description":"Repo-relative globs it applies to, like app/**/*.tsx; empty means everywhere"},"check":{"type":"object","description":"Rules only: { pattern, flags?, paths?, message, severity: warn | fail }. The PR Reviewer runs the JavaScript regex on added lines; a fail hit fails the review"},"change_note":{"type":"string","description":"Up to 500 characters"}},"required":["name","description","body"]}}}}}},"/api/v1/team/skills/rules":{"get":{"operationId":"get_team_skills_rules","tags":["Skill Depot"],"summary":"The rules and knowledge that apply to some repo paths: items whose globs (or whose check's globs) match any of them, plu","description":"The rules and knowledge that apply to some repo paths: items whose globs (or whose check's globs) match any of them, plus every item with no paths, which applies everywhere. Guarded first, then rules, then by title, each with its body and, for a rule, its check. Claude Code calls this before editing files (the MCP tool hyppo_rules_for); the PR Reviewer calls it with audience=reviewer. Each item returned counts as a pull. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ { \"skill_id\", \"slug\", \"kind\", \"title\", \"description\", \"body\", \"guarded\", \"paths\", \"check_rule\": { \"pattern\", \"flags\", \"paths\", \"message\", \"severity\" } | null, \"version_id\", \"matched_paths\": [] } ], \"meta\": { \"audience\", \"paths\", \"matched\", \"always_on\", \"truncated\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"paths","in":"query","required":false,"description":"Repo-relative file paths, comma-separated (repeatable), up to 300. None: only the items that apply everywhere","schema":{"type":"string"}},{"name":"audience","in":"query","required":false,"description":"team (default) or reviewer","schema":{"type":"string"}},{"name":"via","in":"query","required":false,"description":"How the pull is counted for audience=team: api (default) or mcp_tool","schema":{"type":"string"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/skills/export":{"get":{"operationId":"get_team_skills_export","tags":["Skill Depot"],"summary":"The team's items (audience team) as the files Claude Code reads: a rule to .claude/rules/<slug>.md, knowledge with paths","description":"The team's items (audience team) as the files Claude Code reads: a rule to .claude/rules/<slug>.md, knowledge with paths to .claude/rules/kb-<slug>.md, a skill to .claude/skills/<slug>/SKILL.md. Each file carries a skill-depot marker line, so scripts/skill-depot/export.mjs (npm run skills:export) only ever replaces or removes files it wrote. scope=user keeps only skills and always-on rules, for ~/.claude (the installer: curl -fsSL https://hyppohq.io/api/public/skill-depot | sh). Send have with meta.hash from the last answer to get no files and meta.unchanged true while nothing changed. Each exported item counts as a pull, except on an unchanged answer. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ { \"path\", \"content\" } ], \"meta\": { \"target\", \"scope\", \"hash\", \"unchanged\", \"generated_at\", \"items\", \"always_on_chars\", \"budget\", \"over_budget\", \"skipped\": [ { \"slug\", \"reason\" } ], \"truncated\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"target","in":"query","required":false,"description":"claude-code (the default and only one)","schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"description":"repo (the default): every team item, for a repo .claude folder. user: skills and always-on rules only, for ~/.claude","schema":{"type":"string"}},{"name":"have","in":"query","required":false,"description":"meta.hash from an earlier answer; while it still matches, data is empty and meta.unchanged is true","schema":{"type":"string"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/skills/usage":{"get":{"operationId":"get_team_skills_usage","tags":["Skill Depot"],"summary":"Workspace owners and admins.","description":"Workspace owners and admins. Pulls in the last N days per item and per person, split by channel (mcp_prompt, mcp_tool, api, export, reviewer), and the team items nobody pulled. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"days\", \"since\", \"totals\": { \"pulls\", \"people\", \"items\" }, \"by_item\": [ { \"skill_id\", \"slug\", \"title\", \"kind\", \"pulls\", \"people\", \"last_at\", \"by_via\" } ], \"by_person\": [ { \"user_id\", \"name\", \"pulls\", \"items\", \"last_at\", \"by_via\", \"top_items\" } ], \"unused\": [], \"truncated\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"days","in":"query","required":false,"description":"1 to 365 (default 30)","schema":{"type":"number"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/skills/slug/{slug}":{"get":{"operationId":"get_team_skills_slug_by_slug","tags":["Skill Depot"],"summary":"One item by slug, as GET /api/v1/team/skills/:id.","description":"One item by slug, as GET /api/v1/team/skills/:id. Counts as a pull (an archived item comes back marked archived and is not counted). Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"skill\": { ... }, \"current\": { \"id\", \"version\", \"description\", \"body\", \"paths\", \"check_rule\", \"sha256\" }, \"versions\": [ ... ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"via","in":"query","required":false,"description":"How the pull is counted: api (default), mcp_tool or mcp_prompt","schema":{"type":"string"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/skills/{id}":{"get":{"operationId":"get_team_skills_by_id","tags":["Skill Depot"],"summary":"One item: its current version with the body, its versions newest first (no bodies) and the agents using it.","description":"One item: its current version with the body, its versions newest first (no bodies) and the agents using it. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"skill\": { ... }, \"current\": { ... } | null, \"versions\": [ { \"id\", \"version\", \"sha256\", \"change_note\", \"author_name\", \"created_at\" } ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:read"]},"patch":{"operationId":"patch_team_skills_by_id","tags":["Skill Depot"],"summary":"Rename, archive (never deleted) or set kind, audience, guarded or tags.","description":"Rename, archive (never deleted) or set kind, audience, guarded or tags. Same people as adding an item; a guarded item, or guarding one, takes a platform super admin. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"skill\": { ... }, \"current\": { ... }, \"versions\": [ ... ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Up to 80 characters"},"archived":{"type":"boolean","description":"Archived items stay in the library but nothing loads them"},"kind":{"type":"string","description":"skill, rule or knowledge; the current version must fit it"},"audience":{"type":"array","items":{"type":"string"},"description":"Any of team, reviewer, agents"},"guarded":{"type":"boolean","description":"Platform super admin only"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 20"}}}}}}}},"/api/v1/team/skills/{id}/versions/{versionId}":{"get":{"operationId":"get_team_skills_by_id_versions_by_versionId","tags":["Skill Depot"],"summary":"One version in full.","description":"One version in full. Versions are permanent: never edited or deleted. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"skill_id\", \"version\", \"description\", \"body\", \"paths\", \"check_rule\", \"sha256\", \"change_note\", \"author_name\", \"created_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:read"]}},"/api/v1/team/skills/{id}/versions":{"post":{"operationId":"post_team_skills_by_id_versions","tags":["Skill Depot"],"summary":"Save a new version and make it current.","description":"Save a new version and make it current. Same people as adding an item. paths and check carry forward when omitted (check: null removes it). 409 when someone saved a newer version than base_version_id; nothing changed returns the current one with meta.unchanged. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"version\", \"description\", \"body\", \"paths\", \"check_rule\", \"sha256\", ... }, \"meta\": { \"unchanged\": false } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_version_id":{"type":"string","format":"uuid","description":"The current version you edited"},"description":{"type":"string","description":"Up to 1,024 characters"},"body":{"type":"string","description":"Within the kind's limit"},"paths":{"type":"array","items":{"type":"string"},"description":"Repo-relative globs"},"check":{"type":"object","description":"Rules only; null removes it"},"change_note":{"type":"string","description":"Up to 500 characters"}},"required":["base_version_id","description","body"]}}}}}},"/api/v1/team/skills/proposals":{"get":{"operationId":"get_team_skills_proposals","tags":["Skill Depot"],"summary":"Proposals, newest first (up to 200).","description":"Proposals, newest first (up to 200). A platform super admin sees everyone's; anyone else their own. meta.pending counts the ones waiting. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [ { \"id\", \"change\": \"new\" | \"edit\", \"status\", \"source\", \"kind\", \"title\", \"slug\", \"proposed\": { ... }, \"rationale\", \"proposer_name\", \"decider_name\", \"decided_at\", \"decision_note\", \"target\": { ... } | null, \"scan\": [] } ], \"meta\": { \"can_decide\", \"scope\", \"pending\", \"truncated\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","required":false,"description":"all (default), pending, approved, rejected or superseded","schema":{"type":"string"}},{"name":"mine","in":"query","required":false,"description":"true for only your own","schema":{"type":"boolean"}}],"x-scopes":["team_chat:read"]},"post":{"operationId":"post_team_skills_proposals","tags":["Skill Depot"],"summary":"Propose a new item, or a change to one (skill_id, or the slug of an existing item).","description":"Propose a new item, or a change to one (skill_id, or the slug of an existing item). Any member who can read the library may propose, a read-only sign-in included (Claude Code's hyppo_propose_rule uses this). Nothing changes until a platform super admin approves it. A new item needs a title and a body; a slug made from the title that is already taken is a 409 (send that slug to propose a change instead). A change sends only what it changes. Your older pending proposal about the same item is marked superseded. Possible secrets come back in meta.warnings. Scope: team_chat:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"pending\", ... }, \"meta\": { \"superseded\": 0, \"warnings\": [ { \"kind\", \"line\" } ] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["team_chat:read"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"skill_id":{"type":"string","format":"uuid","description":"The item to change; omit for a new item"},"title":{"type":"string","description":"Up to 80 characters; required for a new item"},"body":{"type":"string","description":"Required for a new item. A rule: the rule, then **Why:** and **How to apply:**"},"kind":{"type":"string","description":"rule (default for a new item), knowledge or skill"},"slug":{"type":"string","description":"A new item's slug (default: from the title), or the slug of the item to change"},"description":{"type":"string","description":"Default: the title"},"paths":{"type":"array","items":{"type":"string"},"description":"Repo-relative globs; empty means everywhere"},"check":{"type":"object","description":"Rules only: { pattern, flags?, paths?, message, severity }; null removes it"},"audience":{"type":"array","items":{"type":"string"},"description":"Default: team and reviewer for a rule, team otherwise"},"tags":{"type":"array","items":{"type":"string"},"description":"Up to 20"},"rationale":{"type":"string","description":"Why, up to 2,000 characters"},"source":{"type":"string","description":"mcp, ui, capture or api (default: from how you signed in)"}}}}}}}},"/api/v1/team/skills/proposals/{id}/decide":{"post":{"operationId":"post_team_skills_proposals_by_id_decide","tags":["Skill Depot"],"summary":"A platform super admin, signed in to the app.","description":"A platform super admin, signed in to the app. Approve (edits change the proposal first) or reject. Approving a new item creates it; approving a change saves a new version and sets the item's title, kind, audience, guarded and tags. 409 when the proposal was already decided or someone saved a newer version than base_version_id. Scope: team_chat:write.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\": \"approved\" | \"rejected\", ... }, \"meta\": { \"skill_id\", \"version_id\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["team_chat:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","description":"approve or reject"},"note":{"type":"string","description":"Up to 1,000 characters, shown to the proposer"},"edits":{"type":"object","description":"Approve only: any proposal field, plus guarded"},"base_version_id":{"type":"string","format":"uuid","description":"Approve only: the version you reviewed (default: the current one)"},"change_note":{"type":"string","description":"Approve only: default \"From a proposal by <name>: <rationale>\""}},"required":["decision"]}}}}}},"/api/v1/webhooks/automations/{token}":{"get":{"operationId":"get_webhooks_automations_by_token","tags":["Webhooks"],"summary":"Fire an automation via GET (query params become payload)","description":"Fire an automation via GET (query params become payload)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_webhooks_automations_by_token","tags":["Webhooks"],"summary":"Fire an automation webhook with JSON, form, or multipart payload","description":"Fire an automation webhook with JSON, form, or multipart payload","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"[any]":{"description":"Payload becomes the automation trigger context"}}}}}}}},"/api/v1/webhooks/team/{token}":{"post":{"operationId":"post_webhooks_team_by_token","tags":["Webhooks"],"summary":"Post a message into a Team Chat channel.","description":"Post a message into a Team Chat channel. Make the URL in Team Chat (channel menu → Webhooks); the secret in it is the only credential. Slack incoming-webhook bodies work as they are. Up to 60 posts a minute per webhook.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true, \"message_id\": \"...\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"The message, up to 8,000 characters. <!channel> notifies everyone in the channel"},"username":{"type":"string","description":"Show the post under this name instead of the webhook name"}},"required":["text"]}}}}}},"/api/v1/widgets":{"get":{"operationId":"get_widgets","tags":["Widgets"],"summary":"List widgets, newest first.","description":"List widgets, newest first. Scope: widgets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\", \"slug\", \"type\", \"config\", \"style\", \"published\", ... }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"type","in":"query","required":false,"description":"Only this widget type","schema":{"type":"string"}}],"x-scopes":["widgets:read"]},"post":{"operationId":"post_widgets","tags":["Widgets"],"summary":"Create a widget.","description":"Create a widget. Same rules as the widget builder. A new widget starts unpublished: PATCH { \"published\": true } to put it live at /w/{workspace}/{slug}, then embed it with /api/v1/widgets/embed/:tenantSlug/:widgetSlug. Turning on chat AI (config.ai_enabled) needs a card on file, or 402. Unknown keys are refused by name. 409 when the slug is taken. Scope: widgets:create.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"type\", \"config\", \"style\", \"published\", \"embed_allowed_origins\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-scopes":["widgets:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Widget name"},"slug":{"type":"string","description":"URL slug: lowercase letters, numbers and hyphens, unique in the workspace"},"type":{"type":"string","description":"logo-showcase | google-reviews | social-feed | youtube-feed | live-chat | reputation"},"config":{"type":"object","description":"Per type. logo-showcase: logos [{ url, alt, link }], speed, direction, grayscale, pause. google-reviews: place_id, place_name, place_address, layout, columns, min_rating, max_reviews. social-feed: posts. youtube-feed: videos, layout, columns. live-chat: welcome_message, offline_message, return_visitor_greeting, theme_color, position, show_bubble, bubble_text, chat_icon, chat_avatar_url, header_text, form_fields, auto_create_contact, ai_enabled, ai_system_prompt, ai_personality (professional | friendly | formal | concise), ai_escalation_keywords, ai_max_replies. reputation: google_review_url, threshold, heading, intro_text, positive_message, negative_fields, negative_thank_you, button_text. Any type: theme, branding."},"style":{"type":"object","description":"Style overrides"},"embed_allowed_origins":{"type":"array","items":{"type":"string"},"description":"Sites allowed to embed it"}},"required":["name","slug","type"]}}}}}},"/api/v1/widgets/{id}":{"get":{"operationId":"get_widgets_by_id","tags":["Widgets"],"summary":"Get a widget with its config.","description":"Get a widget with its config. Scope: widgets:read.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"name\", \"slug\", \"type\", \"config\", \"style\", \"published\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["widgets:read"]},"patch":{"operationId":"patch_widgets_by_id","tags":["Widgets"],"summary":"Change a widget.","description":"Change a widget. Send only the keys to change; each one replaces the stored value whole, so send the full config rather than a piece of it. Read-only keys sent back unchanged (id, tenant_id, created_at) are ignored. 402 when it turns on chat AI with no card on file, 409 when the slug is taken. Scope: widgets:update.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["widgets:update"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Widget name"},"slug":{"type":"string","description":"URL slug: lowercase letters, numbers and hyphens, unique in the workspace"},"type":{"type":"string","description":"logo-showcase | google-reviews | social-feed | youtube-feed | live-chat | reputation"},"config":{"type":"object","description":"Per type. logo-showcase: logos [{ url, alt, link }], speed, direction, grayscale, pause. google-reviews: place_id, place_name, place_address, layout, columns, min_rating, max_reviews. social-feed: posts. youtube-feed: videos, layout, columns. live-chat: welcome_message, offline_message, return_visitor_greeting, theme_color, position, show_bubble, bubble_text, chat_icon, chat_avatar_url, header_text, form_fields, auto_create_contact, ai_enabled, ai_system_prompt, ai_personality (professional | friendly | formal | concise), ai_escalation_keywords, ai_max_replies. reputation: google_review_url, threshold, heading, intro_text, positive_message, negative_fields, negative_thank_you, button_text. Any type: theme, branding."},"style":{"type":"object","description":"Style overrides"},"embed_allowed_origins":{"type":"array","items":{"type":"string"},"description":"Sites allowed to embed it"},"published":{"type":"boolean","description":"Live and embeddable when true"}}}}}}},"delete":{"operationId":"delete_widgets_by_id","tags":["Widgets"],"summary":"Delete a widget.","description":"Delete a widget. Scope: widgets:delete.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-scopes":["widgets:delete"]}},"/api/v1/widgets/embed/{tenantSlug}/{widgetSlug}":{"get":{"operationId":"get_widgets_embed_by_tenantSlug_by_widgetSlug","tags":["Widgets"],"summary":"Get a self-executing JS embed snippet for a widget","description":"Get a self-executing JS embed snippet for a widget","responses":{"200":{"description":"Success","content":{"application/json":{"example":"application/javascript"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"tenantSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/widgets/oembed":{"get":{"operationId":"get_widgets_oembed","tags":["Widgets"],"summary":"Get oEmbed HTML for a social post","description":"Get oEmbed HTML for a social post","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"html\": \"...\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"url","in":"query","required":true,"description":"Social post URL","schema":{"type":"string"}},{"name":"platform","in":"query","required":true,"description":"facebook | instagram | twitter","schema":{"type":"string"}}]}},"/api/v1/widgets/places-search":{"get":{"operationId":"get_widgets_places_search","tags":["Widgets"],"summary":"Search Google Places by text query","description":"Search Google Places by text query","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"places\": [{ \"place_id\", \"name\", \"address\", \"rating\", \"total_reviews\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":true,"description":"Search query (min 3 chars)","schema":{"type":"string"}}]}},"/api/v1/widgets/reputation/{slug}/respond":{"post":{"operationId":"post_widgets_reputation_by_slug_respond","tags":["Widgets"],"summary":"Record a reputation widget response (public, CORS)","description":"Record a reputation widget response (public, CORS)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":"number","description":"Rating 1-5"},"comment":{"type":"string","description":"Optional comment"},"widget_id":{"type":"string","format":"uuid","description":"The widget id. Always send it: when more than one workspace publishes a reputation widget with this slug, a request without it returns 404."}},"required":["rating"]}}}}}},"/api/v1/widgets/reputation/{slug}/stats":{"get":{"operationId":"get_widgets_reputation_by_slug_stats","tags":["Widgets"],"summary":"Get reputation stats and recent responses","description":"Get reputation stats and recent responses","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"stats\": { ... }, \"responses\": [...], \"total\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/widgets/reviews":{"get":{"operationId":"get_widgets_reviews","tags":["Widgets"],"summary":"Get Google reviews for a place with AI-generated summary (public, CORS)","description":"Get Google reviews for a place with AI-generated summary (public, CORS)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"place_name\", \"rating\", \"total_reviews\", \"reviews\", \"ai_summary\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"place_id","in":"query","required":true,"description":"Google Places ID","schema":{"type":"string"}},{"name":"max","in":"query","required":false,"description":"Max reviews to fetch (default 5, max 10)","schema":{"type":"number"}}]}},"/api/v1/qr-codes-list":{"get":{"operationId":"get_qr_codes_list","tags":["QR Codes"],"summary":"List all QR codes for the current tenant","description":"List all QR codes for the current tenant","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"id\", \"name\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/unsubscribe":{"post":{"operationId":"post_unsubscribe","tags":["Unsubscribe"],"summary":"Unsubscribe a contact from marketing emails (public, token-based)","description":"Unsubscribe a contact from marketing emails (public, token-based)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Unsubscribe token from email footer"}},"required":["token"]}}}}}},"/api/v1/ai/nova":{"get":{"operationId":"get_ai_nova","tags":["AI"],"summary":"List Nova media generation jobs","description":"List Nova media generation jobs","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (max 100)","schema":{"type":"number"}},{"name":"type","in":"query","required":false,"description":"image | video","schema":{"type":"string"}},{"name":"model","in":"query","required":false,"description":"Filter by model","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}]},"post":{"operationId":"post_ai_nova","tags":["AI"],"summary":"Generate an image or video with Nova.","description":"Generate an image or video with Nova. Image models: gpt-image-2 (default; supports reference images), gpt-image-2.5 (supports up to 16 reference images; aspect_ratio auto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 27:16, 16:27, 9:8 or 8:9, where the last four are 1K only; resolution 1K, 2K or 4K; background auto, transparent or opaque; prompts up to 20,000 characters), gemini-flash-image, gemini-pro-image, imagen-4-fast, imagen-4. Video models: veo-3.1-fast, veo-3.1, kling-2.6, wan-2.5. GET /api/v1/ai/nova/models lists what is available now. Options a model does not accept are refused with 400 before anything is charged.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"job_id\", \"status\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","description":"Generation prompt"},"type":{"type":"string","description":"image | video (default: image)"},"model":{"type":"string","description":"Model identifier"},"aspect_ratio":{"type":"string","description":"e.g. 1:1, 16:9, 9:16"},"duration_seconds":{"type":"number","description":"Video duration"},"reference_image_urls":{"type":"array","items":{"type":"string"},"description":"Reference images (not for gpt-image-2.5)"},"resolution":{"type":"string","description":"gpt-image-2.5: 1K (default), 2K or 4K"},"background":{"type":"string","description":"gpt-image-2.5: auto (default), transparent or opaque. Transparent suits logos and product cut-outs"},"skip_enhance":{"type":"boolean","description":"Skip prompt enhancement"}},"required":["prompt"]}}}}}},"/api/v1/ai/nova/models":{"get":{"operationId":"get_ai_nova_models","tags":["AI"],"summary":"List available Nova models","description":"List available Nova models","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai/nova/{jobId}":{"get":{"operationId":"get_ai_nova_by_jobId","tags":["AI"],"summary":"Get Nova generation job status","description":"Get Nova generation job status","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_ai_nova_by_jobId","tags":["AI"],"summary":"Delete a Nova generation job","description":"Delete a Nova generation job","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/ai/approvals":{"get":{"operationId":"get_ai_approvals","tags":["AI"],"summary":"ASP Graphic flyers, ASP Rank blog posts and ASP Echo video scripts waiting for approval, newest first.","description":"ASP Graphic flyers, ASP Rank blog posts and ASP Echo video scripts waiting for approval, newest first. Needs asp_graphic:read, asp_rank:read or asp_echo:read, and lists only the kinds the caller can read. A flyer has a caption; a blog post has a title, excerpt and body_markdown; a video has its script, a caption (its description), and video_url once rendered. Approving and rejecting are done in the app or on the website.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [{ \"kind\", \"id\", \"topic\", \"title\", \"image_url\", \"caption\", \"excerpt\", \"body_markdown\", \"script\", \"video_url\", \"created_at\" }] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai/asp-echo":{"get":{"operationId":"get_ai_asp_echo","tags":["AI"],"summary":"ASP Echo: whether the schedule runs and when it runs next (null when the workspace has none), and the 20 latest avatar v","description":"ASP Echo: whether the schedule runs and when it runs next (null when the workspace has none), and the 20 latest avatar videos with their status. Needs asp_echo:read. error is set only on a failed video.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"schedule\": { \"running\", \"require_approval\", \"frequency\", \"preferred_days\", \"preferred_time\", \"next_run_at\", \"last_run_at\", \"topics_left\", \"daily_post_count\" } | null, \"jobs\": [{ \"id\", \"status\", \"topic\", \"title\", \"thumbnail_url\", \"video_url\", \"error\", \"posted_at\", \"created_at\" }] } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/ai/avatars":{"get":{"operationId":"get_ai_avatars","tags":["AI"],"summary":"List avatar generation jobs","description":"List avatar generation jobs","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}]}},"/api/v1/ai/avatars/generate":{"post":{"operationId":"post_ai_avatars_generate","tags":["AI"],"summary":"Generate AI avatar video (needs the AI Avatars feature and a payment method; 50 Sparks per render, refunded on failure)","description":"Generate AI avatar video (needs the AI Avatars feature and a payment method; 50 Sparks per render, refunded on failure)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"job_id\", \"status\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"script":{"type":"string","description":"Avatar speech script (max 5000 characters)"},"reference_image_url":{"type":"string","description":"Face photo uploaded to this workspace’s media library (https Supabase storage URL)"},"image_consent_attested":{"type":"boolean","description":"Must be true: the person in the photo agreed to be animated"},"motion_prompt":{"type":"string","description":"Motion description (max 1000 characters)"},"voice_sample_url":{"type":"string","description":"Voice sample uploaded to this workspace’s media library"},"voice_consent_attested":{"type":"boolean","description":"Required (true) when voice_sample_url is set: the speaker agreed to have their voice cloned"},"resolution":{"type":"string","description":"256 | 540 | 1080"},"aspect_ratio":{"type":"string","description":"16:9 | 9:16 | 1:1"}},"required":["script","reference_image_url","image_consent_attested","motion_prompt"]}}}}}},"/api/v1/ai/avatars/{jobId}":{"get":{"operationId":"get_ai_avatars_by_jobId","tags":["AI"],"summary":"Get avatar generation job status","description":"Get avatar generation job status","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_ai_avatars_by_jobId","tags":["AI"],"summary":"Delete an avatar generation job","description":"Delete an avatar generation job","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/ai/page-builder-stream":{"post":{"operationId":"post_ai_page_builder_stream","tags":["AI"],"summary":"Streaming page builder (Server-Sent Events)","description":"Streaming page builder (Server-Sent Events)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"SSE stream of { type, ... } events"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","description":"Chat messages"}},"required":["messages"]}}}}}},"/api/v1/ai/asp-rank/schedules":{"get":{"operationId":"get_ai_asp_rank_schedules","tags":["AI"],"summary":"Get ASP-Rank scheduling configuration","description":"Get ASP-Rank scheduling configuration","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"enabled\", \"frequency\", \"topics\", ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_ai_asp_rank_schedules","tags":["AI"],"summary":"Update ASP-Rank scheduling configuration","description":"Update ASP-Rank scheduling configuration","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable/disable scheduling"},"frequency":{"type":"string","description":"daily | 3x_week | weekly | biweekly"},"preferred_days":{"type":"array","items":{"type":"number"},"description":"Days 0-6 (Mon-Sun)"},"preferred_time":{"type":"string","description":"HH:MM (UTC)"},"topics":{"type":"array","items":{"type":"string"},"description":"Blog topics to rotate through"},"require_approval":{"type":"boolean","description":"Require approval before publish"},"blog_id":{"type":"string","format":"uuid","description":"Blog ID for auto-posting"}}}}}}}},"/api/v1/ai/asp/form":{"post":{"operationId":"post_ai_asp_form","tags":["AI"],"summary":"Generate a social-post caption from media + notes","description":"Generate a social-post caption from media + notes","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"caption\", \"auto_posted\", \"post_id\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_urls":{"type":"array","items":{"type":"string"},"description":"Media URLs"},"media_type":{"type":"string","description":"image | video"},"notes":{"type":"string","description":"Context notes for caption"}},"required":["media_urls","notes"]}}}}}},"/api/v1/ai/asp/submit":{"post":{"operationId":"post_ai_asp_submit","tags":["AI"],"summary":"Submit ASP form for processing (authenticated)","description":"Submit ASP form for processing (authenticated)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"status\": \"accepted\", \"job_id\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_urls":{"type":"array","items":{"type":"string"},"description":"Media URLs"},"media_type":{"type":"string","description":"image | video"},"notes":{"type":"string","description":"Context notes"},"add_frame_subtitles":{"type":"boolean","description":"Add subtitles to video frames"}},"required":["media_urls","media_type","notes"]}}}}}},"/api/v1/ai-sites":{"get":{"operationId":"get_ai_sites","tags":["AI Sites"],"summary":"List AI-generated websites","description":"List AI-generated websites","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"post_ai_sites","tags":["AI Sites"],"summary":"Create a new AI site project","description":"Create a new AI site project","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Site name"},"slug":{"type":"string","description":"URL slug (unique per tenant)"}},"required":["name","slug"]}}}}}},"/api/v1/ai-sites/{id}":{"get":{"operationId":"get_ai_sites_by_id","tags":["AI Sites"],"summary":"Get AI site details","description":"Get AI site details","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_ai_sites_by_id","tags":["AI Sites"],"summary":"Update AI site (name, custom_domain)","description":"Update AI site (name, custom_domain)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_ai_sites_by_id","tags":["AI Sites"],"summary":"Delete an AI site","description":"Delete an AI site","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"deleted\": true } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/ai-sites/{id}/generate":{"post":{"operationId":"post_ai_sites_by_id_generate","tags":["AI Sites"],"summary":"Generate or iterate the site with a prompt","description":"Generate or iterate the site with a prompt","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","description":"Generation or iteration prompt"}},"required":["prompt"]}}}}}},"/api/v1/ai-sites/{id}/generations":{"get":{"operationId":"get_ai_sites_by_id_generations","tags":["AI Sites"],"summary":"List generation history for a site","description":"List generation history for a site","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/ai-sites/track":{"post":{"operationId":"post_ai_sites_track","tags":["AI Sites"],"summary":"Track page events from an AI site (public, no auth)","description":"Track page events from an AI site (public, no auth)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"ok\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"site_id":{"type":"string","format":"uuid","description":"AI site ID"},"event":{"type":"string","description":"pageview | session_end | click | form_submit | booking_click | checkout_click"},"url":{"type":"string","description":"Page URL"},"ref":{"type":"string","description":"Referrer"},"duration":{"type":"number","description":"Session duration (ms)"},"metadata":{"type":"object","description":"Additional metadata"}},"required":["site_id","event"]}}}}}},"/api/v1/voice/calls":{"post":{"operationId":"post_voice_calls","tags":["Voice"],"summary":"Initiate an outbound AI voice call.","description":"Initiate an outbound AI voice call. Goes through the do-not-call, consent and calling-hours checks; a refused call returns status \"blocked\" with a reason.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"data\": { \"status\": \"dialing\" | \"blocked\", \"call_id\"?, \"reason\"?, \"to\", \"voice_agent\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"voice_agent_id":{"type":"string","format":"uuid","description":"Voice agent ID (must be enabled)"},"to_number":{"type":"string","description":"Destination phone, E.164 only (e.g. +13055550100)"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID in this workspace (for DNC and consent checks)"},"campaign_type":{"type":"string","description":"telemarketing (default) | informational"}},"required":["voice_agent_id","to_number"]}}}}},"get":{"operationId":"get_voice_calls","tags":["Voice"],"summary":"List voice calls.","description":"List voice calls. Signed-in members only, not API keys. Members limited to their assigned records see only their own calls.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"total\", \"page\", \"pageSize\", \"meta\": { \"page\", \"pageSize\", \"total\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number (default 1)","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 20)","schema":{"type":"number"}},{"name":"voice_agent_id","in":"query","required":false,"description":"Filter by voice agent","schema":{"type":"string","format":"uuid"}},{"name":"ai","in":"query","required":false,"description":"1 = only calls an AI voice agent handled","schema":{"type":"string"}}]}},"/api/v1/voice/calls/{id}":{"get":{"operationId":"get_voice_calls_by_id","tags":["Voice"],"summary":"One call with its summary, transcript lines and, for members who may hear recordings, a 1 hour signed recording URL.","description":"One call with its summary, transcript lines and, for members who may hear recordings, a 1 hour signed recording URL. Signed-in members only, not API keys.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { \"id\", \"status\", \"summary\", \"transcript\", \"transcript_lines\": [{ \"speaker\", \"text\", \"at_ms\" }], \"voice_agent\", \"contact\", \"recording\": { \"url\", \"expires_in\" } | null, ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/voice/token":{"post":{"operationId":"post_voice_token","tags":["Voice"],"summary":"Mint an access token for browser voice calls","description":"Mint an access token for browser voice calls","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"token\", \"identity\", \"expiresInSeconds\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/voice/test-call":{"post":{"operationId":"post_voice_test_call","tags":["Voice"],"summary":"Start a browser-based test call with a voice agent","description":"Start a browser-based test call with a voice agent","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"data\": { \"ws_url\", \"params\", \"agent_name\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"voice_agent_id":{"type":"string","format":"uuid","description":"Voice agent ID"}},"required":["voice_agent_id"]}}}}}},"/api/v1/voice/clone":{"post":{"operationId":"post_voice_clone","tags":["Voice"],"summary":"Clone a voice via ElevenLabs (multipart upload)","description":"Clone a voice via ElevenLabs (multipart upload)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"data\": { \"voice_id\", \"name\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Voice name"},"description":{"type":"string","description":"Voice description"},"files":{"type":"array","items":{"description":"Type: file"},"description":"Audio sample files"}},"required":["name","files"]}}}}}},"/api/v1/voice/calls/{id}/takeover":{"post":{"operationId":"post_voice_calls_by_id_takeover","tags":["Voice"],"summary":"Signal human takeover for an active call","description":"Signal human takeover for an active call","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true, \"data\": { \"call_id\", \"takeover_at\" } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/voice/calls/{id}/events":{"get":{"operationId":"get_voice_calls_by_id_events","tags":["Voice"],"summary":"Stream call events (Server-Sent Events)","description":"Stream call events (Server-Sent Events)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"SSE stream of call_events records"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/chat/{widgetSlug}/session":{"post":{"operationId":"post_chat_by_widgetSlug_session","tags":["Chat"],"summary":"Create or resume a chat session (public)","description":"Create or resume a chat session (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"session_id\", \"visitor_token\", \"conversation_id\", \"identified\", \"config\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"visitor_token":{"type":"string","description":"Existing visitor token to resume"},"page_url":{"type":"string","description":"Current page URL"}}}}}}}},"/api/v1/chat/{widgetSlug}/identify":{"post":{"operationId":"post_chat_by_widgetSlug_identify","tags":["Chat"],"summary":"Identify a chat visitor with contact info (public)","description":"Identify a chat visitor with contact info (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"identified\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visitor_token":{"type":"string","description":"Visitor session token"},"name":{"type":"string","description":"Visitor name"},"email":{"type":"string","description":"Visitor email"},"phone":{"type":"string","description":"Visitor phone"}},"required":["visitor_token"]}}}}}},"/api/v1/chat/{widgetSlug}/messages":{"post":{"operationId":"post_chat_by_widgetSlug_messages","tags":["Chat"],"summary":"Send a message from chat visitor (public)","description":"Send a message from chat visitor (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"message_id\", \"conversation_id\" }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visitor_token":{"type":"string","description":"Visitor session token"},"body":{"type":"string","description":"Message text"}},"required":["visitor_token","body"]}}}}},"get":{"operationId":"get_chat_by_widgetSlug_messages","tags":["Chat"],"summary":"Poll for new messages (public)","description":"Poll for new messages (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"messages\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitor_token","in":"query","required":true,"description":"Visitor session token","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Timestamp to fetch messages after","schema":{"type":"string"}}]}},"/api/v1/chat/{widgetSlug}/end":{"post":{"operationId":"post_chat_by_widgetSlug_end","tags":["Chat"],"summary":"End a chat session (public)","description":"End a chat session (public)","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"widgetSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visitor_token":{"type":"string","description":"Visitor session token"}},"required":["visitor_token"]}}}}}},"/api/v1/communities":{"get":{"operationId":"get_communities","tags":["Communities"],"summary":"List tenant communities","description":"List tenant communities","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page","schema":{"type":"number"}}]},"post":{"operationId":"post_communities","tags":["Communities"],"summary":"Create a community","description":"Create a community","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Community name"},"slug":{"type":"string","description":"URL slug"},"description":{"type":"string","description":"Description"},"visibility":{"type":"string","description":"private | public (default private)"},"cover_image_url":{"type":"string","description":"Cover image URL"},"logo_url":{"type":"string","description":"Logo URL"}},"required":["name","slug"]}}}}}},"/api/v1/communities/{id}":{"get":{"operationId":"get_communities_by_id","tags":["Communities"],"summary":"Get community details","description":"Get community details","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"operationId":"patch_communities_by_id","tags":["Communities"],"summary":"Update a community","description":"Update a community","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"operationId":"delete_communities_by_id","tags":["Communities"],"summary":"Delete a community","description":"Delete a community","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"success\": true }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/communities/{id}/posts":{"get":{"operationId":"get_communities_by_id_posts","tags":["Communities"],"summary":"List community posts","description":"List community posts","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page","schema":{"type":"number"}},{"name":"category_id","in":"query","required":false,"description":"Filter by category","schema":{"type":"string","format":"uuid"}}]},"post":{"operationId":"post_communities_by_id_posts","tags":["Communities"],"summary":"Create a community post.","description":"Create a community post. A signed-in session posts as that person (their community member row is created on their first post); an API key names the author.","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","description":"Post content (markdown)"},"author_id":{"type":"string","format":"uuid","description":"Community member ID. Required for API keys; refused for a signed-in session"},"title":{"type":"string","description":"Post title"},"category_id":{"type":"string","format":"uuid","description":"Category ID"},"pinned":{"type":"boolean","description":"Pin post"}},"required":["body"]}}}}}},"/api/v1/communities/{id}/members":{"get":{"operationId":"get_communities_by_id_members","tags":["Communities"],"summary":"List community members","description":"List community members","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...], \"meta\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"description":"Items per page (default 25)","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Search by display name","schema":{"type":"string"}}]},"post":{"operationId":"post_communities_by_id_members","tags":["Communities"],"summary":"Add a member to a community","description":"Add a member to a community","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid","description":"User ID"},"contact_id":{"type":"string","format":"uuid","description":"Contact ID"},"role":{"type":"string","description":"Role (default: member)"},"display_name":{"type":"string","description":"Display name"}},"required":["user_id"]}}}}}},"/api/v1/communities/{id}/categories":{"get":{"operationId":"get_communities_by_id_categories","tags":["Communities"],"summary":"List community post categories","description":"List community post categories","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": [...] }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"post":{"operationId":"post_communities_by_id_categories","tags":["Communities"],"summary":"Create a community category","description":"Create a community category","responses":{"200":{"description":"Success","content":{"application/json":{"example":"{ \"data\": { ... } }"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Category name"},"slug":{"type":"string","description":"URL slug"},"description":{"type":"string","description":"Description"},"color":{"type":"string","description":"Color hex code"},"emoji":{"type":"string","description":"Category emoji"},"members_can_post":{"type":"boolean","description":"Allow member posts (default true)"},"min_level":{"type":"number","description":"Minimum member level (default 0)"}},"required":["name","slug"]}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}