TrustPager Docs

API Reference

713 endpoints across 61 resources. Every endpoint below is statically rendered — AI agents can read this page directly via WebFetch.

Base URL & auth

Full auth details — scopes, approval queue, pagination, idempotency, rate limits — are on the Authentication & scopes page.

Discovery surface — machine-readable everything

Every endpoint on this page is also available in machine-readable form for AI agents and tooling:

Resources

Jump to a resource:

Universal Search (1) Contacts (17) Companies (11) Opportunities (42) Pipelines (12) Products (9) Supplier Catalog (5) Activities (5) Tasks (10) Work Orders (6) Automations (26) Event Queues (10) Event Schedules (9) Auto Queues (13) Auto Schedules (9) SCHEDULING (23) Email (21) Email Campaigns (10) SMS (6) WhatsApp (14) Phone (13) Agents (28) Agent Knowledge Bases (8) VOICE_CALL_DIRECTIVES (5) Text Agents (6) Transcripts (10) Document Templates (12) Documents (6) Signing (5) Forms (25) Websites (7) Order Forms (6) Files (15) Notepads (18) Spreadsheets (16) Reports (18) AI Knowledge (7) Agent Memory (7) Company (32) CRM Templates (5) Integrations (5) Webhooks (17) AI (15) Billing (4) Service Requests (7) Approvals (6) AI Instructions (1) Voices (8) Agent Proposals (6) Lead Generation (10) Playbooks (8) Scheduled Communications (7) Schemas (2) Reputation (22) Referrals (18) CRM Export (1) Export Templates (12) Evie (In-App Agent) (4) Agent Ops (26) INVENTORY (14) COMPONENTS (12)

Contacts (17 endpoints)

Manage individual contacts (people) in the CRM. Supports search, filtering, sub-resources (opportunities, activities, employers), and AI enrichment.

📄 Full markdown: /api/contacts.md

POST /contacts/search Scopes: contacts:read

Fuzzy search across contacts by name, email, or phone. Returns matching contact records.

2 parameters
Name In Type Required Description
query body string yes Search query
limit body number no

📄 /api/contacts/post-contacts-search.md

POST /contacts/bulk-create Scopes: contacts:write

Create up to 100 contacts in one request. Each record must have at least first_name.

2 parameters
Name In Type Required Description
records body array yes Array of contact objects
skip_automations body boolean no Set true to suppress contact_created triggers across all records. Strongly recommended for historical imports.

📄 /api/contacts/post-contacts-bulk-create.md

POST /contacts/bulk-update Scopes: contacts:write

Update up to 100 contacts in one request. Each record must include id plus fields to change. Include archived:true to bulk-archive (or archived:false to bulk-restore).

1 parameter
Name In Type Required Description
records body array yes

📄 /api/contacts/post-contacts-bulk-update.md

POST /contacts/bulk-delete Scopes: contacts:delete

Delete up to 100 contacts in one request. Destructive.

1 parameter
Name In Type Required Description
ids body array yes Contact UUIDs

📄 /api/contacts/post-contacts-bulk-delete.md

POST /contacts/voice/unsubscribe Scopes: contacts:write

AI voice agent unsubscribe — looks up contact by caller phone and flips voice_unsubscribed flag.

2 parameters
Name In Type Required Description
phone body string no Caller phone in E.164 or local format. If omitted, resolves from the Retell call envelope (from_number for inbound, to_number for outbound). Provide explicitly when testing outside a live Retell call.
reason body string no Optional reason for the unsubscribe (e.g. "caller requested via voice agent"). Stored as a note on the contact.

📄 /api/contacts/post-contacts-voice-unsubscribe.md

GET /contacts Scopes: contacts:read

List contacts in the current workspace. Returns active (non-archived) contacts by default. Supports cursor-based pagination, free-text search via `search`, and filtering by source, customer_id, created date range, and unsubscribe flags. Pass archived="true" for only archived, or archived="all" for both.

13 parameters
Name In Type Required Description
limit query number no Max contacts (1-100, default 25)
after query string no Pagination cursor
search query string no Free-text across first_name, last_name, email, phone
source query string no
customer_id query string no Filter to contacts linked to a specific company
archived query string no Archive scope. "false" (default) = active only, "true" = archived only, "all" = both.
created_after query string no ISO date, return contacts created after this date
created_before query string no ISO date, return contacts created before this date
cursor query string no Cursor for next page
fields query string no Comma-separated list of fields to return
expand query string no Comma-separated expansions: employers
email_unsubscribed query boolean no Filter to contacts who have opted out of email. true = opted out only, false = opted in only. Omit for all contacts.
sms_unsubscribed query boolean no Filter to contacts who have opted out of SMS. true = opted out only, false = opted in only. Omit for all contacts.

📄 /api/contacts/get-contacts.md

POST /contacts Scopes: contacts:write

Create a new contact. first_name is required. To link to a company pass customer_id.

18 parameters
Name In Type Required Description
first_name body string yes Given name (required)
last_name body string no
email body string no
phone body string no Mobile, any format — normalised to E.164
landline body string no
job_title body string no
contact_type body string no
customer_id body string no UUID of the company to link this contact to
date_of_birth body string no ISO date (YYYY-MM-DD). Pass "" to clear.
notes body string no
source body string no Lead source (e.g. website, referral, api)
metadata body object no Custom field values as { field_id: value } pairs. Use GET /crm-settings to discover available custom fields. Reserved key: "quick_links" stores per-contact Quick Link URLs as { <type-uuid>: <url> } -- define types via PATCH /company/crm-settings. UUID-shaped keys at metadata root are rejected (400) -- Quick Link URLs must be nested under metadata.quick_links.
address_line1 body string no Street address line 1
city body string no City
state body string no State/province
postal_code body string no Postal/zip code
country body string no Country (default: Australia)
skip_automations body boolean no Set true to suppress the contact_created trigger. Use for historical imports. Default false.

📄 /api/contacts/post-contacts.md

GET /contacts/:contact_id Scopes: contacts:read

Fetch a single contact by UUID. Returns the full record including custom fields.

1 parameter
Name In Type Required Description
contact_id path string yes

📄 /api/contacts/get-contacts-contact-id.md

PATCH /contacts/:contact_id Scopes: contacts:write

Update one or more fields on a contact. Pass only the fields you want to change. Set archived=true to archive (hide from active lists) or archived=false to restore.

11 parameters
Name In Type Required Description
contact_id path string yes
first_name body string no
last_name body string no
email body string no
phone body string no
landline body string no
job_title body string no
contact_type body string no
date_of_birth body string no ISO date (YYYY-MM-DD). Pass "" to clear.
notes body string no
archived body boolean no true = archive, false = restore. Archived contacts stay searchable and API-accessible but drop out of active lists.

📄 /api/contacts/patch-contacts-contact-id.md

DELETE /contacts/:contact_id Scopes: contacts:delete

Delete a contact by UUID. Destructive.

1 parameter
Name In Type Required Description
contact_id path string yes

📄 /api/contacts/delete-contacts-contact-id.md

POST /contacts/:contact_id/unsubscribe Scopes: contacts:write

Unsubscribe a contact across email/sms/voice channels. Cancels queued comms and auto-enrolments.

3 parameters
Name In Type Required Description
contact_id path string yes
channels body array no Channels to unsubscribe: email, sms, voice (default: all)
reason body string no

📄 /api/contacts/post-contacts-contact-id-unsubscribe.md

GET /contacts/:contact_id/deals Scopes: contacts:readopportunities:read

List all opportunities/deals associated with a contact.

1 parameter
Name In Type Required Description
contact_id path string yes

📄 /api/contacts/get-contacts-contact-id-deals.md

GET /contacts/:contact_id/activities Scopes: contacts:readactivities:read

List all activities (calls, meetings, notes, emails) logged against a contact.

1 parameter
Name In Type Required Description
contact_id path string yes

📄 /api/contacts/get-contacts-contact-id-activities.md

Companies (11 endpoints)

Manage business accounts (companies / organisations) in the CRM. Canonical path is /companies; the legacy /customers path remains supported. Companies can have multiple contacts linked and roll up to opportunities and activities.

📄 Full markdown: /api/companies.md

GET /companies Scopes: companies:read

List all companies with cursor-based pagination. Legacy alias: GET /customers.

3 parameters
Name In Type Required Description
search query string no Search by name, email, or phone
limit query number no Max results (1-100, default 25)
cursor query string no Cursor for next page

📄 /api/companies/get-companies.md

GET /companies/:id Scopes: companies:read

Retrieve a single company by ID. Legacy alias: GET /customers/:id.

1 parameter
Name In Type Required Description
id path uuid yes Company ID

📄 /api/companies/get-companies-id.md

POST /companies Scopes: companies:write

Create a new company. name is required. Set skip_automations: true to suppress the customer_created trigger -- recommended for historical imports. Legacy alias: POST /customers.

9 parameters
Name In Type Required Description
name body string yes Company / organisation name
email body string no Primary email
phone body string no Mobile number in E.164 format (e.g. +61412345678). MUST be a mobile number -- landlines will be rejected with a 400 error. Use the landline field for fixed-line/office numbers.
landline body string no Landline / office phone number in E.164 format (e.g. +61299991234)
industry body string no Industry sector
website body string no Website URL
notes body string no Notes
metadata body object no Custom field values as { field_id: value } pairs. Use GET /crm-settings to discover available custom fields. Reserved key: "quick_links" stores per-company Quick Link URLs as { <type-uuid>: <url> } -- define types via PATCH /company/crm-settings. UUID-shaped keys at metadata root are rejected (400).
skip_automations body boolean no Set true to suppress the customer_created trigger. Use for historical imports. Default false.

📄 /api/companies/post-companies.md

PATCH /companies/:id Scopes: companies:write

Update an existing company. Only include fields you want to change. Every successful PATCH emits a field-level audit row to crm_field_change_log (viewable at /data/crm-logs with the crm_audit:read scope). Legacy alias: PATCH /customers/:id.

9 parameters
Name In Type Required Description
id path uuid yes Company ID
name body string no Company / organisation name
email body string no Primary email
phone body string no Mobile number in E.164 format. Landlines will be rejected -- use the landline field.
landline body string no Landline / office phone number in E.164 format. Set to null to clear.
industry body string no Industry sector
website body string no Website URL
notes body string no Notes
metadata body object no Custom field values as { field_id: value } pairs. Replaces entire metadata object -- read first with GET /companies/:id and merge locally. Reserved key: "quick_links" stores per-company Quick Link URLs as { <type-uuid>: <url> }. UUID-shaped keys at metadata root are rejected (400).

📄 /api/companies/patch-companies-id.md

DELETE /companies/:id Scopes: companies:write

Delete a company. Legacy alias: DELETE /customers/:id.

1 parameter
Name In Type Required Description
id path uuid yes Company ID

📄 /api/companies/delete-companies-id.md

POST /companies/search Scopes: companies:read

Search companies by name, email, or phone. Legacy alias: POST /customers/search.

2 parameters
Name In Type Required Description
query body string yes Search query
limit body number no Max results (1-100)

📄 /api/companies/post-companies-search.md

GET /companies/:id/contacts Scopes: companies:readcontacts:read

List all contacts linked to this company. Legacy alias: GET /customers/:id/contacts.

1 parameter
Name In Type Required Description
id path uuid yes Company ID

📄 /api/companies/get-companies-id-contacts.md

GET /companies/:id/opportunities Scopes: companies:readopportunities:read

List all opportunities for this company. Legacy alias: GET /customers/:id/deals (also still supported).

1 parameter
Name In Type Required Description
id path uuid yes Company ID

📄 /api/companies/get-companies-id-opportunities.md

GET /companies/:id/activities Scopes: companies:readactivities:read

List all activities for this company. Legacy alias: GET /customers/:id/activities.

1 parameter
Name In Type Required Description
id path uuid yes Company ID

📄 /api/companies/get-companies-id-activities.md

POST /companies/bulk-create Scopes: companies:write

Create up to 100 companies in a single request. Built for historical migrations and bulk imports. Set skip_automations: true to suppress customer_created triggers across all records. Returns a created array and an errors array. Legacy alias: POST /customers/bulk-create.

2 parameters
Name In Type Required Description
records body object[] yes Array of company objects (max 100). Each requires name plus any optional fields (email, phone, landline, industry, website, notes, metadata, etc.).
skip_automations body boolean no Set true to suppress customer_created triggers across all records. Strongly recommended for historical imports.

📄 /api/companies/post-companies-bulk-create.md

POST /companies/bulk-delete Scopes: companies:delete

Permanently delete up to 100 companies in a single request. Returns a count of deleted records. Cannot be undone. Legacy alias: POST /customers/bulk-delete.

1 parameter
Name In Type Required Description
ids body uuid[] yes Array of company UUIDs to delete (max 100)

📄 /api/companies/post-companies-bulk-delete.md

Opportunities (42 endpoints)

Manage sales opportunities through your pipeline. Canonical path is /opportunities; the legacy /deals path remains supported. Sub-resources cover products, product costs, contacts, users, activities, tasks, work orders, pipeline moves, file/document/image/spreadsheet attachments, and invoices.

📄 Full markdown: /api/opportunities.md

GET /opportunities Scopes: opportunities:read

List all opportunities with cursor-based pagination. Supports search, status, contact, company, pipeline, stage, and date filters. Always includes pipeline placements. Response always includes read-only referral attribution fields: primary_referrer_contact_id (UUID of the most-recent referrer, maintained by a Postgres trigger) and primary_referrer_category (workspace category string). Use expand=referrer to inline the full referrer contact object. When using expand=products, payment_status on each product is stripped unless the caller has invoices:read scope. Legacy alias: GET /deals (same response shape).

12 parameters
Name In Type Required Description
search query string no Search by opportunity name, contact name/email/phone, or company name/email/phone
status query string no Filter by status (open, won, lost)
contact_id query uuid no Filter by primary contact
customer_id query uuid no Filter by company (formerly "customer_id" -- field name preserved for backward compatibility)
assigned_to query uuid no Filter by assigned user
pipeline_id query uuid no Filter by pipeline
stage_id query uuid no Filter by pipeline stage. Can be combined with pipeline_id or used alone.
created_after query string no ISO date filter
created_before query string no ISO date filter
limit query number no Max results (1-100, default 25)
cursor query string no Cursor for next page
expand query string no Expansions: contact, referrer, customer, products, assigned_users. "referrer" inlines the referrer contact for opportunities with primary_referrer_contact_id set.

📄 /api/opportunities/get-opportunities.md

GET /opportunities/:id Scopes: opportunities:read

Retrieve a single opportunity by ID with pipeline placements. Supports expansions. Legacy alias: GET /deals/:id.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
expand query string no Expansions: contact, referrer, customer, products, assigned_users. "referrer" inlines the referrer contact (id, public_id, first_name, last_name, email, phone, job_title) when primary_referrer_contact_id is set.

📄 /api/opportunities/get-opportunities-id.md

POST /opportunities Scopes: opportunities:write

Create a new opportunity. name is required. Set skip_automations: true to suppress the deal_created trigger -- recommended for historical imports to avoid spamming contacts with automation emails. Legacy alias: POST /deals.

10 parameters
Name In Type Required Description
name body string yes Opportunity name
contact_id body uuid no Primary contact ID
customer_id body uuid no Company ID (field name preserved for backward compatibility)
status body string no Status (open, won, lost)
currency body string no Currency code (default: AUD)
lead_source body string no Lead source
tags body object[] no Tags. Each tag is {name: string, color?: string} (hex color, default "#3b82f6"). Plain strings are also accepted and auto-converted. Example: [{"name":"hot-lead","color":"#ef4444"}]
notes body string no Notes
metadata body object no Custom field values as { field_id: value } pairs. Use GET /crm-settings to discover available custom fields. Reserved key: "quick_links" stores per-opportunity Quick Link URLs as { <type-uuid>: <url> } -- define types via PATCH /company/crm-settings. UUID-shaped keys at metadata root are rejected (400).
skip_automations body boolean no Set true to suppress the deal_created trigger. Use for historical imports so old opportunities do not trigger automation emails. Default false.

📄 /api/opportunities/post-opportunities.md

PATCH /opportunities/:id Scopes: opportunities:write

Update an existing opportunity. Only include fields you want to change. Every successful PATCH emits a field-level audit row to crm_field_change_log (viewable at /data/crm-logs with the crm_audit:read scope). Legacy alias: PATCH /deals/:id.

9 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
name body string no Opportunity name
contact_id body uuid no Primary contact ID
customer_id body uuid no Company ID
currency body string no Currency code
lead_source body string no Lead source
tags body object[] no Tags. Each tag is {name: string, color?: string}. Plain strings are also accepted. Replaces entire tags array.
notes body string no Notes
metadata body object no Custom field values as { field_id: value } pairs. Replaces entire metadata object -- read first with GET /opportunities/:id and merge locally. Reserved key: "quick_links" stores per-opportunity Quick Link URLs as { <type-uuid>: <url> }. UUID-shaped keys at metadata root are rejected (400).

📄 /api/opportunities/patch-opportunities-id.md

DELETE /opportunities/:id Scopes: opportunities:write

Delete an opportunity. Legacy alias: DELETE /deals/:id.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/delete-opportunities-id.md

POST /opportunities/search Scopes: opportunities:read

Search opportunities by name, contact name/email/phone, or company name/email/phone. Matches across opportunity name and linked contact/company fields. Legacy alias: POST /deals/search.

2 parameters
Name In Type Required Description
query body string yes Search query
limit body number no Max results (1-100)

📄 /api/opportunities/post-opportunities-search.md

POST /opportunities/:id/move Scopes: opportunities:write

Move an opportunity to a pipeline stage. If the opportunity is not in the pipeline, it will be added. If it is in a different pipeline, it will be moved. When the stage actually changes, stage_changed automations fire automatically. Use skip_automations=true to suppress all automation triggers, or pass skip_action_ids with an array of action UUIDs to suppress only specific actions within automations (the automation still runs and is logged, but those actions are bypassed and recorded in the run's skipped_action_ids field). Legacy alias: POST /deals/:id/move.

6 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
pipeline_id body uuid yes Target pipeline ID
stage_id body uuid yes Target stage ID
position body number no Position within stage (default 0)
skip_automations body boolean no Set true to suppress ALL stage_changed automation triggers. Default false. Use skip_action_ids for per-action control.
skip_action_ids body uuid[] no Array of automation action UUIDs to suppress on this move. The automation still fires but these specific actions are bypassed and logged in the run record. Use list_automation_actions to find action IDs.

📄 /api/opportunities/post-opportunities-id-move.md

POST /opportunities/:id/add-card Scopes: opportunities:write

Add an opportunity card to a pipeline WITHOUT removing existing cards in other pipelines. Enables an opportunity to appear in multiple pipelines simultaneously (dual/multi placement). If the opportunity already has a card in the target pipeline, its stage is updated. Stage_changed automations fire on new placements or stage changes. Supports skip_automations and skip_action_ids for fine-grained automation control. Legacy alias: POST /deals/:id/add-card.

6 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
pipeline_id body uuid yes Target pipeline ID
stage_id body uuid yes Target stage ID
position body number no Position within stage (default 0)
skip_automations body boolean no Set true to suppress ALL stage_changed automation triggers. Default false.
skip_action_ids body uuid[] no Array of automation action UUIDs to suppress on this card add. Automations still fire but these actions are bypassed and logged.

📄 /api/opportunities/post-opportunities-id-add-card.md

GET /opportunities/:id/products Scopes: opportunities:read

List products attached to an opportunity with pricing and payment status. payment_status is only included in the response when the caller has invoices:read scope. Legacy alias: GET /deals/:id/products.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-products.md

POST /opportunities/:id/products Scopes: opportunities:write

Add a product to an opportunity. product_id is required. Optionally set payment_status (requires invoices:write scope). Valid payment_status values: unpaid (default), deposit_invoiced, invoiced, paid. Legacy alias: POST /deals/:id/products.

7 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
product_id body uuid yes Product ID to add
quantity body number no Quantity (default: 1)
unit_price body number no Override price
discount_percent body number no Discount %
deposit_percent body number no Deposit %
payment_status body string no Payment lifecycle stage. Requires invoices:write scope. Values: unpaid (default), deposit_invoiced, invoiced, paid.

📄 /api/opportunities/post-opportunities-id-products.md

PATCH /opportunities/:id/products/:opportunityProductId Scopes: opportunities:write

Update an opportunity product. Supports quantity, price, discount, deposit, and payment_status. Setting payment_status requires invoices:write scope -- returns 403 otherwise. Valid payment_status values: unpaid, deposit_invoiced, invoiced, paid. Legacy alias: PATCH /deals/:id/products/:dealProductId.

7 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
opportunityProductId path uuid yes Opportunity product ID (legacy: dealProductId)
quantity body number no New quantity
unit_price body number no New unit price
discount_percent body number no New discount %
deposit_percent body number no New deposit %
payment_status body string no Payment lifecycle stage. Requires invoices:write scope. Values: unpaid, deposit_invoiced, invoiced, paid.

📄 /api/opportunities/patch-opportunities-id-products-opportunityProductId.md

DELETE /opportunities/:id/products/:opportunityProductId Scopes: opportunities:write

Remove a product from an opportunity. Legacy alias: DELETE /deals/:id/products/:dealProductId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
opportunityProductId path uuid yes Opportunity product ID

📄 /api/opportunities/delete-opportunities-id-products-opportunityProductId.md

POST /opportunities/:id/products/reorder Scopes: opportunities:write

Reorder products on an opportunity by providing an ordered array of opportunity product IDs. Legacy alias: POST /deals/:id/products/reorder.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
product_ids body string[] yes Ordered array of opportunity product UUIDs

📄 /api/opportunities/post-opportunities-id-products-reorder.md

GET /opportunities/:id/product-costs/:opportunityProductId Scopes: opportunities:read

List costs for an opportunity product. Legacy alias: GET /deals/:id/product-costs/:dealProductId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
opportunityProductId path uuid yes Opportunity product ID

📄 /api/opportunities/get-opportunities-id-product-costs-opportunityProductId.md

POST /opportunities/:id/product-costs/:opportunityProductId Scopes: opportunities:write

Create a cost entry for an opportunity product. Legacy alias: POST /deals/:id/product-costs/:dealProductId.

8 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
opportunityProductId path uuid yes Opportunity product ID
label body string no Cost label
unit_cost body number no Unit cost amount
quantity body number no Quantity
currency body string no Currency code
supplier_id body uuid no Supplier company ID
supplier_product_id body uuid no Supplier product ID

📄 /api/opportunities/post-opportunities-id-product-costs-opportunityProductId.md

PATCH /opportunities/:id/product-costs/:costId Scopes: opportunities:write

Update an opportunity product cost entry. Legacy alias: PATCH /deals/:id/product-costs/:costId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
costId path uuid yes Cost entry ID

📄 /api/opportunities/patch-opportunities-id-product-costs-costId.md

DELETE /opportunities/:id/product-costs/:costId Scopes: opportunities:write

Delete an opportunity product cost entry. Legacy alias: DELETE /deals/:id/product-costs/:costId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
costId path uuid yes Cost entry ID

📄 /api/opportunities/delete-opportunities-id-product-costs-costId.md

GET /opportunities/:id/contacts Scopes: opportunities:readcontacts:read

List all contacts associated with an opportunity (beyond the primary contact). Legacy alias: GET /deals/:id/contacts.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-contacts.md

POST /opportunities/:id/contacts/:contactId Scopes: opportunities:write

Associate an additional contact with an opportunity. Legacy alias: POST /deals/:id/contacts/:contactId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
contactId path uuid yes Contact ID

📄 /api/opportunities/post-opportunities-id-contacts-contactId.md

DELETE /opportunities/:id/contacts/:contactId Scopes: opportunities:write

Remove a contact association from an opportunity. Legacy alias: DELETE /deals/:id/contacts/:contactId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
contactId path uuid yes Contact ID

📄 /api/opportunities/delete-opportunities-id-contacts-contactId.md

GET /opportunities/:id/users Scopes: opportunities:read

List users assigned to an opportunity. Legacy alias: GET /deals/:id/users.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-users.md

POST /opportunities/:id/users/:userId Scopes: opportunities:write

Assign a user to an opportunity. Legacy alias: POST /deals/:id/users/:userId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
userId path uuid yes User ID

📄 /api/opportunities/post-opportunities-id-users-userId.md

DELETE /opportunities/:id/users/:userId Scopes: opportunities:write

Remove a user assignment from an opportunity. Legacy alias: DELETE /deals/:id/users/:userId.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
userId path uuid yes User ID

📄 /api/opportunities/delete-opportunities-id-users-userId.md

GET /opportunities/:id/activities Scopes: opportunities:readactivities:read

List all activities for an opportunity. Legacy alias: GET /deals/:id/activities.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-activities.md

GET /opportunities/:id/tasks Scopes: opportunities:readtasks:read

List all tasks for an opportunity. Legacy alias: GET /deals/:id/tasks.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-tasks.md

GET /opportunities/:id/work-orders Scopes: opportunities:read

List all work orders for an opportunity. Legacy alias: GET /deals/:id/work-orders.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-work-orders.md

GET /opportunities/:id/files Scopes: opportunities:readfiles:read

List files attached to an opportunity. Returns file metadata for every file linked to the opportunity (any file type accepted by /files -- documents, images, secure). Legacy alias: GET /deals/:id/files. Matching MCP tool: list_opportunity_files.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-files.md

POST /opportunities/:id/files/:fileId Scopes: opportunities:writefiles:read

Attach an existing file to an opportunity. The file must already exist in the workspace (upload via POST /files first if needed). Legacy alias: POST /deals/:id/files/:fileId. Matching MCP tool: add_opportunity_file.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
fileId path uuid yes File ID to attach

📄 /api/opportunities/post-opportunities-id-files-fileId.md

DELETE /opportunities/:id/files/:fileId Scopes: opportunities:write

Remove a file attachment from an opportunity. Detaches the link only -- the file itself is not deleted (use DELETE /files/:id to fully delete the file). Legacy alias: DELETE /deals/:id/files/:fileId. Matching MCP tool: remove_opportunity_file.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
fileId path uuid yes File ID to detach

📄 /api/opportunities/delete-opportunities-id-files-fileId.md

GET /opportunities/:id/documents Scopes: opportunities:readdocuments:read

List CRM documents attached to an opportunity. Returns generated documents (proposals, contracts, etc.) linked to the opportunity. Legacy alias: GET /deals/:id/documents. Matching MCP tool: list_opportunity_documents.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-documents.md

POST /opportunities/:id/documents/:documentId Scopes: opportunities:writedocuments:read

Attach an existing CRM document to an opportunity. Legacy alias: POST /deals/:id/documents/:documentId. Matching MCP tool: add_opportunity_document.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
documentId path uuid yes Document ID to attach

📄 /api/opportunities/post-opportunities-id-documents-documentId.md

DELETE /opportunities/:id/documents/:documentId Scopes: opportunities:write

Remove a document attachment from an opportunity. Detaches the link only -- the document itself is not deleted. Legacy alias: DELETE /deals/:id/documents/:documentId. Matching MCP tool: remove_opportunity_document.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
documentId path uuid yes Document ID to detach

📄 /api/opportunities/delete-opportunities-id-documents-documentId.md

GET /opportunities/:id/images Scopes: opportunities:readfiles:read

List image files attached to an opportunity. Filters /files attachments to type=image. Legacy alias: GET /deals/:id/images. Matching MCP tool: list_opportunity_images.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-images.md

POST /opportunities/:id/images/:imageId Scopes: opportunities:writefiles:read

Attach an existing image file (type=image) to an opportunity. Legacy alias: POST /deals/:id/images/:imageId. Matching MCP tool: add_opportunity_image.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
imageId path uuid yes Image file ID to attach

📄 /api/opportunities/post-opportunities-id-images-imageId.md

DELETE /opportunities/:id/images/:imageId Scopes: opportunities:write

Remove an image attachment from an opportunity. Detaches the link only -- the image file itself is not deleted. Legacy alias: DELETE /deals/:id/images/:imageId. Matching MCP tool: remove_opportunity_image.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
imageId path uuid yes Image file ID to detach

📄 /api/opportunities/delete-opportunities-id-images-imageId.md

GET /opportunities/:id/spreadsheets Scopes: opportunities:readspreadsheets:read

List spreadsheets attached to an opportunity. Returns metadata for every spreadsheet linked to the opportunity (including spreadsheets auto-created by form submissions where the form is linked to the opportunity). Legacy alias: GET /deals/:id/spreadsheets. Matching MCP tool: list_opportunity_spreadsheets.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-spreadsheets.md

POST /opportunities/:id/spreadsheets/:spreadsheetId Scopes: opportunities:writespreadsheets:read

Attach an existing spreadsheet to an opportunity. Legacy alias: POST /deals/:id/spreadsheets/:spreadsheetId. Matching MCP tool: add_opportunity_spreadsheet.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
spreadsheetId path uuid yes Spreadsheet ID to attach

📄 /api/opportunities/post-opportunities-id-spreadsheets-spreadsheetId.md

DELETE /opportunities/:id/spreadsheets/:spreadsheetId Scopes: opportunities:write

Remove a spreadsheet attachment from an opportunity. Detaches the link only -- the spreadsheet itself is not deleted. Legacy alias: DELETE /deals/:id/spreadsheets/:spreadsheetId. Matching MCP tool: remove_opportunity_spreadsheet.

2 parameters
Name In Type Required Description
id path uuid yes Opportunity ID
spreadsheetId path uuid yes Spreadsheet ID to detach

📄 /api/opportunities/delete-opportunities-id-spreadsheets-spreadsheetId.md

GET /opportunities/:id/invoices Scopes: opportunities:readinvoices:read

List invoices linked to an opportunity. Invoices are read-only here -- this endpoint surfaces every invoice that references the opportunity via trustpager_deal_id, so AI agents and integrations can answer "what has this customer been billed for?" without needing the invoices:write scope. Requires the invoices:read scope. Legacy alias: GET /deals/:id/invoices. Matching MCP tool: list_opportunity_invoices.

1 parameter
Name In Type Required Description
id path uuid yes Opportunity ID

📄 /api/opportunities/get-opportunities-id-invoices.md

POST /opportunities/bulk-create Scopes: opportunities:write

Create up to 100 opportunities in a single request. Built for historical migrations and bulk data loads. Top-level pipeline_id/stage_id act as defaults inherited by each record unless overridden. Set skip_automations: true (strongly recommended for imports) to suppress deal_created triggers across all records. Returns a created array and an errors array so partial successes can be recovered from without duplicating work on retry. Legacy alias: POST /deals/bulk-create.

4 parameters
Name In Type Required Description
records body object[] yes Array of opportunity objects (max 100). Each requires name plus any optional fields (contact_id, customer_id, pipeline_id, stage_id, status, value, notes, tags, metadata, etc.).
pipeline_id body uuid no Default pipeline UUID applied to every record unless the record sets its own.
stage_id body uuid no Default stage UUID applied to every record unless the record sets its own.
skip_automations body boolean no Set true to suppress deal_created triggers across all records. Strongly recommended for historical imports.

📄 /api/opportunities/post-opportunities-bulk-create.md

POST /opportunities/bulk-delete Scopes: opportunities:delete

Permanently delete up to 100 opportunities in a single request. Each opportunity is cascade-deleted including its products, pipeline placements, contacts, and users. Returns a count of deleted records and any IDs that failed. Cannot be undone. Legacy alias: POST /deals/bulk-delete.

1 parameter
Name In Type Required Description
ids body uuid[] yes Array of opportunity UUIDs to delete (max 100)

📄 /api/opportunities/post-opportunities-bulk-delete.md

POST /opportunities/bulk-move Scopes: opportunities:write

Move up to 100 opportunities to a pipeline stage in a single request. Set skip_automations=true to suppress all stage_changed automation triggers (recommended for bulk moves to avoid flooding contacts). Alternatively, pass skip_action_ids to suppress only specific automation actions across all records in the batch. Returns a count of moved records and any IDs that failed. Legacy alias: POST /deals/bulk-move.

5 parameters
Name In Type Required Description
ids body uuid[] yes Array of opportunity UUIDs to move (max 100)
pipeline_id body uuid yes Target pipeline UUID
stage_id body uuid yes Target stage UUID within the pipeline
skip_automations body boolean no Suppress ALL stage_changed automation triggers (default false). Strongly recommended for bulk moves.
skip_action_ids body uuid[] no Array of automation action UUIDs to suppress across all records in this bulk move. Automations still fire but these actions are bypassed on every record.

📄 /api/opportunities/post-opportunities-bulk-move.md

Pipelines (12 endpoints)

Manage sales pipelines and their stages. Opportunities move through pipeline stages to track progress.

📄 Full markdown: /api/pipelines.md

GET /pipelines Scopes: pipelines:read

List all pipelines in the workspace. Each pipeline represents a workflow (e.g. "Sales", "Onboarding", "Support Tickets"). Use this when you need a pipeline UUID for creating or moving an opportunity.

📄 /api/pipelines/get-pipelines.md

POST /pipelines Scopes: pipelines:write

Create a new pipeline in the workspace. Requires a name; optional fields include description, is_active, is_default, position, sop_url, learning_hub_canvas_id, connected_pipeline_ids, exclude_from_lead_reporting.

7 parameters
Name In Type Required Description
name body string yes Pipeline name (e.g. "Sales", "Onboarding")
description body string no Optional plain-text description of what this pipeline tracks
is_active body boolean no Whether the pipeline is currently active (default true)
is_default body boolean no Make this the workspace default pipeline
position body number no Display order across all pipelines
learning_hub_canvas_id body string no Optional UUID of a Playbook to attach as this pipeline's training resource. Mutually exclusive with sop_url. When set, the "View Training" button opens the Playbook in-app rather than an external URL.
exclude_from_lead_reporting body boolean no When true, opportunities in this pipeline are excluded from the Lead Sources leaderboard (totals, per-source cards, conversion rate). Defaults to false. Use for non-lead pipelines like supplier or referral-partner networks stored as opportunities.

📄 /api/pipelines/post-pipelines.md

GET /pipelines/:pipeline_id Scopes: pipelines:read

Fetch a single pipeline by UUID. Returns the pipeline record (does not include stages — use list_pipeline_stages for that).

1 parameter
Name In Type Required Description
pipeline_id path string yes UUID of the pipeline

📄 /api/pipelines/get-pipelines-pipeline-id.md

PATCH /pipelines/:pipeline_id Scopes: pipelines:write

Update a pipeline by UUID. Pass only the fields you want to change. Writable: name, description, is_active, is_default, position, sop_url, learning_hub_canvas_id, connected_pipeline_ids, exclude_from_lead_reporting.

8 parameters
Name In Type Required Description
pipeline_id path string yes UUID of the pipeline to update
name body string no
description body string no
is_active body boolean no
is_default body boolean no
position body number no
learning_hub_canvas_id body string no UUID of a Playbook to link as this pipeline's training resource, or null to clear. Mutually exclusive with sop_url.
exclude_from_lead_reporting body boolean no When true, opportunities in this pipeline are excluded from the Lead Sources leaderboard (totals, per-source cards, conversion rate). Use for non-lead pipelines like supplier or referral-partner networks stored as opportunities.

📄 /api/pipelines/patch-pipelines-pipeline-id.md

DELETE /pipelines/:pipeline_id Scopes: pipelines:delete

Delete a pipeline by UUID. Destructive — pipeline cannot be deleted if it has opportunities placed in any of its stages.

1 parameter
Name In Type Required Description
pipeline_id path string yes UUID of the pipeline to delete

📄 /api/pipelines/delete-pipelines-pipeline-id.md

GET /pipelines/:pipeline_id/stages Scopes: pipelines:read

List all stages of a pipeline in display order. Each stage includes a deal_count. Use this to find a stage UUID for create_opportunity or move_opportunity.

1 parameter
Name In Type Required Description
pipeline_id path string yes UUID of the pipeline

📄 /api/pipelines/get-pipelines-pipeline-id-stages.md

POST /pipelines/:pipeline_id/stages Scopes: pipelines:write

Add a new stage to a pipeline. Requires a name. Optional: position (defaults to end), color (hex), is_won_stage, is_lost_stage.

6 parameters
Name In Type Required Description
pipeline_id path string yes UUID of the parent pipeline
name body string yes Stage name
position body number no Display order within the pipeline (0-based)
color body string no Hex colour code for the stage chip
is_won_stage body boolean no Mark this stage as a "won" terminal stage
is_lost_stage body boolean no Mark this stage as a "lost" terminal stage

📄 /api/pipelines/post-pipelines-pipeline-id-stages.md

POST /pipelines/:pipeline_id/stages/reorder Scopes: pipelines:write

Reorder the stages of a pipeline. Pass an array of stage UUIDs in the desired new order — position numbers are reassigned in array order.

2 parameters
Name In Type Required Description
pipeline_id path string yes UUID of the pipeline
stage_ids body array yes Stage UUIDs in their new display order

📄 /api/pipelines/post-pipelines-pipeline-id-stages-reorder.md

PATCH /pipelines/:pipeline_id/stages/:stage_id Scopes: pipelines:write

Update a single stage within a pipeline. Pass only the fields you want to change.

7 parameters
Name In Type Required Description
pipeline_id path string yes
stage_id path string yes
name body string no
position body number no
color body string no
is_won_stage body boolean no
is_lost_stage body boolean no

📄 /api/pipelines/patch-pipelines-pipeline-id-stages-stage-id.md

DELETE /pipelines/:pipeline_id/stages/:stage_id Scopes: pipelines:delete

Delete a single stage from a pipeline. Destructive — fails if opportunities are placed in this stage.

2 parameters
Name In Type Required Description
pipeline_id path string yes
stage_id path string yes

📄 /api/pipelines/delete-pipelines-pipeline-id-stages-stage-id.md

GET /pipelines/:pipeline_id/deals Scopes: pipelines:readopportunities:read

List all opportunities (deals) placed in any stage of a pipeline. Returns opportunity records with their current stage placement.

3 parameters
Name In Type Required Description
pipeline_id path string yes
limit query number no Max rows (1-100, default 25)
after query string no Pagination cursor

📄 /api/pipelines/get-pipelines-pipeline-id-deals.md

GET /pipelines/:pipeline_id/summary Scopes: pipelines:read

Fetch summary statistics for a pipeline: deal counts and value totals per stage. Use this for "pipeline health" or "what is in stage X" questions.

1 parameter
Name In Type Required Description
pipeline_id path string yes

📄 /api/pipelines/get-pipelines-pipeline-id-summary.md

Products (9 endpoints)

Manage products and services that can be added to deals.

📄 Full markdown: /api/products.md

GET /products Scopes: products:read

List products / services in the workspace catalog. Use for quotes, line items on opportunities, or pricing questions.

5 parameters
Name In Type Required Description
limit query number no
after query string no
search query string no Free-text across name and sku
category query string no
is_active query boolean no

📄 /api/products/get-products.md

POST /products Scopes: products:write

Create a new product/service. Requires name and price.

9 parameters
Name In Type Required Description
name body string yes
sku body string no
price body number yes
currency body string no
category body string no
description body string no
unit body string no
deposit_percent body number no
is_active body boolean no

📄 /api/products/post-products.md

GET /products/:product_id Scopes: products:read

Fetch a single product by UUID, including pricing and metadata.

1 parameter
Name In Type Required Description
product_id path string yes

📄 /api/products/get-products-product-id.md

PATCH /products/:product_id Scopes: products:write

Update a product. Pass only the fields you want to change.

7 parameters
Name In Type Required Description
product_id path string yes
name body string no
sku body string no
price body number no
category body string no
description body string no
is_active body boolean no

📄 /api/products/patch-products-product-id.md

DELETE /products/:product_id Scopes: products:delete

Delete a product by UUID. Destructive.

1 parameter
Name In Type Required Description
product_id path string yes

📄 /api/products/delete-products-product-id.md

GET /products/:product_id/costs Scopes: products:read

List all cost entries (supplier costs) for a product.

1 parameter
Name In Type Required Description
product_id path string yes

📄 /api/products/get-products-product-id-costs.md

POST /products/:product_id/costs Scopes: products:write

Add a cost entry to a product (e.g. supplier price).

7 parameters
Name In Type Required Description
product_id path string yes
label body string no
cost_price body number no
quantity body number no
currency body string no
supplier_id body string no
notes body string no

📄 /api/products/post-products-product-id-costs.md

PATCH /products/:product_id/costs/:cost_id Scopes: products:write

Update a product cost entry. Pass only the fields you want to change.

5 parameters
Name In Type Required Description
product_id path string yes
cost_id path string yes
label body string no
cost_price body number no
quantity body number no

📄 /api/products/patch-products-product-id-costs-cost-id.md

Supplier Catalog (5 endpoints)

Manage supplier product catalogues for cost tracking on deals. The endpoint path is /supplier-catalog.

📄 Full markdown: /api/supplier-catalog.md

GET /supplier-catalog Scopes: products:read

List all supplier products in the catalog.

3 parameters
Name In Type Required Description
supplier_id query uuid no Filter by supplier UUID
product_id query uuid no Filter by product UUID
is_active query boolean no Filter by active status

📄 /api/supplier-catalog/get-supplier-catalog.md

POST /supplier-catalog Scopes: products:write

Create a supplier product in the catalog. supplier_id and supplier_price are required.

7 parameters
Name In Type Required Description
supplier_id body uuid yes Supplier (customer) UUID
supplier_price body number yes Supplier price
product_id body uuid no Link to existing product UUID
product_name body string no New product name if not linking to existing
supplier_sku body string no Supplier SKU
lead_time_days body number no Lead time in days
minimum_order_qty body number no Minimum order quantity

📄 /api/supplier-catalog/post-supplier-catalog.md

Activities (5 endpoints)

Log and manage CRM activities (calls, meetings, notes) linked to contacts, deals, and customers.

📄 Full markdown: /api/activities.md

GET /activities Scopes: activities:read

List CRM activity log entries (free-text notes and one-line records of calls, meetings, sms, emails, tasks) anchored to contacts/companies/opportunities. Use for "recent notes", "what was logged", "activity history on this deal/contact". DO NOT use for phone-specific queries — list_phone_call_logs returns the actual call records with duration, recording, direction. DO NOT use for inbox queries — list_email_threads / list_sms_conversations / list_bookings / list_transcripts have richer per-channel data.

7 parameters
Name In Type Required Description
limit query number no Max activities (1-100, default 25)
after query string no Pagination cursor
contact_id query string no Filter to activities on a specific contact
customer_id query string no Filter to activities on a specific company
deal_id query string no Filter to activities on a specific opportunity
task_id query string no Filter to activities logged from a specific task
activity_type query string no Filter by type (call, meeting, note, email)

📄 /api/activities/get-activities.md

POST /activities Scopes: activities:write

Log an activity (call, meeting, note, email) against a contact, company, opportunity, or task. Use after a phone call, meeting, or to add a note. When task_id is set, the activity appears on the task detail page AND on the linked opportunity timeline.

8 parameters
Name In Type Required Description
activity_type body string yes Type: call, meeting, note, email, sms, task
subject body string no Short title / summary
description body string no Detail / notes content
contact_id body string no UUID of the contact this is about
customer_id body string no UUID of the company this is about
deal_id body string no UUID of the opportunity this is about
deal_ids body array no Multiple opportunity UUIDs to fan out
task_id body string no UUID of the task this activity came from. Shows on the task detail page; pair with deal_id to also surface on the opportunity timeline.

📄 /api/activities/post-activities.md

GET /activities/:activity_id Scopes: activities:read

Fetch a single activity by UUID — the full record including description, occurred_at, and linked entities.

1 parameter
Name In Type Required Description
activity_id path string yes UUID of the activity

📄 /api/activities/get-activities-activity-id.md

PATCH /activities/:activity_id Scopes: activities:write

Update an activity. Pass only the fields you want to change. Pass deal_ids array to replace linked opportunities atomically.

8 parameters
Name In Type Required Description
activity_id path string yes
activity_type body string no
subject body string no
description body string no
contact_id body string no
customer_id body string no
task_id body string no
deal_ids body array no

📄 /api/activities/patch-activities-activity-id.md

Tasks (10 endpoints)

Create, assign, and manage tasks linked to deals and contacts.

📄 Full markdown: /api/tasks.md

POST /tasks/reorder Scopes: tasks:write

Reorder a set of tasks. Pass task_ids array in desired display order; sort_order is reassigned from the array index.

1 parameter
Name In Type Required Description
task_ids body array yes Task UUIDs in new display order

📄 /api/tasks/post-tasks-reorder.md

GET /tasks/categories Scopes: tasks:read

List task categories defined in the workspace. Use this to find a category UUID for assigning to a task.

📄 /api/tasks/get-tasks-categories.md

POST /tasks/categories Scopes: tasks:write

Create a new task category in the workspace.

1 parameter
Name In Type Required Description
name body string yes Category name

📄 /api/tasks/post-tasks-categories.md

GET /tasks Scopes: tasks:read

List tasks in the workspace. Supports filtering by status, assigned_to, priority, category, deal_id, contact_id, customer_id.

9 parameters
Name In Type Required Description
limit query number no Max number of tasks to return (1-100, default 25)
after query string no Pagination cursor
status query string no Filter by status: todo, in_progress, or completed
assigned_to query string no UUID of the assignee
priority query string no Filter by priority
category query string no Filter by category
deal_id query string no Filter to a specific opportunity
contact_id query string no Filter to a specific contact
customer_id query string no Filter to a specific company

📄 /api/tasks/get-tasks.md

POST /tasks Scopes: tasks:write

Create a new task. Requires title. The task modal has two text fields: "Summary" (short one-liner — maps to the `description` field) and "Detailed Description" (long-form notes — maps to the `body` field). Use the right one for the length of content. Link to records via deal_id / contact_id / customer_id.

12 parameters
Name In Type Required Description
title body string yes Title (required). Matches the "Title" field on the task modal.
description body string no Summary — short one-line summary (target under ~200 chars). Matches the "Summary" field on the task modal. For multi-paragraph content use `body` instead.
body body string no Detailed Description — long-form notes, acceptance criteria, multi-paragraph content. Matches the "Detailed Description" field on the task modal.
due_date body string no ISO date (YYYY-MM-DD) when the task is due
due_time body string no Time of day (HH:MM) when the task is due
assigned_to body string no UUID of the user to assign
category body string no Category name
status body string no todo, in_progress, or completed. Defaults to todo.
priority body string no low, medium, high, or urgent. Defaults to medium.
deal_id body string no
contact_id body string no
customer_id body string no

📄 /api/tasks/post-tasks.md

GET /tasks/:task_id Scopes: tasks:read

Fetch a single task by UUID. Returns the full task record.

1 parameter
Name In Type Required Description
task_id path string yes UUID of the task

📄 /api/tasks/get-tasks-task-id.md

PATCH /tasks/:task_id Scopes: tasks:write

Update a task. Set status to "completed" to mark complete. Pass only fields you want to change. Note: the task modal has two text fields — "Summary" (maps to `description`) and "Detailed Description" (maps to `body`). Pick the right one for the length of content.

10 parameters
Name In Type Required Description
task_id path string yes
title body string no Title. Matches the "Title" field on the task modal.
description body string no Summary — short one-line summary (target under ~200 chars). Matches the "Summary" field on the task modal. For multi-paragraph content use `body` instead.
body body string no Detailed Description — long-form notes, acceptance criteria, multi-paragraph content. Matches the "Detailed Description" field on the task modal.
due_date body string no
due_time body string no
assigned_to body string no
status body string no todo, in_progress, or completed. Set to completed to mark done.
priority body string no low, medium, high, or urgent
category body string no

📄 /api/tasks/patch-tasks-task-id.md

DELETE /tasks/:task_id Scopes: tasks:delete

Delete a task by UUID. Destructive.

1 parameter
Name In Type Required Description
task_id path string yes

📄 /api/tasks/delete-tasks-task-id.md

Work Orders (6 endpoints)

Manage work orders linked to deals for tracking project execution. Work orders appear on the CRM Calendar, support team assignment, and scheduled dates.

📄 Full markdown: /api/work-orders.md

GET /work-orders Scopes: work-orders:read

List work orders. Filter by deal_id (returns deal-level work orders plus any attached to that deal's product lines), deal_product_id, status_id, or assigned_to. Each work order includes its assignee crew (assignees[]).

4 parameters
Name In Type Required Description
limit query number no
deal_id query string no
deal_product_id query string no
status_id query string no

📄 /api/work-orders/get-work-orders.md

POST /work-orders Scopes: work-orders:write

Create a work order. Pass deal_id for a deal-level work order, or deal_product_id to attach it to a specific product line. At least one is required. Pass assignee_ids (array of user UUIDs) to assign a crew — the first becomes the primary assignee.

8 parameters
Name In Type Required Description
deal_id body string no
deal_product_id body string no
status_id body string no
status body string no
data body object no
assignee_ids body array no User UUIDs to assign as the crew; the first is kept as the primary assignee.
notes body string no
fields body object no

📄 /api/work-orders/post-work-orders.md

POST /work-orders/send-work-status Scopes: work-orders:write

Send a work-status update email to a contact for an opportunity. Costs credits.

4 parameters
Name In Type Required Description
deal_id body string yes
recipient_email body string yes
recipient_name body string yes
custom_message body string no

📄 /api/work-orders/post-work-orders-send-work-status.md

GET /work-orders/:work_order_id Scopes: work-orders:read

Fetch a single work order by UUID, including its assignee crew (assignees[]).

1 parameter
Name In Type Required Description
work_order_id path string yes

📄 /api/work-orders/get-work-orders-work-order-id.md

PATCH /work-orders/:work_order_id Scopes: work-orders:write

Update a work order (status, schedule, data fields, and/or its assignee crew). Pass assignee_ids (array of user UUIDs) to replace the crew; the first becomes the primary assignee.

9 parameters
Name In Type Required Description
work_order_id path string yes
status_id body string no
status body string no
data body object no
schedule_date body string no
schedule_time body string no
assignee_ids body array no User UUIDs for the crew; replaces the current assignees. First is kept as the primary.
notes body string no
fields body object no

📄 /api/work-orders/patch-work-orders-work-order-id.md

Automations (26 endpoints)

Create and manage workflow automations. Includes sub-resources for triggers, actions, and execution runs. Supports enable/disable and manual triggering.

📄 Full markdown: /api/automations.md

GET /automations Scopes: automations:read

List automations in the workspace.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/automations/get-automations.md

POST /automations Scopes: automations:write

Create a new automation.

2 parameters
Name In Type Required Description
name body string yes
trigger_type body string yes

📄 /api/automations/post-automations.md

GET /automations/action-types/:action_type|str

Return the full config schema, example, warnings, and related actions for one automation action_type. Call this RIGHT BEFORE writing that action via add_automation_action — do not memorise multiple types upfront. Free read.

1 parameter
Name In Type Required Description
action_type query string yes Canonical action_type key, e.g. "add_tasks", "send_custom_email", "move_deal". Aliases (e.g. "set_crm_field" → "set_custom_field") are accepted.

📄 /api/automations/get-automations-action-types-action-type-str.md

GET /automations/folders Scopes: automations:read

List automation folders. Pass kind (general | workflow | queue | schedule) to scope to one primitive.

1 parameter
Name In Type Required Description
kind query string no Optional. Filter to one primitive: general, workflow, queue, or schedule.

📄 /api/automations/get-automations-folders.md

POST /automations/folders Scopes: automations:write

Create an automation folder. kind defaults to general; pass workflow, queue, or schedule to file it under another primitive.

2 parameters
Name In Type Required Description
name body string yes
kind body string no general (default), workflow, queue, or schedule.

📄 /api/automations/post-automations-folders.md

PATCH /automations/folders/:folder_id Scopes: automations:write

Rename an automation folder. To move automations into it, set their folder field via update_automation.

2 parameters
Name In Type Required Description
folder_id path string yes
name body string no

📄 /api/automations/patch-automations-folders-folder-id.md

DELETE /automations/folders/:folder_id Scopes: automations:delete

Delete an automation folder. Items keep their folder name string; clear it via update_automation if needed.

1 parameter
Name In Type Required Description
folder_id path string yes

📄 /api/automations/delete-automations-folders-folder-id.md

POST /automations/:automation_id/triggers Scopes: automations:write

Add a trigger to an automation. An automation may have multiple triggers — it fires when ANY of them matches (OR logic). Pass trigger_type to give this trigger its own event class (e.g. add a webhook_received trigger to a form_completed automation so both entry points run the same actions); omit it to inherit the automation's primary trigger_type.

5 parameters
Name In Type Required Description
automation_id path string yes
trigger_type body string no Optional. This trigger's own event class. Omit to inherit the automation's primary trigger_type. Set it to fire one automation from multiple different event types (OR-matched).
source_type body string no
source_id body string no
config body object no

📄 /api/automations/post-automations-automation-id-triggers.md

POST /automations/:automation_id/actions Scopes: automations:write

Add an action to an automation.

3 parameters
Name In Type Required Description
automation_id path string yes
action_type body string yes
sequence body number yes

📄 /api/automations/post-automations-automation-id-actions.md

Event Queues (10 endpoints)

Manage event queues for sequenced multi-step workflows (drip campaigns, follow-up sequences).

📄 Full markdown: /api/event-queues.md

GET /event-queues/:id Scopes: automations:read

Retrieve an event queue with its steps.

1 parameter
Name In Type Required Description
id path uuid yes Event queue ID

📄 /api/event-queues/get-event-queues-id.md

POST /event-queues Scopes: automations:write

Create an event queue.

1 parameter
Name In Type Required Description
name body string yes Queue name

📄 /api/event-queues/post-event-queues.md

GET /event-queues/:id/enrollments Scopes: automations:read

List enrollment timer tasks for an event queue. Shows all scheduled step executions with their status, scheduled_for time, enrollment_time (the anchor time used for delay calculation when set via attach_to_event_queue action config), and linked CRM entity IDs (contact, customer, deal). Supports optional status filter and cursor pagination.

4 parameters
Name In Type Required Description
id path uuid yes Event queue ID
status query string no Filter by status: pending, processing, completed, cancelled, failed
limit query number no Max results per page (1-100, default 25)
after query string no Cursor for next page

📄 /api/event-queues/get-event-queues-id-enrollments.md

POST /event-queues/:id/bulk-enroll Scopes: automations:write

Enrol contacts into an event queue in bulk. Requires EXACTLY ONE of three mutually exclusive targeting modes: - contact_ids -- explicit list of contact UUIDs (max 500) - contact_filter -- filter by contact-level fields (individual-person fields: contact_type, source, email, first_name, last_name, job_title, city, state, country) - customer_filter -- filter by company/customer-level fields (account_type, industry, is_customer, is_supplier, city, state, country) -- resolves to all contacts linked to matching customers ENTITY AXIS DISTINCTION: contact_type lives on crm_contacts (use contact_filter). account_type lives on crm_customers (use customer_filter). opportunity_type lives on crm_deals (not filterable here -- use automations with deal triggers instead). Idempotent by default: contacts already enrolled with a pending step are skipped (set skip_if_already_enrolled: false to override). Capped at 500 contacts per call; if the filter would match more, has_more: true is returned and you should call again to page through.

6 parameters
Name In Type Required Description
id path uuid yes Event queue ID
contact_ids body string[] no Explicit list of contact UUIDs (max 500). Mutually exclusive with contact_filter and customer_filter.
contact_filter body object no Filter by contact-level fields. Supported: contact_type, source, email, first_name, last_name, job_title, city, state, country. Values can be a single value or an array (IN). Example: { "contact_type": ["Referrer", "Lawyer"] }
customer_filter body object no Filter by customer/company-level fields -- resolves to all contacts linked to matching customers. Supported: account_type, industry, is_customer, is_supplier, city, state, country. Example: { "account_type": "Accounting Firm" }
enrollment_time body string no ISO timestamp to use as the anchor for step delay calculations (default: now). Useful for backdating enrolments.
skip_if_already_enrolled body boolean no Default true. When true, contacts that already have a pending enrolment in this queue are skipped. Set false to force re-enrolment.

📄 /api/event-queues/post-event-queues-id-bulk-enroll.md

Event Schedules (9 endpoints)

Create clock-driven automation schedules that fire on a cron expression, fan out to a resolved audience, and trigger one automation run per row.

📄 Full markdown: /api/event-schedules.md

GET /event-schedules Scopes: schedules:read

List all event schedules for the workspace.

2 parameters
Name In Type Required Description
limit query number no Items per page (default 25, max 100)
after query string no Cursor for next page

📄 /api/event-schedules/get-event-schedules.md

POST /event-schedules Scopes: schedules:write

Create a new event schedule. Required fields: name, cron_expression, audience_type, automation_id. **Cron expression** is standard 5-field syntax: "min hour day-of-month month day-of-week". Common patterns: - "*/15 * * * *" -- every 15 minutes - "0 * * * *" -- every hour - "0 9 * * *" -- daily at 9am - "0 9 * * 1-5" -- weekdays at 9am - "0 9 * * 1" -- every Monday at 9am - "0 9,17 * * *" -- 9am and 5pm daily **audience_type** controls who receives a run: - "users" -- one run per staff member (with optional role/user_ids filter) - "tasks_by_assignee" -- one run per assignee who has open tasks (digest pattern) - "contacts" -- one run per matching contact - "deals" -- one run per matching deal **audience_filter** is type-specific JSON: - users: { "roles": ["client_editor"], "user_ids": ["uuid"] } - tasks_by_assignee: { "statuses": ["open"], "include_overdue_only": true, "max_tasks_per_user": 20 } - contacts: { "contact_type": "lead", "has_email": true, "limit": 500 } - deals: { "status": "open", "stale_days": 14, "pipeline_id": "uuid", "stage_ids": ["uuid"], "limit": 200 } Optionally set end_at (ISO timestamp) to stop firing after a date, or max_runs (integer) to auto-deactivate after N fires.

10 parameters
Name In Type Required Description
name body string yes Schedule name
cron_expression body string yes Standard 5-field cron expression
audience_type body string yes One of: users, tasks_by_assignee, contacts, deals
automation_id body uuid yes UUID of the automation to fire. Must belong to this workspace.
description body string no Optional description
is_active body boolean no Whether the schedule fires automatically (default true)
timezone body string no IANA timezone, e.g. "Australia/Sydney" (default)
audience_filter body object no Audience-specific filter JSON (see description above)
end_at body string no ISO timestamp after which the schedule stops firing
max_runs body number no Auto-deactivate after firing this many times

📄 /api/event-schedules/post-event-schedules.md

PATCH /event-schedules/:id Scopes: schedules:write

Partial update — modify name, description, is_active, cron_expression, timezone, audience_type, audience_filter, automation_id, end_at, or max_runs. Changing cron_expression or timezone automatically recomputes next_run_at.

11 parameters
Name In Type Required Description
id path uuid yes Event schedule ID
name body string no Schedule name
description body string no Schedule description
is_active body boolean no Enable or disable the schedule
cron_expression body string no 5-field cron expression
timezone body string no IANA timezone
audience_type body string no One of: users, tasks_by_assignee, contacts, deals
audience_filter body object no Audience-specific filter JSON
automation_id body uuid no Replace the linked automation
end_at body string no ISO timestamp after which the schedule stops firing (null to remove)
max_runs body number no Max fires before auto-deactivation (null to remove)

📄 /api/event-schedules/patch-event-schedules-id.md

DELETE /event-schedules/:id Scopes: schedules:delete

Permanently delete an event schedule. The linked automation is NOT deleted. This cannot be undone.

1 parameter
Name In Type Required Description
id path uuid yes Event schedule ID

📄 /api/event-schedules/delete-event-schedules-id.md

POST /event-schedules/preview-cron Scopes: schedules:read

Validate a cron expression and preview the next N fire times in a specified timezone. Does NOT create any schedule. Use to confirm a pattern before saving.

3 parameters
Name In Type Required Description
cron_expression body string yes Standard 5-field cron expression to validate
timezone body string no IANA timezone (default "Australia/Sydney")
count body number no Number of future fire times to return (1-20, default 5)

📄 /api/event-schedules/post-event-schedules-preview-cron.md

POST /event-schedules/:id/fire-now Scopes: schedules:write

Manually fire an event schedule immediately. Resolves the current audience and triggers one automation run per row. Does NOT advance next_run_at, increment run_count, or respect end_at/max_runs limits. Useful for testing, ad-hoc sends, or recovering from a missed fire.

1 parameter
Name In Type Required Description
id path uuid yes Event schedule ID

📄 /api/event-schedules/post-event-schedules-id-fire-now.md

GET /event-schedules/:id/audience-preview Scopes: schedules:read

Preview the audience a schedule WOULD resolve to right now -- returns the total count and a configurable sample of trigger_data rows, without firing anything. Use before enabling a schedule to verify the filter targets the right rows.

2 parameters
Name In Type Required Description
id path uuid yes Event schedule ID
sample query number no Number of sample rows to return (0-50, default 5)

📄 /api/event-schedules/get-event-schedules-id-audience-preview.md

GET /event-schedules/:id/runs Scopes: schedules:read

List historical fire records for a schedule. Shows audience_size, runs_triggered, runs_failed, status (completed/partial/failed), and timing. Use to verify schedules are firing, debug failures, or audit history. Supports cursor pagination ordered by fired_at descending.

3 parameters
Name In Type Required Description
id path uuid yes Event schedule ID
limit query number no Items per page (default 25, max 100)
after query string no Cursor for next page

📄 /api/event-schedules/get-event-schedules-id-runs.md

Auto Queues (13 endpoints)

Manage Auto Queues for sequenced multi-step workflows (drip campaigns, follow-up sequences). Legacy path /event-queues is also accepted.

📄 Full markdown: /api/auto-queues.md

GET /event-queues Scopes: automations:read

List automation event queues (drip sequences).

1 parameter
Name In Type Required Description
limit query number no

📄 /api/auto-queues/get-event-queues.md

POST /event-queues Scopes: automations:write

Create an automation event queue.

3 parameters
Name In Type Required Description
name body string yes
description body string no
respect_business_hours body boolean no Respect business hours: when true, steps only send during the workspace business-hours window (held to the next window otherwise). Defaults to false.

📄 /api/auto-queues/post-event-queues.md

PATCH /event-queues/:queue_id Scopes: automations:write

Update an event queue.

4 parameters
Name In Type Required Description
queue_id path string yes
name body string no
description body string no
respect_business_hours body boolean no Respect business hours: when true, steps only send during the workspace business-hours window (held to the next window otherwise). Defaults to false.

📄 /api/auto-queues/patch-event-queues-queue-id.md

GET /event-queues/:queue_id/board Scopes: automations:read

Read-only kanban-shaped state for an Auto Queue. Returns active enrolments bucketed into columns by the step they last completed (column 0 = "Awaiting Step 1"; column N = after step N), plus terminal counts (completed / cancelled). Use this to answer "where is contact X in queue Y" or "how many contacts are at each step" without grouping per-task rows from list_auto_queue_enrollments client-side. Each column returns up to 50 cards — for terminal-state drill-in, call list_auto_queue_enrollments with status=completed or status=cancelled.

1 parameter
Name In Type Required Description
queue_id path string yes

📄 /api/auto-queues/get-event-queues-queue-id-board.md

POST /event-queues/:queue_id/bulk-enroll Scopes: automations:write

Bulk-enrol contacts or deals in an event queue.

3 parameters
Name In Type Required Description
queue_id path string yes
entity_type body string yes
entity_ids body array yes

📄 /api/auto-queues/post-event-queues-queue-id-bulk-enroll.md

POST /event-queues/:queue_id/remove-enrollment Scopes: automations:write

Remove a contact or deal from an auto queue (drip sequence) by cancelling their pending steps. Pass queue_id plus ONE of: enrollment_id (most precise — from get_auto_queue_board cards or list_auto_queue_enrollments), contact_id, or deal_id. This is the direct unenrol — no need to build, enable, and trigger a remove_from_event_queue automation. Returns cancelled_count (the real number of pending steps stopped) and a message; cancelled_count: 0 with an explanatory message means nothing was pending for that enrolment (already completed, already removed, or never enrolled).

4 parameters
Name In Type Required Description
queue_id path string yes The auto queue UUID.
enrollment_id body string no Preferred. The enrolment UUID from the board or enrollments list.
contact_id body string no Cancel this contact's pending steps in the queue.
deal_id body string no Cancel this deal's pending steps in the queue.

📄 /api/auto-queues/post-event-queues-queue-id-remove-enrollment.md

POST /event-queues/:queue_id/steps Scopes: automations:write

Add a step to an event queue.

4 parameters
Name In Type Required Description
queue_id path string yes
automation_id body string yes
step_order body number yes
delay_minutes body number no

📄 /api/auto-queues/post-event-queues-queue-id-steps.md

Auto Schedules (9 endpoints)

Create clock-driven automation schedules that fire on a cron expression, fan out to a resolved audience, and trigger one automation run per row. Legacy path /event-schedules is also accepted.

📄 Full markdown: /api/auto-schedules.md

GET /event-schedules Scopes: schedules:read

List automation event schedules (fire at wall-clock cron expressions).

1 parameter
Name In Type Required Description
limit query number no

📄 /api/auto-schedules/get-event-schedules.md

POST /event-schedules Scopes: schedules:write

Create an automation event schedule. Accepts cron_expression or time_of_day. The Source Data (what feeds the automation) is set by source_kind: "audience" (default, CRM records via audience_type/audience_filter), "external_feed" (poll a JSON URL via source_config), or "static" (fixed trigger data via source_config).

9 parameters
Name In Type Required Description
name body string yes
source_kind body string no Source of rows: 'audience' (default), 'external_feed', or 'static'. Each resolved row fires the automation once with the row's fields as trigger_data.
audience_type body string no Required when source_kind='audience'. One of: users, tasks_by_assignee, contacts, deals.
automation_id body string yes
cron_expression body string no
time_of_day body string no
timezone body string no
audience_filter body object no
source_config body object no Config for non-audience sources. external_feed: { feed_url (required, tokenised JSON URL), format:'json_array', dedupe_key (required, the record key holding the stable external id), first_run:'seed'|'import_all' (default 'seed' = record everything as seen and import nothing on the first fire), filters:[{ field, op:'not_empty'|'equals'|'not_equals'|'in', value? }] }. static: { trigger_data:{...} } (one fixed row per fire) or { rows:[{...}] }. Feed field mapping to lead fields lives in the attached automation's create_lead action, using sanitised {{token}} names.

📄 /api/auto-schedules/post-event-schedules.md

POST /event-schedules/preview-cron Scopes: schedules:read

Validate a cron expression and return the next N firing times.

3 parameters
Name In Type Required Description
cron_expression body string yes
timezone body string no
n body number no

📄 /api/auto-schedules/post-event-schedules-preview-cron.md

PATCH /event-schedules/:schedule_id Scopes: schedules:write

Update an event schedule.

12 parameters
Name In Type Required Description
schedule_id path string yes
name body string no
cron_expression body string no
time_of_day body string no
timezone body string no
source_kind body string no 'audience' (default), 'external_feed', or 'static'.
audience_type body string no
audience_filter body object no Optional audience filter (shape depends on audience_type). Notably metadata_date_within = { field_id, min_days?, max_days? } targets contacts/deals whose custom datetime field (<entity>.metadata.<field_id>) falls between today+min_days and today+max_days. See create_auto_schedule for the full per-type filter shape.
source_config body object no Config for external_feed/static sources. See create_auto_schedule for the full shape.
is_active body boolean no
end_at body string no
max_runs body number no

📄 /api/auto-schedules/patch-event-schedules-schedule-id.md

SCHEDULING (23 endpoints)

scheduling endpoints.

📄 Full markdown: /api/scheduling.md

GET /scheduling/event-types Scopes: scheduling:read

List the workspace scheduled event types (meeting templates). Use to find event_type_id for get_available_slots and create_booking.

📄 /api/scheduling/get-scheduling-event-types.md

POST /scheduling/event-types Scopes: scheduling:write

Create a new scheduled event type (meeting template).

4 parameters
Name In Type Required Description
name body string yes
duration_minutes body number no
host_user_id body string no
description body string no

📄 /api/scheduling/post-scheduling-event-types.md

PATCH /scheduling/event-types/:event_type_id Scopes: scheduling:write

Update a scheduled event type.

6 parameters
Name In Type Required Description
event_type_id path string yes
name body string no
duration_minutes body number no
host_user_id body string no
description body string no
embed_config body object no Embed theme for the /embed booking page (colours, card style, width). Keys: surface, pageBg, field, text, muted, border, primary, secondary, cardStyle ("card"|"flat"), showLogoHeader (bool), maxWidth ("sm"|"md"|"lg"|"full"), align ("left"|"center"). Only affects the embeddable variant, not the public booking link.

📄 /api/scheduling/patch-scheduling-event-types-event-type-id.md

PUT /scheduling/availability Scopes: scheduling:write

Update workspace working hours and date overrides.

2 parameters
Name In Type Required Description
working_hours body object no
overrides body array no

📄 /api/scheduling/put-scheduling-availability.md

POST /scheduling/available-slots Scopes: scheduling:read

Get available booking slots for a scheduled event type within a date range. Returns slot start times in host timezone.

4 parameters
Name In Type Required Description
event_type_id body string yes
start_date body string yes
end_date body string yes
timezone body string no

📄 /api/scheduling/post-scheduling-available-slots.md

POST /scheduling/check-availability Scopes: scheduling:read

Quick check whether a specific slot is available. Returns nearest available alternatives if not.

2 parameters
Name In Type Required Description
event_type_id body string yes
slot body string yes ISO datetime

📄 /api/scheduling/post-scheduling-check-availability.md

POST /scheduling/voice/schedule-callback Scopes: scheduling:write

AI voice agent — schedule an automatic AI callback at the time the caller requested. Rings them back from the agent's outbound number; phone is auto-resolved from the call. Pass callback_day + callback_time + state; the server works out the absolute date in the caller's timezone, so never compute a date yourself.

3 parameters
Name In Type Required Description
callback_day body string no Day to call back: "today", "tomorrow", a weekday, or YYYY-MM-DD. Do NOT compute a date.
callback_time body string yes Clock time the caller wants, e.g. "3pm", "2:30pm", "14:00".
state body string no Caller state/territory for timezone (e.g. QLD, NSW, VIC).

📄 /api/scheduling/post-scheduling-voice-schedule-callback.md

POST /scheduling/voice/:event_type_id/book Scopes: scheduling:write

AI voice agent — create a booking from voice flow.

3 parameters
Name In Type Required Description
event_type_id path string yes
slot body string yes
invitee_name body string no

📄 /api/scheduling/post-scheduling-voice-event-type-id-book.md

GET /scheduling/bookings Scopes: scheduling:read

List bookings (calendar appointments). Filter by date, contact, host, status.

9 parameters
Name In Type Required Description
limit query number no
after query string no
contact_id query string no
customer_id query string no
deal_id query string no
host_id query string no
status query string no
from query string no
to query string no

📄 /api/scheduling/get-scheduling-bookings.md

POST /scheduling/bookings Scopes: scheduling:write

Create a calendar booking. Use get_available_slots first to find a valid start_time.

7 parameters
Name In Type Required Description
event_type_id body string yes
start_time body string yes
invitee_email body string yes
invitee_name body string no
contact_id body string no
deal_id body string no
notes body string no

📄 /api/scheduling/post-scheduling-bookings.md

GET /scheduling/bookings/:booking_id Scopes: scheduling:read

Fetch a single booking by UUID with event details, invitee, host, status, linked records.

1 parameter
Name In Type Required Description
booking_id path string yes

📄 /api/scheduling/get-scheduling-bookings-booking-id.md

POST /scheduling/bookings/:booking_id/reschedule Scopes: scheduling:write

Reschedule a booking. Use get_available_slots to find a valid new slot.

3 parameters
Name In Type Required Description
booking_id path string yes
slot body string yes
reason body string no

📄 /api/scheduling/post-scheduling-bookings-booking-id-reschedule.md

Email (21 endpoints)

Send and receive emails via TrustPager Mail or Gmail, manage threads, view logs, and configure email settings. Supports provider selection for Gmail integration.

📄 Full markdown: /api/email.md

GET /email/threads Scopes: email:read

List email threads in the workspace inbox. Filter by contact_id, customer_id, deal_id, unread.

6 parameters
Name In Type Required Description
limit query number no
after query string no
contact_id query string no
customer_id query string no
deal_id query string no
unread query boolean no

📄 /api/email/get-email-threads.md

GET /email/threads/:thread_id Scopes: email:read

Fetch a single email thread by UUID with all messages in chronological order.

1 parameter
Name In Type Required Description
thread_id path string yes

📄 /api/email/get-email-threads-thread-id.md

PATCH /email/threads/:thread_id Scopes: email:write

Update an email thread. Mutate read/status, or link the thread to an opportunity / contact / customer so it appears on the deal activity feed and in list_email_threads?opportunity_id=. Useful when send_email was called without an opportunity_id and you need to attach the thread after the fact.

6 parameters
Name In Type Required Description
thread_id path string yes
is_read body boolean no
status body string no active | archived | spam
link_opportunity_id body string no Link this thread to an opportunity UUID. Idempotent — safe to call repeatedly.
link_contact_id body string no Link this thread to a contact UUID. Idempotent.
link_customer_id body string no Link this thread to a customer UUID. Idempotent.

📄 /api/email/patch-email-threads-thread-id.md

POST /email/send Scopes: email:send

Send a new email from the user default outbound address. For replies use reply_to_email. Costs credits. Pass opportunity_id (canonical) or deal_id (legacy alias) to auto-link the resulting thread to a deal. Set raw_html: true to send a fully-designed HTML email verbatim with no TrustPager header/footer chrome (for pixel-perfect branded sends). Attachments are supported on both the TrustPager Mail rail (<=7MB total) and the Gmail rail (<=25MB total).

10 parameters
Name In Type Required Description
to_email body string yes
subject body string yes
html_body body string yes
cc body array no
bcc body array no
contact_id body string no
opportunity_id body string no Link to an opportunity UUID. Stamps email_logs.deal_id and registers the thread under the opportunity activity feed.
deal_id body string no Legacy alias for opportunity_id.
raw_html body boolean no When true, send html_body verbatim with no header/footer chrome for fully-designed branded emails. Default false wraps the body in the standard branded template.
attachments body array no File attachments. Supported on TrustPager Mail (<=7MB total) and Gmail (<=25MB total). Max 20 items. Each item: {file_id} for a CRM-stored file (fetched server-side), or {filename, mime_type, content} for base64 inline content.

📄 /api/email/post-email-send.md

POST /email/send-with-file Scopes: files:reademail:send

Send an email with a workspace CRM file attached. Costs credits. Works on both TrustPager Mail (<=7MB) and Gmail (<=25MB) rails. Pass opportunity_id (canonical) or deal_id (legacy alias) to auto-link the resulting thread to a deal.

9 parameters
Name In Type Required Description
file_id body string yes
to_email body string yes
subject body string yes
html_body body string yes
cc body array no
bcc body array no
contact_id body string no
opportunity_id body string no Link to an opportunity UUID. Stamps email_logs.deal_id and registers the thread under the opportunity activity feed.
deal_id body string no Legacy alias for opportunity_id.

📄 /api/email/post-email-send-with-file.md

POST /email/reply Scopes: email:send

Reply to an existing email thread, preserving threading. Costs credits.

4 parameters
Name In Type Required Description
thread_id body string yes
to_email body string yes
reply_html body string yes
cc body array no

📄 /api/email/post-email-reply.md

POST /email/save-attachment Scopes: email:readfiles:write

Save an email attachment to the workspace files.

3 parameters
Name In Type Required Description
thread_id body string yes
attachment_id body string yes
folder_id body string no

📄 /api/email/post-email-save-attachment.md

GET /email/capabilities Scopes: email:read

Get the workspace email send capability summary — connected accounts, daily limits, configured aliases.

📄 /api/email/get-email-capabilities.md

GET /email/logs Scopes: email:read

List recent outbound email send log entries.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/email/get-email-logs.md

POST /email/configs Scopes: email-config:write

Create a new outbound email sender config.

4 parameters
Name In Type Required Description
from_email_handle body string yes
from_name body string yes
staff_email body string yes
reply_to body string no

📄 /api/email/post-email-configs.md

GET /email/configs/:config_id Scopes: email:read

Fetch a single email config by UUID.

1 parameter
Name In Type Required Description
config_id path string yes

📄 /api/email/get-email-configs-config-id.md

PATCH /email/configs/:config_id Scopes: email-config:write

Update an email config. To send from your own verified domain, pass from_email_handle (local-part) + from_email_domain (a verified sending domain). Set preferred_provider to choose the workspace rail.

7 parameters
Name In Type Required Description
config_id path string yes
from_name body string no
reply_to body string no
staff_email body string no
from_email_handle body string no Local-part of the sender address (before the @). With no from_email_domain it composes <handle>@mail.trustpager.net.
from_email_domain body string no A verified sending domain for this workspace (see list_sending_domains). Composes from_email = <handle>@<domain>, e.g. support@yourcompany.com. Must be verified first.
preferred_provider body string no Default Workspace Email Address rail: "trustpager_mail" (send via your verified domain, never expires) or "gmail" (send via connected Team Gmail).

📄 /api/email/patch-email-configs-config-id.md

DELETE /email/configs/:config_id Scopes: email-config:delete

Delete an email config by UUID. Destructive.

1 parameter
Name In Type Required Description
config_id path string yes

📄 /api/email/delete-email-configs-config-id.md

GET /email/sending-domains Scopes: email:read

List the workspace's bring-your-own sending domains and their verification status. A verified domain lets you send from your own address (e.g. support@yourcompany.com) instead of @mail.trustpager.net.

📄 /api/email/get-email-sending-domains.md

POST /email/sending-domains Scopes: email-config:write

Register your own domain for sending. Returns two DNS records (a DKIM TXT and a Return-Path CNAME) to add at your DNS host — no SPF or MX change, your existing inbox keeps receiving. After adding them, call verify_sending_domain. Once verified, set it as the sending address via update_email_config { from_email_domain }.

1 parameter
Name In Type Required Description
domain body string yes Bare domain, e.g. "yourcompany.com". No scheme, no @, no path.

📄 /api/email/post-email-sending-domains.md

POST /email/sending-domains/:domain_id/verify Scopes: email-config:write

Re-check DNS for a sending domain and return its current verification state. Call after adding the DNS records. DNS can take a few minutes to propagate. status becomes "verified" once both DKIM and Return-Path resolve.

1 parameter
Name In Type Required Description
domain_id path string yes

📄 /api/email/post-email-sending-domains-domain-id-verify.md

DELETE /email/sending-domains/:domain_id Scopes: email-config:delete

Remove a sending domain. Refused if it is currently your sending address (change update_email_config { from_email_domain } first). Otherwise removes it from TrustPager Mail entirely.

1 parameter
Name In Type Required Description
domain_id path string yes

📄 /api/email/delete-email-sending-domains-domain-id.md

Email Campaigns (10 endpoints)

Create and send bulk broadcast email campaigns to segmented audiences. Supports tag-based and pipeline-based audience filters, delivery tracking (opens, clicks, bounces), and automatic unsubscribe management.

📄 Full markdown: /api/email-campaigns.md

GET /email-campaigns Scopes: email-blasts:read

List email marketing campaigns (blasts).

2 parameters
Name In Type Required Description
limit query number no
status query string no

📄 /api/email-campaigns/get-email-campaigns.md

POST /email-campaigns Scopes: email-blasts:write

Create an email marketing campaign.

4 parameters
Name In Type Required Description
name body string yes
subject body string no
html_body body string no
audience_filter body object no

📄 /api/email-campaigns/post-email-campaigns.md

PATCH /email-campaigns/:campaign_id Scopes: email-blasts:write

Update an email campaign.

4 parameters
Name In Type Required Description
campaign_id path string yes
name body string no
subject body string no
html_body body string no

📄 /api/email-campaigns/patch-email-campaigns-campaign-id.md

POST /email-campaigns/:campaign_id/send Scopes: email-blasts:write

Trigger sending of an email campaign to its saved audience. Costs credits per recipient. Optionally override the content for this send (subject, body_html, intro_text, cta_text, cta_url, show_reply_button) — the overrides are written onto the blast before it fires. The audience is NOT overridable here; it stays set on the blast.

7 parameters
Name In Type Required Description
campaign_id path string yes
subject body string no Optional. Override the blast subject for this send.
body_html body string no Optional. Override the blast HTML body for this send.
intro_text body string no Optional. Override the intro text for this send.
cta_text body string no Optional. Override the CTA button text.
cta_url body string no Optional. Override the CTA button URL.
show_reply_button body boolean no Optional. Toggle the reply button for this send.

📄 /api/email-campaigns/post-email-campaigns-campaign-id-send.md

GET /email-campaigns/:campaign_id/recipients Scopes: email-blasts:read

List recipients of an email blast with delivery status. Add ?send_id=… to scope to one run.

2 parameters
Name In Type Required Description
campaign_id path string yes
send_id query string no

📄 /api/email-campaigns/get-email-campaigns-campaign-id-recipients.md

SMS (6 endpoints)

Send and receive SMS messages. View conversations and message history.

📄 Full markdown: /api/sms.md

GET /sms/conversations Scopes: sms:read

List SMS conversations in the workspace inbox. Supports filtering by contact_id, customer_id, and unread status.

5 parameters
Name In Type Required Description
limit query number no
after query string no
contact_id query string no
customer_id query string no
unread query boolean no

📄 /api/sms/get-sms-conversations.md

POST /sms/conversations/mark-read Scopes: sms:write

Mark multiple SMS conversations as read at once.

1 parameter
Name In Type Required Description
conversation_ids body array yes

📄 /api/sms/post-sms-conversations-mark-read.md

GET /sms/conversations/:conversation_id Scopes: sms:read

Fetch a single SMS conversation by UUID, including the full message history.

1 parameter
Name In Type Required Description
conversation_id path string yes

📄 /api/sms/get-sms-conversations-conversation-id.md

PATCH /sms/conversations/:conversation_id Scopes: sms:write

Update an SMS conversation (e.g. mark read, archive).

3 parameters
Name In Type Required Description
conversation_id path string yes
is_read body boolean no
is_archived body boolean no

📄 /api/sms/patch-sms-conversations-conversation-id.md

POST /sms/send Scopes: sms:send

Send an SMS message from a workspace phone number. `phone_number_id` is OPTIONAL — when omitted, auto-resolves to the workspace's single active SMS-capable phone number (the common case). Only pass `phone_number_id` if the workspace has multiple SMS numbers and you need to choose one; in that case call `list_phone_numbers` first and never invent a UUID. Keep under 160 chars where possible. Costs credits.

5 parameters
Name In Type Required Description
to_number body string yes Recipient phone in E.164, e.g. +61431377068
message body string yes SMS body. Keep concise — ideally under 160 chars.
phone_number_id body string no OPTIONAL. UUID of the workspace phone number to send from. Omit to auto-pick the single active SMS-capable number. If the workspace has multiple SMS numbers, call list_phone_numbers first.
contact_id body string no
deal_id body string no

📄 /api/sms/post-sms-send.md

WhatsApp (14 endpoints)

Send and receive WhatsApp messages. Pair a phone number, view 1:1 conversations and group conversations, send messages, and manage CRM links.

📄 Full markdown: /api/whatsapp.md

GET /whatsapp/conversations Scopes: whatsapp:read

List WhatsApp 1:1 conversations in the workspace inbox. Supports filtering by external_phone_number and unread.

4 parameters
Name In Type Required Description
limit query number no
after query string no
external_phone_number query string no
unread query boolean no

📄 /api/whatsapp/get-whatsapp-conversations.md

PATCH /whatsapp/conversations/:conversation_id Scopes: whatsapp:write

Update a WhatsApp conversation (e.g. mark read, archive).

3 parameters
Name In Type Required Description
conversation_id path string yes
unread_count body number no
status body string no

📄 /api/whatsapp/patch-whatsapp-conversations-conversation-id.md

POST /whatsapp/send Scopes: whatsapp:send

Send a WhatsApp message to a contact. Provide either to_phone (E.164) or conversation_id. Costs credits.

6 parameters
Name In Type Required Description
to_phone body string no Recipient phone in E.164, e.g. +61431377068
body body string yes WhatsApp message body (text only in v1).
conversation_id body string no Existing conversation UUID. Mutually exclusive with to_phone.
contact_id body string no
deal_id body string no
customer_id body string no

📄 /api/whatsapp/post-whatsapp-send.md

POST /whatsapp/groups/send Scopes: whatsapp:send

Send a WhatsApp message into a registered group. Group must be visible to the workspace (paired account is a member). Costs credits.

2 parameters
Name In Type Required Description
group_id body string yes TrustPager whatsapp_groups UUID (not the WhatsApp JID).
body body string yes Message body (text only in v1).

📄 /api/whatsapp/post-whatsapp-groups-send.md

GET /whatsapp/groups Scopes: whatsapp:read

List WhatsApp groups the workspace's paired account is in. Filter by linked_deal_id, linked_customer_id, or unlinked.

5 parameters
Name In Type Required Description
limit query number no
after query string no
linked_deal_id query string no
linked_customer_id query string no
linked query boolean no true = only linked groups, false = only unlinked

📄 /api/whatsapp/get-whatsapp-groups.md

GET /whatsapp/groups/:group_id Scopes: whatsapp:read

Fetch a single WhatsApp group by UUID, including member list snapshot.

1 parameter
Name In Type Required Description
group_id path string yes

📄 /api/whatsapp/get-whatsapp-groups-group-id.md

POST /whatsapp/groups/:group_id/link Scopes: whatsapp:write

Link a WhatsApp group to a deal or customer so its messages appear in the deal/customer timeline.

3 parameters
Name In Type Required Description
group_id path string yes
deal_id body string no
customer_id body string no

📄 /api/whatsapp/post-whatsapp-groups-group-id-link.md

POST /whatsapp/groups/:group_id/unlink Scopes: whatsapp:write

Remove a WhatsApp group's deal/customer link. The group remains visible in the inbox.

1 parameter
Name In Type Required Description
group_id path string yes

📄 /api/whatsapp/post-whatsapp-groups-group-id-unlink.md

GET /whatsapp/pairing Scopes: whatsapp:read

Get the workspace's WhatsApp pairing status (connected / awaiting_qr / disconnected / etc.) and paired phone identity.

📄 /api/whatsapp/get-whatsapp-pairing.md

POST /whatsapp/pair Scopes: whatsapp:write

Begin pairing a WhatsApp account to the workspace. Returns a QR code data URL the user scans with their phone (Settings → Linked Devices → Link a Device). The pairing becomes "connected" automatically once they scan.

📄 /api/whatsapp/post-whatsapp-pair.md

POST /whatsapp/disconnect Scopes: whatsapp:write

Disconnect the workspace's WhatsApp pairing. Deletes the Evolution instance and clears the pairing row. Use to re-pair against a different phone.

📄 /api/whatsapp/post-whatsapp-disconnect.md

Phone (13 endpoints)

Manage phone numbers and call logs. Search for available numbers to purchase.

📄 Full markdown: /api/phone.md

POST /phone/numbers/search Scopes: phone:read

Search for available phone numbers to purchase.

3 parameters
Name In Type Required Description
country_code body string no
area_code body string no
contains body string no

📄 /api/phone/post-phone-numbers-search.md

POST /phone/numbers/buy Scopes: phone:write

Buy a phone number. Costs credits and recurring fees.

2 parameters
Name In Type Required Description
phone_number body string yes
friendly_name body string no

📄 /api/phone/post-phone-numbers-buy.md

PATCH /phone/numbers/:phone_number_id Scopes: phone:write

Update a phone number: friendly_name, voice-agent routing, the outbound in-app-dialler allowlist, and the "When Busy" no-answer fallback. IMPORTANT: binding an agent here (inbound_voice_agent_id / outbound_voice_agent_id) controls INBOUND answering (who picks up calls TO this number) and is one-agent-per-number. OUTBOUND dialling does NOT use this binding; set the caller-ID number on the agent via create_voice_agent_outbound_config (default_phone_number_id), which lets one number serve many agents. outbound_caller_user_ids restricts which workspace users may present THIS number as caller ID from the in-app dialler ("Call from TrustPager"): pass an array of user IDs to restrict to exactly those people, or [] / null to let anyone with calling permission dial from it (the default). Every ID must be a member of this workspace. Toll-free numbers (1800/1300) cannot dial out at all. WHEN BUSY (Answer-in-TrustPager numbers only): when the number rings staff browsers ("Answer in TrustPager") and nobody answers within ring_timeout_seconds, no_answer_action decides what happens next instead of dropping the call: "voicemail" (record a message; needs voicemail_greeting_text or voicemail_greeting_audio_url, else a default greeting is spoken; the recording is transcribed and attached to the caller's contact), "forward" (ring no_answer_forward_number), "agent" (hand to the AI voice agent no_answer_agent_config_id), or "none"/null to disable the fallback. no_answer_agent_config_id must be a voice agent in this workspace.

12 parameters
Name In Type Required Description
phone_number_id path string yes
friendly_name body string no
inbound_voice_agent_id body string no
outbound_voice_agent_id body string no
outbound_caller_user_ids body array no User IDs allowed to dial out from this number via the in-app dialler. [] or null = anyone with calling permission.
ring_timeout_seconds body integer no How long (5-120s, default 25) to ring staff browsers before the When Busy fallback fires. Answer-in-TrustPager numbers only.
no_answer_action body string no What to do when no one answers an Answer-in-TrustPager call. null/"none" = drop (no fallback).
no_answer_forward_number body string no E.164 number to ring when no_answer_action = "forward".
no_answer_agent_config_id body string no Voice agent (this workspace) to hand the call to when no_answer_action = "agent".
voicemail_greeting_text body string no Spoken greeting for no_answer_action = "voicemail" (max 1000 chars). Ignored if voicemail_greeting_audio_url is set.
voicemail_greeting_audio_url body string no http(s) URL of a pre-generated greeting audio to play for voicemail (e.g. from ai_generate_speech). Takes priority over voicemail_greeting_text.
allowed_inbound_country_list body array no Restrict which countries may call this number IN. Array of ISO 3166-1 alpha-2 codes (e.g. ["AU"] for Australia only). Calls from any country not listed are rejected before reaching the agent (spam/fraud control). [] or null = allow all countries (the default).

📄 /api/phone/patch-phone-numbers-phone-number-id.md

POST /phone/addresses Scopes: phone:write

Create a regulatory address.

6 parameters
Name In Type Required Description
customer_name body string yes
street body string yes
city body string yes
region body string yes
postal_code body string yes
iso_country body string yes

📄 /api/phone/post-phone-addresses.md

POST /phone/bundles Scopes: phone:write

Create a regulatory bundle.

3 parameters
Name In Type Required Description
country_code body string yes
number_type body string yes
end_user_type body string yes

📄 /api/phone/post-phone-bundles.md

GET /phone/call-logs Scopes: calls:read

List phone-call records (inbound + outbound). USE THIS for any "recent calls", "phone call history", "missed calls", "who called", or similar phone-specific query. Returns the raw call log (timestamps, duration, direction, phone number, recording url, voice-agent linkage) — richer than list_activities for calls. Prefer this over list_activities when the user asks specifically about phone activity.

3 parameters
Name In Type Required Description
limit query number no
direction query string no inbound or outbound
contact_id query string no

📄 /api/phone/get-phone-call-logs.md

Agents (28 endpoints)

Manage AI voice agents and text agents under the unified /agents endpoint. Use ?type=voice or ?type=text to filter listings. The type field is required in the create body.

📄 Full markdown: /api/voice-agents.md

GET /voice-agents Scopes: voice-agents:read

List voice agents in the workspace.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/voice-agents/get-voice-agents.md

POST /voice-agents Scopes: voice-agents:write

Create a voice agent.

2 parameters
Name In Type Required Description
agent_name body string yes
voice_id body string no

📄 /api/voice-agents/post-voice-agents.md

POST /voice-agents/:agent_id/call Scopes: calls:initiate

Initiate an outbound voice call via this agent.

2 parameters
Name In Type Required Description
agent_id path string yes
to_number body string yes

📄 /api/voice-agents/post-voice-agents-agent-id-call.md

POST /voice-agents/:agent_id/outbound-config Scopes: voice-agents:write

Enable OUTBOUND dialling for a voice agent. Set default_phone_number_id to an imported number: that number becomes the caller ID and is all outbound needs (each call passes the agent itself, so no number-level binding is required and ONE number can be the default for many agents). Do NOT use update_phone_number to bind the number to the agent for outbound; that binding is inbound-only. Per-agent, no website required.

2 parameters
Name In Type Required Description
agent_id path string yes
default_phone_number_id body string no

📄 /api/voice-agents/post-voice-agents-agent-id-outbound-config.md

GET /voice-agents/:agent_id/toolkit-access Scopes: voice-agents:read

Check whether a voice agent has toolkit access enabled (a non-expiring agent_toolkit:use key) and whether its in-call booking tools are on the native session-bound endpoints.

1 parameter
Name In Type Required Description
agent_id path string yes

📄 /api/voice-agents/get-voice-agents-agent-id-toolkit-access.md

POST /voice-agents/:agent_id/toolkit-access Scopes: voice-agents:write

Enable agent toolkit access for a voice agent: mint a non-expiring agent_toolkit:use key named after the agent, attach it, migrate the agent in-call booking tools (check_calendar_availability / book_appointment) off the legacy scheduling endpoints onto the session-bound native endpoints carrying that key, and publish. Fixes silent in-call booking failures caused by hand-pasted expiring keys. Idempotent.

1 parameter
Name In Type Required Description
agent_id path string yes

📄 /api/voice-agents/post-voice-agents-agent-id-toolkit-access.md

DELETE /voice-agents/:agent_id/toolkit-access Scopes: voice-agents:write

Disable agent toolkit access: deactivate the agent dedicated toolkit key. In-call booking stops working until re-enabled.

1 parameter
Name In Type Required Description
agent_id path string yes

📄 /api/voice-agents/delete-voice-agents-agent-id-toolkit-access.md

Agent Knowledge Bases (8 endpoints)

Manage Retell-backed knowledge bases for voice agents. Each KB stores documents that agents can retrieve during calls. KBs can be seeded from help center articles or populated with custom content. Required scopes: voice-kbs:read, voice-kbs:write, voice-kbs:delete. NOTE: Retell KB write API (create and add-sources) is occasionally unavailable -- if create or add_doc returns a 500, this is a Retell-side outage, not a TrustPager bug.

📄 Full markdown: /api/voice-agent-kbs.md

POST /voice-agent-kbs Scopes: voice-kbs:write

Create a new voice-agent knowledge base (Retell-backed).

2 parameters
Name In Type Required Description
name body string yes
description body string no

📄 /api/voice-agent-kbs/post-voice-agent-kbs.md

VOICE_CALL_DIRECTIVES (5 endpoints)

voice-call-directives endpoints.

📄 Full markdown: /api/voice-call-directives.md

GET /voice-directives Scopes: voice-directives:read

List call directives (e.g. business-hours forwarding) for the workspace.

4 parameters
Name In Type Required Description
directive_type query string no
voice_agent_config_id query string no
enabled query string no
limit query number no

📄 /api/voice-call-directives/get-voice-directives.md

POST /voice-directives Scopes: voice-directives:write

Create a call directive. For business_hours_forward, config needs forward_to (E.164), windows, timezone, and mode.

5 parameters
Name In Type Required Description
directive_type body string yes
voice_agent_config_id body string no
enabled body boolean no
priority body number no
config body object no

📄 /api/voice-call-directives/post-voice-directives.md

PATCH /voice-directives/:directive_id Scopes: voice-directives:write

Update a call directive (enable/disable, priority, config).

4 parameters
Name In Type Required Description
directive_id path string yes
enabled body boolean no
priority body number no
config body object no

📄 /api/voice-call-directives/patch-voice-directives-directive-id.md

Text Agents (6 endpoints)

Text agents are now part of the unified /agents endpoint. Use GET /agents?type=text to list text agents. See the Agents resource group for full documentation.

📄 Full markdown: /api/text-agents.md

GET /agents/:id Scopes: voice-agents:read

Retrieve a text agent. Auto-detects type.

1 parameter
Name In Type Required Description
id path uuid yes Text agent ID

📄 /api/text-agents/get-agents-id.md

POST /agents Scopes: voice-agents:write

Create a text agent. Include "type": "text" and "name" in the request body.

2 parameters
Name In Type Required Description
type body string yes Must be "text"
name body string yes Agent name

📄 /api/text-agents/post-agents.md

PATCH /agents/:id Scopes: voice-agents:write

Update a text agent. Auto-detects type.

1 parameter
Name In Type Required Description
id path uuid yes Text agent ID

📄 /api/text-agents/patch-agents-id.md

DELETE /agents/:id Scopes: voice-agents:write

Delete a text agent. Auto-detects type.

1 parameter
Name In Type Required Description
id path uuid yes Text agent ID

📄 /api/text-agents/delete-agents-id.md

GET /agents/:id/responses Scopes: voice-agents:read

List responses generated by a text agent.

1 parameter
Name In Type Required Description
id path uuid yes Text agent ID

📄 /api/text-agents/get-agents-id-responses.md

Transcripts (10 endpoints)

Transcribe call recordings and meetings, view results, and access AI coaching. Use POST /transcripts/transcribe to kick off transcription from any audio URL. Coaching results are under /transcripts/coaching.

📄 Full markdown: /api/transcripts.md

POST /transcripts/transcribe Scopes: transcripts:write

Kick off transcription of an audio/video recording via Whisper. Lands as a transcript in /inbox/phone-calls or /inbox/meetings and creates a single linked crm_activities row. Pass deal_id/contact_id when known at recording time to authoritatively link the activity (skips post-hoc phone/email matching). Set participants[].role to "caller" for the workspace user side so their email/phone is excluded from contact-matching.

13 parameters
Name In Type Required Description
recording_url body string yes Publicly fetchable HTTPS URL, or a TrustPager-rehosted private R2 URL. For raw Twilio recording URLs also pass recording_auth.
recording_auth body string no Optional basic-auth credentials "USER:PASSWORD". For Twilio: "ACCOUNT_SID:AUTH_TOKEN".
title body string yes Display title shown on the transcript and on the auto-created activity.
type body string yes phone_call (or alias "call") -> /inbox/phone-calls. meeting -> /inbox/meetings. voicemail -> /inbox.
source body string no Producer label for filtering later. Defaults to "api".
source_id body string no Optional foreign key in the producer system (call_sid, upload_id). Stored on metadata.
occurred_at body string no ISO timestamp the audio was captured. Defaults to now.
participants body array no Speakers on the recording. Used for diarisation AND for auto-linking to contacts/deals (by email and phone-last-9). Set role="caller" on the workspace-user side to exclude them from contact-matching.
metadata body object no Free-form metadata to attach to the transcript row.
contact_id body string no Authoritative callee contact known at recording time (e.g. softphone dialed from a contact card). Overrides the matcher's best guess for the activity's contact_id.
deal_id body string no Authoritative opportunity known at recording time (e.g. softphone dialed from an opportunity page). The activity is linked directly to this deal instead of being inferred by phone/email matching.
model body string no Override the workspace default. whisper-1 is forced internally regardless (needed for verbose_json diarisation).
existing_transcript_id body string no UUID of an existing transcript to overwrite. Used for fallback/retry flows.

📄 /api/transcripts/post-transcripts-transcribe.md

GET /transcripts/coaching Scopes: transcripts:read

List AI call-coaching results across all transcripts.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/transcripts/get-transcripts-coaching.md

GET /transcripts Scopes: transcripts:read

List call and meeting transcripts. Filter by participant (email or phone), type, source, status, or date. Use before ai_transcript_summary.

15 parameters
Name In Type Required Description
limit query number no
after query string no
type query string no phone_call -> /inbox/phone-calls, meeting -> /inbox/meetings.
source query string no Producer label (e.g. retell, recall, twilio-call, api).
transcription_status query string no Only "complete" rows have transcript_text.
occurred_after query string no ISO timestamp lower bound on occurred_at.
occurred_before query string no ISO timestamp upper bound on occurred_at.
participant_email query string no Find transcripts where a participant has this email (exact match).
participant_phone query string no Find transcripts where a participant has this phone. Digit-normalised last-9 match, so 0408119890, +61408119890 and 61408119890 all resolve to the same calls.
booking_id query string no Transcript recorded during a specific scheduling booking.
query query string no Partial, case-insensitive search on the transcript title.
contact_id query string no
customer_id query string no
deal_id query string no
since query string no

📄 /api/transcripts/get-transcripts.md

GET /transcripts/:transcript_id Scopes: transcripts:read

Fetch a single transcript by UUID — full text + speaker segments. Use with ai_transcript_summary for highlights.

1 parameter
Name In Type Required Description
transcript_id path string yes

📄 /api/transcripts/get-transcripts-transcript-id.md

PATCH /transcripts/:transcript_id Scopes: transcripts:write

Update a transcript (e.g. rename, re-link to a contact/deal).

4 parameters
Name In Type Required Description
transcript_id path string yes
title body string no
contact_id body string no
deal_id body string no

📄 /api/transcripts/patch-transcripts-transcript-id.md

DELETE /transcripts/:transcript_id Scopes: transcripts:delete

Delete a transcript by UUID. Destructive — also removes associated recording from storage.

1 parameter
Name In Type Required Description
transcript_id path string yes

📄 /api/transcripts/delete-transcripts-transcript-id.md

Document Templates (12 endpoints)

Manage document templates with sections for proposals, contracts, and more.

📄 Full markdown: /api/document-templates.md

POST /document-templates/:template_id/render Scopes: documents:write

Render a document template to PDF and save to the file library (costs credits). Pass deal_id to auto-fill {{tokens}} from that opportunity. Set preview:true for a FREE dry-run that returns the rendered HTML + any unresolved_tokens WITHOUT saving or charging — use it to validate merge fields before send_for_signing (which resolves strictly and blocks on any gap).

9 parameters
Name In Type Required Description
template_id path string yes
deal_id body string no Opportunity to resolve merge tokens from.
preview body boolean no true = free dry-run: return html + unresolved_tokens + would_send, no PDF saved, no credits charged.
variables body object no Extra {{token}} values merged on top of the opportunity data.
strict_tokens body boolean no true = fail if any token is unresolved (ignored when preview:true).
folder body string no
filename body string no
document_type body string no
data body object no

📄 /api/document-templates/post-document-templates-template-id-render.md

Documents (6 endpoints)

Manage CRM documents (uploaded files). Supports folders, downloads via signed URLs, and CRUD operations.

📄 Full markdown: /api/documents.md

GET /documents Scopes: documents:read

List all documents. Supports folder, document_type, and search filters.

3 parameters
Name In Type Required Description
folder query string no Filter by folder name
document_type query string no Filter by document type
search query string no Search by name

📄 /api/documents/get-documents.md

GET /documents/:id Scopes: documents:read

Retrieve a document.

1 parameter
Name In Type Required Description
id path uuid yes Document ID

📄 /api/documents/get-documents-id.md

POST /documents Scopes: documents:write

Create a document record. name is required.

3 parameters
Name In Type Required Description
name body string yes Document name
folder body string no Folder name
document_type body string no Document type

📄 /api/documents/post-documents.md

GET /documents/:id/download Scopes: documents:read

Get a signed download URL for a document (expires in 60 seconds).

1 parameter
Name In Type Required Description
id path uuid yes Document ID

📄 /api/documents/get-documents-id-download.md

Signing (5 endpoints)

Manage e-signature envelopes. Send documents for signing and track completion status.

📄 Full markdown: /api/signing.md

GET /signing/envelopes Scopes: documents:read

List e-signing envelopes (documents sent for signature).

4 parameters
Name In Type Required Description
limit query number no
after query string no
status query string no
deal_id query string no

📄 /api/signing/get-signing-envelopes.md

POST /signing/send Scopes: signing:send

Send a document for e-signature. Requires a template and signers, plus an anchor: either deal_id (an opportunity) or referrer_contact_id (a referrer contact). Costs credits. Two delivery modes: default emails the signer a standalone e-sign link; deliver:"portal" instead surfaces the signing item inside the anchored client portal (find-or-created from portal_template_id) and SUPPRESSES the standalone email, so the signer signs in the portal reached via the portal invite. Set show_in_portal:true (additive) to surface the item in the portal AND still email the link.

11 parameters
Name In Type Required Description
template_id body string yes
signers body array yes
deal_id body string no Opportunity anchor. Provide this OR referrer_contact_id. (opportunity_id is accepted as an alias.)
opportunity_id body string no Alias for deal_id (the opportunity anchor).
referrer_contact_id body string no Referrer anchor (a crm_contacts id). Provide this OR deal_id. The portal is anchored to this contact.
subject body string no
message body string no
deliver body string no Delivery mode. "email" (default) sends the standalone e-sign link. "portal" surfaces the item in the anchored portal and suppresses the email.
portal_template_id body string no Portal template to stamp a fresh portal from when none exists for the anchor (used with deliver:"portal").
portal_members body array no Extra people to invite to the portal as members/viewers beyond the signers (deliver:"portal"). Each { email, name? }. Signers are invited automatically.
show_in_portal body boolean no Additive: surface the signing item inside the anchored client portal AND still email the link. Default false.

📄 /api/signing/post-signing-send.md

GET /signing/envelopes/:envelope_id Scopes: documents:read

Fetch a signing envelope by UUID — signer status, document state, audit trail.

1 parameter
Name In Type Required Description
envelope_id path string yes

📄 /api/signing/get-signing-envelopes-envelope-id.md

Forms (25 endpoints)

Create form templates, manage fields, send forms to contacts, and view submissions. Fields support CRM Variable Injection - map a field to a CRM variable so submitted values are written back to the linked deal, contact, or account before automations run.

📄 Full markdown: /api/forms.md

POST /forms/folders Scopes: forms:write

Create a form folder.

1 parameter
Name In Type Required Description
name body string yes

📄 /api/forms/post-forms-folders.md

GET /forms/submissions Scopes: forms:read

List form submissions.

2 parameters
Name In Type Required Description
template_id query string no
limit query number no

📄 /api/forms/get-forms-submissions.md

POST /forms/submissions/internal-fill Scopes: forms:write

Create an internal-fill submission for staff entry. No email, PIN pre-cleared.

2 parameters
Name In Type Required Description
template_id body string yes
deal_id body string yes

📄 /api/forms/post-forms-submissions-internal-fill.md

DELETE /forms/submissions/:submission_id Scopes: forms:delete

Permanently delete a form submission (and any uploaded files). Optional ?delete_archived_pdf=true also removes the auto-archived PDF in the Documents library. Cannot be undone.

2 parameters
Name In Type Required Description
submission_id path string yes
delete_archived_pdf query boolean no When true, also deletes the auto-archived PDF stored in crm_documents from this submission.

📄 /api/forms/delete-forms-submissions-submission-id.md

POST /forms/send Scopes: forms:send

Send a form to a recipient. Costs credits. To send to co-applicants (e.g. joint mortgage applicants) pass additional_recipients: they SHARE one submission with the primary recipient, each gets their own link + PIN, all write to the same answers, and any of them can finalize.

6 parameters
Name In Type Required Description
template_id body string yes
recipient_email body string yes Primary recipient email — owns the shared submission.
recipient_name body string yes
deal_id body string no Opportunity to link the submission to (preferred when the form is opportunity-scoped).
additional_recipients body array no Co-applicants who share ONE submission with the primary recipient. Each gets their own secure link + PIN; all write to the same responses; any can submit to finalize.
prefill body object no Prefill values keyed by each field's prefill key (set in the form builder under "Prefill via link"). Seeded onto the submission so the recipient opens the form pre-populated; fields set to hide-when-prefilled are filled silently. Example: { "broker_last_name": "Smith" }.

📄 /api/forms/post-forms-send.md

GET /forms/templates Scopes: forms:read

List form templates.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/forms/get-forms-templates.md

POST /forms/templates Scopes: forms:write

Create a form template.

1 parameter
Name In Type Required Description
name body string yes

📄 /api/forms/post-forms-templates.md

POST /forms/templates/:template_id/submit Scopes: forms:write

Submit a public form. Find-or-creates a contact + opportunity from the submitted answers (matched by the fields wired to contact.email / first_name / last_name / phone / account.name), then writes every wired field onto the records. The template must have public mode enabled. Credit-free.

3 parameters
Name In Type Required Description
template_id path string yes Form template id (must have public mode enabled).
responses body array no Submitted answers.
fields body object no Convenience alternative to responses — an object keyed by form field id with the answer as the value.

📄 /api/forms/post-forms-templates-template-id-submit.md

POST /forms/templates/:template_id/fields Scopes: forms:write

Add a field to a form template. The content JSON carries per-field config: static min/max on number fields (content.min/max), conditional visibility (content.visibility), and CROSS-FIELD VALIDATION on number/date fields via content.validation = { match: 'all'|'any', rules: [{ operator: 'lte'|'gte'|'lt'|'gt'|'date_after'|'date_before', target: { kind: 'literal', value: <number> } OR { kind: 'field', fieldId: '<other field id>', factor?: <number>, divideBy?: <number> }, message: '<shown when it fails>' }] }. Blocks submission when the value breaks the rule (e.g. IP benefit <= 70% of annual income / 12 => operator 'lte', target { kind:'field', fieldId:'<income field>', factor:0.7, divideBy:12 }); the target can be any other same-type field.

4 parameters
Name In Type Required Description
template_id path string yes
type body string yes
label body string yes
content body object no Per-field JSON config: options, crm_variable/crm_variable_mode, min/max, visibility, and validation (cross-field rule set; see the tool description).

📄 /api/forms/post-forms-templates-template-id-fields.md

PATCH /forms/templates/:template_id/fields/:field_id Scopes: forms:write

Update a form field. Pass content to change per-field config: min/max, visibility, CRM wiring, or cross-field validation. content.validation = { match: 'all'|'any', rules: [{ operator: 'lte'|'gte'|'lt'|'gt'|'date_after'|'date_before', target: { kind: 'literal', value: <number> } OR { kind: 'field', fieldId: '<other field id>', factor?: <number>, divideBy?: <number> }, message: '<shown when it fails>' }] } (number/date fields; blocks submission on a failing value). Pass { validation: null } inside content to clear it.

3 parameters
Name In Type Required Description
template_id path string yes
field_id path string yes
content body object no Per-field JSON config: options, crm_variable/crm_variable_mode, min/max, visibility, and validation (cross-field rule set; see the tool description).

📄 /api/forms/patch-forms-templates-template-id-fields-field-id.md

Websites (7 endpoints)

Manage TrustPager-hosted websites, pages, and page sections.

📄 Full markdown: /api/websites.md

POST /websites Scopes: websites:write

Create a new website. Registers the site record (site_key, domain, branding) used by public-form embeds and the website lead gateway.

2 parameters
Name In Type Required Description
name body string yes
domain body string no

📄 /api/websites/post-websites.md

GET /websites/:website_id Scopes: websites:read

Fetch a website by UUID, including site_key, domain, branding, navbar, footer, and SEO configuration.

1 parameter
Name In Type Required Description
website_id path string yes

📄 /api/websites/get-websites-website-id.md

PATCH /websites/:website_id Scopes: websites:write

Update a website: name, domain, branding, navbar, footer, SEO meta tags, lead gen form, or custom scripts.

1 parameter
Name In Type Required Description
website_id path string yes

📄 /api/websites/patch-websites-website-id.md

DELETE /websites/:website_id Scopes: websites:delete

Delete a website and its associated content. This action cannot be undone.

1 parameter
Name In Type Required Description
website_id path string yes

📄 /api/websites/delete-websites-website-id.md

GET /websites/:website_id/integration-guides Scopes: websites:read

List the copy-paste integration guides available for a website (e.g. blog). Each entry says whether anything is published yet. Use get_website_integration_guide to fetch the full instructions.

1 parameter
Name In Type Required Description
website_id path string yes

📄 /api/websites/get-websites-website-id-integration-guides.md

GET /websites/:website_id/integration-guides/:system|str Scopes: websites:read

Get the full copy-paste guide for wiring one TrustPager system into a website, pre-filled with this site's real site_key + slug. Hand the returned "guide" text straight to a web designer or their AI. system: notepads, email, documents, forms, scheduling, order-forms, stripe, docusign, voice-agent, voice-agent-outbound, outgoing-webhook, native-integrations. Call list_website_integration_guides to see them all.

2 parameters
Name In Type Required Description
website_id path string yes
system query string yes Which system to integrate: notepads | email | documents | forms | scheduling | order-forms | stripe | docusign | voice-agent | voice-agent-outbound | outgoing-webhook | native-integrations.

📄 /api/websites/get-websites-website-id-integration-guides-system-str.md

Order Forms (6 endpoints)

Manage payment order forms connected to Stripe for product purchases.

📄 Full markdown: /api/order-forms.md

GET /order-forms Scopes: forms:read

List order form configurations.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/order-forms/get-order-forms.md

POST /order-forms Scopes: forms:write

Create an order form configuration.

3 parameters
Name In Type Required Description
website_id body string yes
name body string no
config body object no

📄 /api/order-forms/post-order-forms.md

PATCH /order-forms/:order_form_id Scopes: forms:write

Update an order form configuration.

3 parameters
Name In Type Required Description
order_form_id path string yes
name body string no
config body object no

📄 /api/order-forms/patch-order-forms-order-form-id.md

Files (15 endpoints)

Unified file storage endpoint for all file types. Use ?type=document (private PDFs), ?type=image (public CDN/R2 images), or ?type=secure (confidential private files). Single-resource routes (/files/:id) auto-detect the type.

📄 Full markdown: /api/files.md

POST /files/folders Scopes: files:write

Create a new file folder.

1 parameter
Name In Type Required Description
name body string yes

📄 /api/files/post-files-folders.md

GET /files Scopes: files:read

List files in workspace storage. Filter by folder, type, or free-text search.

4 parameters
Name In Type Required Description
limit query number no
q query string no
folder_id query string no
type query string no

📄 /api/files/get-files.md

POST /files/upload Scopes: files:write

Upload a file to workspace storage. Pass type=document (PDF), type=image, or type=secure (private files — the default for spreadsheets, CSVs, Office docs, and anything else). Non-PDF files sent as type=document are auto-filed as secure files instead of rejected (the response meta returns auto_filed_as:"file"); attach those to an opportunity with add_opportunity_file, not add_opportunity_document.

📄 /api/files/post-files-upload.md

POST /files/bundle Scopes: files:read

Bundle up to 50 files (documents, images, or secure files) into a single ZIP. Auto-detects each file's type. Two response modes: default returns binary application/zip with Content-Disposition: attachment (best for direct browser downloads). Pass ?response=url to instead stage the ZIP in private storage and receive a 10-minute signed download URL — the right mode for API/MCP agents that can't consume large binary bodies. Max 50 files / 200MB total. Skipped files (storage errors) are listed in _manifest.txt inside the ZIP.

3 parameters
Name In Type Required Description
ids body array yes File UUIDs to bundle (1-50). Mix of document / image / secure types is fine — each is auto-detected.
filename body string no Optional ZIP filename (without extension). Defaults to "attachments_<YYYY-MM-DD>.zip".
response body string no Response mode. "binary" (default): streams the ZIP back in the response body. "url": stages the ZIP and returns a JSON body with a signed download URL good for 10 minutes. Pass as a query string (?response=url) — body field is also accepted.

📄 /api/files/post-files-bundle.md

GET /files/:file_id/download Scopes: files:read

Download a workspace file by UUID.

1 parameter
Name In Type Required Description
file_id path string yes

📄 /api/files/get-files-file-id-download.md

POST /files/:file_id/publish Scopes: files:write

Publish a document (make it generally accessible).

1 parameter
Name In Type Required Description
file_id path string yes

📄 /api/files/post-files-file-id-publish.md

GET /files/:file_id/signed-url Scopes: files:read

Get a signed playback URL for a private file.

1 parameter
Name In Type Required Description
file_id path string yes

📄 /api/files/get-files-file-id-signed-url.md

GET /files/:file_id Scopes: files:read

Fetch a single file metadata record by UUID.

1 parameter
Name In Type Required Description
file_id path string yes

📄 /api/files/get-files-file-id.md

PUT /files/:file_id Scopes: files:write

Update a file metadata record.

3 parameters
Name In Type Required Description
file_id path string yes
name body string no
folder_id body string no

📄 /api/files/put-files-file-id.md

DELETE /files/:file_id Scopes: files:delete

Delete a file by UUID. Destructive.

1 parameter
Name In Type Required Description
file_id path string yes

📄 /api/files/delete-files-file-id.md

Notepads (18 endpoints)

Manage rich-text notepads organized in folders. Supports markdown input, iterative editing (append/prepend/section patches), per-record visibility, and ACL-based access control for restricted notes.

📄 Full markdown: /api/notepads.md

POST /notepads/folders Scopes: notepads:write

Create a new notepad folder. Set is_public=true to mark it a public content collection that can be integrated as a section on a website (the public notepads inside it then appear there).

2 parameters
Name In Type Required Description
name body string yes
is_public body boolean no Mark the folder as a public content collection (integratable on websites).

📄 /api/notepads/post-notepads-folders.md

PATCH /notepads/folders/:folder_id Scopes: notepads:write

Rename or update a notepad folder. Set is_public to mark it (true) or unmark it (false) as a public content collection integratable on websites.

3 parameters
Name In Type Required Description
folder_id path string yes
name body string no
is_public body boolean no Public content collection flag.

📄 /api/notepads/patch-notepads-folders-folder-id.md

POST /notepads/folders/:folder_id/acl Scopes: notepads:write

Grant access to a notepad folder (user or role principal).

4 parameters
Name In Type Required Description
folder_id path string yes
principal_type body string yes
principal_id body string yes
permission body string no read or write

📄 /api/notepads/post-notepads-folders-folder-id-acl.md

GET /notepads Scopes: notepads:read

List notepads in the workspace. Filter by folder_id, is_public, or free-text search.

4 parameters
Name In Type Required Description
limit query number no
q query string no
folder_id query string no
is_public query boolean no Filter to public (blog-published) notepads only.

📄 /api/notepads/get-notepads.md

POST /notepads Scopes: notepads:write

Create a new notepad. Supports markdown content. Set is_public=true to publish it to the public blog (a slug is derived from the title); notepads are private by default.

6 parameters
Name In Type Required Description
title body string yes
content body string no
folder_id body string no
is_public body boolean no Publish to the public blog. Private by default. The post only appears publicly when it is also in a website's designated blog folder.
slug body string no Optional public URL slug. Derived from the title when omitted.
cover_image body string no Cover image URL — shown on the Notepads card grid and at the top of the public blog post.

📄 /api/notepads/post-notepads.md

GET /notepads/:notepad_id Scopes: notepads:read

Fetch a notepad by UUID, including its full content.

1 parameter
Name In Type Required Description
notepad_id path string yes

📄 /api/notepads/get-notepads-notepad-id.md

PATCH /notepads/:notepad_id Scopes: notepads:write

Update the title and/or content of a notepad. Set is_public=true to publish it to the public blog, or false to unpublish; a slug is derived from the title on first publish.

6 parameters
Name In Type Required Description
notepad_id path string yes
title body string no
content body string no
is_public body boolean no Publish (true) or unpublish (false) to the public blog.
slug body string no Optional public URL slug. Derived from the title when omitted.
cover_image body string no Cover image URL (shown on the card grid + public post). Pass null to clear.

📄 /api/notepads/patch-notepads-notepad-id.md

DELETE /notepads/:notepad_id Scopes: notepads:delete

Delete a notepad by UUID. Destructive.

1 parameter
Name In Type Required Description
notepad_id path string yes

📄 /api/notepads/delete-notepads-notepad-id.md

POST /notepads/:notepad_id/deals Scopes: notepads:write

Link a notepad to an opportunity.

2 parameters
Name In Type Required Description
notepad_id path string yes
deal_id body string yes

📄 /api/notepads/post-notepads-notepad-id-deals.md

POST /notepads/:notepad_id/acl Scopes: notepads:write

Grant access to a notepad (user or role principal).

4 parameters
Name In Type Required Description
notepad_id path string yes
principal_type body string yes
principal_id body string yes
permission body string no

📄 /api/notepads/post-notepads-notepad-id-acl.md

Spreadsheets (16 endpoints)

Manage spreadsheet templates (column definitions) and populated spreadsheets (row data). Spreadsheets can be linked to opportunities and are also created automatically when a form with a spreadsheet field is submitted. Scopes: spreadsheets:read, spreadsheets:write, spreadsheets:delete.

📄 Full markdown: /api/spreadsheets.md

GET /spreadsheets Scopes: spreadsheets:read

List spreadsheets in the workspace.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/spreadsheets/get-spreadsheets.md

POST /spreadsheets Scopes: spreadsheets:write

Create a spreadsheet from a template.

2 parameters
Name In Type Required Description
template_id body string yes
name body string yes

📄 /api/spreadsheets/post-spreadsheets.md

Reports (18 endpoints)

Query engine, dashboard CRUD, card CRUD, and funnel configuration for the workspace reporting system. Dashboards support per-record visibility (all_users or restricted) with ACL-based access grants.

📄 Full markdown: /api/reports.md

POST /reports/query Scopes: opportunities:read

Run a report query against the workspace. Free read. The "deals" source excludes pipelines flagged exclude_from_lead_reporting by default; pass include_excluded_pipelines:true to include them.

5 parameters
Name In Type Required Description
source body string yes
measures body array no
dimensions body array no
filters body array no
include_excluded_pipelines body boolean no Deals source only. Include pipelines flagged exclude_from_lead_reporting (excluded by default).

📄 /api/reports/post-reports-query.md

POST /reports/send Scopes: opportunities:read

Send a dashboard digest email.

2 parameters
Name In Type Required Description
dashboard_id body string yes
to body string yes

📄 /api/reports/post-reports-send.md

POST /reports/render-preview Scopes: opportunities:read

Server-side render a dashboard to HTML for preview.

1 parameter
Name In Type Required Description
dashboard_id body string yes

📄 /api/reports/post-reports-render-preview.md

POST /report-dashboards Scopes: opportunities:read

Create a report dashboard.

2 parameters
Name In Type Required Description
name body string no
template_id body string no

📄 /api/reports/post-report-dashboards.md

POST /report-dashboards/:dashboard_id/acl Scopes: opportunities:read

Grant dashboard access.

3 parameters
Name In Type Required Description
dashboard_id path string yes
principal_type body string yes
principal_id body string yes

📄 /api/reports/post-report-dashboards-dashboard-id-acl.md

GET /report-funnels Scopes: opportunities:read

Get funnel config for a pipeline.

1 parameter
Name In Type Required Description
pipeline_id query string yes

📄 /api/reports/get-report-funnels.md

PUT /report-funnels Scopes: opportunities:read

Configure a funnel for a pipeline.

2 parameters
Name In Type Required Description
pipeline_id body string yes
steps body array yes

📄 /api/reports/put-report-funnels.md

AI Knowledge (7 endpoints)

Manage company AI Knowledge entries with semantic search powered by Voyage AI embeddings. Use for policies, FAQs, agent instructions, and product documentation.

📄 Full markdown: /api/knowledge.md

POST /knowledge/search Scopes: knowledge:read

Semantic search across the workspace knowledge base. Use to find relevant context before answering a customer question. Pass kb_ids to scope to specific knowledge bases, or agent_type + agent_id to auto-scope to the knowledge bases attached to that agent.

5 parameters
Name In Type Required Description
query body string yes Search query
limit body number no Max results (default 5)
kb_ids body array no Optional: restrict search to these knowledge base IDs
agent_type body string no Optional: with agent_id, auto-scope to the KBs attached to this agent
agent_id body string no Optional: the agent whose attached KBs scope the search

📄 /api/knowledge/post-knowledge-search.md

GET /knowledge Scopes: knowledge:read

List entries in the workspace knowledge base. Supports filtering by category, tag, and text search.

4 parameters
Name In Type Required Description
limit query number no
after query string no
category query string no
search query string no

📄 /api/knowledge/get-knowledge.md

POST /knowledge Scopes: knowledge:write

Create a new knowledge base entry. Requires title and content.

4 parameters
Name In Type Required Description
title body string yes
content body string yes
category body string no
tags body array no

📄 /api/knowledge/post-knowledge.md

GET /knowledge/:knowledge_id Scopes: knowledge:read

Fetch a single knowledge base entry by UUID. Returns full content.

1 parameter
Name In Type Required Description
knowledge_id path string yes

📄 /api/knowledge/get-knowledge-knowledge-id.md

PATCH /knowledge/:knowledge_id Scopes: knowledge:write

Update a knowledge base entry. Pass only the fields you want to change.

5 parameters
Name In Type Required Description
knowledge_id path string yes
title body string no
content body string no
category body string no
tags body array no

📄 /api/knowledge/patch-knowledge-knowledge-id.md

DELETE /knowledge/:knowledge_id Scopes: knowledge:delete

Delete a knowledge base entry by UUID. Destructive.

1 parameter
Name In Type Required Description
knowledge_id path string yes

📄 /api/knowledge/delete-knowledge-knowledge-id.md

Agent Memory (7 endpoints)

Cross-run persistent state for managed agents. Each row records what an agent learned, decided, or intends to revisit about a subject. Supports semantic search via vector embeddings. Required scopes: memory:read (GET/search), memory:write (POST/PATCH/DELETE).

📄 Full markdown: /api/memory.md

POST /memory/search Scopes: memory:read

Semantic search over agent memories. Pass a natural-language query; returns the top-K most similar memories ranked by cosine similarity. Use when you need fuzzy / topic-based lookup ("have I discussed pricing with this contact?") rather than exact filter by subject_id. Use list_memory for keyed lookup ("what have I said to contact X about kind Y?").

8 parameters
Name In Type Required Description
query body string yes Natural language query.
subject_type body string no
subject_id body string no
kind body string no
agent_registry_id body string no
visibility body string no
limit body number no Default 10, max 50.
threshold body number no Cosine similarity floor (0.0–1.0). Default 0.3.

📄 /api/memory/post-memory-search.md

POST /memory/purge Scopes: memory:delete

Bulk-retract agent memories matching a filter, in one call. Soft-deletes by default (reversible, audit-preserving); pass hard:true to physically remove rows for PII / right-to-be-forgotten. This is the "forget everything about this contact / opportunity / company" primitive — filter by subject, agent, kind, tag, or linked entity. Refuses to run with no filter unless you set all:true. Requires the memory:delete scope.

9 parameters
Name In Type Required Description
subject_type body string no Purge memories about this subject type — e.g. "contact", "opportunity", "company", "self".
subject_id body string no Purge memories about this specific subject id (use with subject_type for "forget this contact").
agent_registry_id body string no Purge memories owned by this agent.
kind body string no Purge memories of this kind.
tag body string no Purge memories carrying this tag.
linked_entity_type body string no Purge memories linked to an entity of this type (combine with linked_entity_id).
linked_entity_id body string no Purge memories linked to this entity id (combine with linked_entity_type).
hard body boolean no Default false (soft-delete). true physically removes the rows — irreversible.
all body boolean no Set true to purge EVERY memory in the workspace. Required when no filter is provided; ignored otherwise.

📄 /api/memory/post-memory-purge.md

GET /memory Scopes: memory:read

List agent memories for this workspace, filterable by subject, kind, agent, tag, linked entity, and time. Cursor-paginated. Use this for keyed lookup before composing new actions (e.g. "what have I already said to this contact?"); use search_memory for fuzzy / semantic lookup.

11 parameters
Name In Type Required Description
subject_type query string no Filter by subject type — e.g. "contact", "opportunity", "company", "self".
subject_id query string no Filter by subject id (use with subject_type).
kind query string no Filter by kind — e.g. "pitch", "objection", "preference", "next_steps".
agent_registry_id query string no Filter by owning agent.
visibility query string no Filter by visibility.
tag query array no Tag filter (matches any of the provided tags). Pass as repeated `tag` query params or array.
linked_entity_type query string no Find memories linked to an entity of this type.
linked_entity_id query string no Find memories linked to this entity id (must be combined with linked_entity_type).
since query string no ISO timestamp — return memories created after this time.
limit query number no
after query string no

📄 /api/memory/get-memory.md

POST /memory Scopes: memory:write

Write a memory for an agent. If `key` is provided, behaves as upsert on (agent, subject, kind, key) — re-running the same key UPDATES the existing memory rather than creating a duplicate. Use this to record what you have learned, decided, or intend to revisit. Content is natural-language; metadata is structured. Embedding generated automatically for semantic search.

15 parameters
Name In Type Required Description
agent_registry_id body string no The owning agent id. For agent-private state.
visibility body string no Default "private". Set "shared" to make this memory readable by other agents in the workspace.
subject_type body string yes What this memory is about — e.g. "contact", "opportunity", "company", "self".
subject_id body string no The id of the subject (the contact uuid, opportunity uuid, etc.). Null for global/self memories.
kind body string yes The category of memory — e.g. "pitch", "objection", "preference", "observation", "next_steps". Free-form; agents define their own taxonomy.
key body string no Optional unique key within (agent, subject, kind) — enables upsert. Example: an article_slug for a pitch memory means re-pitching the same slug UPDATES rather than duplicates.
content body string yes The memory itself, in natural language.
metadata body object no Structured payload alongside the content.
linked_entities body array no Other entities this memory references. e.g. [{type:"opportunity", id:"..."}, {type:"article", id:"voice-agents-setup"}].
tags body array no Free-form semantic facets. e.g. ["competitor:Twilio", "objection:pricing", "feature:voice_agents"].
confidence body number no 0.0–1.0. Default 1.0. Decreases as the memory ages or gets contradicted.
source_kind body string no Where this memory came from — e.g. "email_send", "transcript", "tool_observation", "manual".
source_id body string no Pointer back to the source event (e.g. email_logs.id).
parent_memory_id body string no Link to an earlier memory this one updates or continues.
expires_at body string no ISO timestamp. Memory becomes inactive after this time.

📄 /api/memory/post-memory.md

GET /memory/:memory_id Scopes: memory:read

Fetch a single agent memory by its uuid.

1 parameter
Name In Type Required Description
memory_id path string yes

📄 /api/memory/get-memory-memory-id.md

PATCH /memory/:memory_id Scopes: memory:write

Update a memory in place — change content, metadata, tags, links, confidence, expiry, or visibility. Re-embeds automatically if content changes. For upsert semantics, prefer write_memory with the same key.

8 parameters
Name In Type Required Description
memory_id path string yes
content body string no
metadata body object no
linked_entities body array no
tags body array no
confidence body number no
expires_at body string no
visibility body string no

📄 /api/memory/patch-memory-memory-id.md

DELETE /memory/:memory_id Scopes: memory:write

Soft-delete a memory. Sets deleted_at; the row is preserved for audit but no longer surfaces in list / search / get calls. Reversible only by admin SQL.

1 parameter
Name In Type Required Description
memory_id path string yes

📄 /api/memory/delete-memory-memory-id.md

Company (32 endpoints)

View and manage company settings, users, and CRM configuration.

📄 Full markdown: /api/company.md

GET /our-company Scopes: company:read

Get OUR Company — the workspace's own organisation profile (the business that runs this CRM), shown at https://app.trustpager.com/settings/company. NOT a CRM account/customer — for those use get_company / list_companies.

📄 /api/company/get-our-company.md

PATCH /our-company Scopes: company:write

Update OUR Company — the workspace's own organisation profile (branding, contact info, address) shown at https://app.trustpager.com/settings/company. NOT a CRM account/customer — to edit a customer record use update_company.

7 parameters
Name In Type Required Description
name body string no
slug body string no
industry body string no
website_url body string no
phone body string no
primary_color body string no
secondary_color body string no

📄 /api/company/patch-our-company.md

PATCH /our-company/crm-settings Scopes: company:write

Update workspace CRM settings. Includes payment_details — the bank-transfer / BPAY remittance details printed on invoices when there is no online pay link.

3 parameters
Name In Type Required Description
lead_sources body array no
lost_reasons body array no
payment_details body object no Bank-transfer / BPAY details shown on invoices that have no online pay link. Replaces the whole object on write — send the complete set of fields you want kept.

📄 /api/company/patch-our-company-crm-settings.md

GET /our-company/dispatcher-config Scopes: company:read

Get the workspace dispatcher settings — retry policy, pacing/concurrency, and the business-hours CALLING WINDOWS used for scheduled sends and the AI dialler. business_hours.windows is keyed by day (mon…sun); each day is a list of ["HH:MM","HH:MM"] ranges. A null/empty config means the workspace is on the platform defaults (Mon–Fri 09:00–17:00, per-lead timezone). Configured in the UI at https://app.trustpager.com/settings/inbox (Dispatcher).

📄 /api/company/get-our-company-dispatcher-config.md

PATCH /our-company/dispatcher-config Scopes: company:write

Update the workspace dispatcher settings shown at https://app.trustpager.com/settings/inbox (Dispatcher). Pass any of business_hours, retry, concurrency, channel_defaults, failure; each section shallow-merges over the current config. business_hours.windows sets the calling windows per day and, when provided, fully replaces the day set — use minute-precise ranges like { "mon": [["08:30","09:30"],["15:30","17:30"]], "sun": [["10:00","11:00"]] }, and omit a day to skip calling it. Times are evaluated in each lead's local timezone.

5 parameters
Name In Type Required Description
business_hours body object no Calling windows + timezone resolution for business-hours-aware sends and the dialler.
retry body object no Per-channel retry policy (email/sms/voice).
concurrency body object no Pacing / concurrency caps.
channel_defaults body object no Default respect-business-hours per channel.
failure body object no What to do on final failure.

📄 /api/company/patch-our-company-dispatcher-config.md

GET /our-company/referral-settings Scopes: company:read

Get the workspace referral settings: referral_form_template_id (the form pinned onto every referral link, where referrers/clients submit a referral) and referrer_portal_template_id (the portal template instantiated for a referrer). Configured in the UI at https://app.trustpager.com/settings/tools.

📄 /api/company/get-our-company-referral-settings.md

PATCH /our-company/referral-settings Scopes: company:write

Set the workspace referral form and/or referrer portal. referral_form_template_id is a form_templates UUID (the public form referrers/clients submit to start a referral; get ids from list_form_templates); referrer_portal_template_id is a portal_templates UUID (the portal a referrer logs into; get ids from list_portal_templates). Pass either or both; pass null to clear one.

2 parameters
Name In Type Required Description
referral_form_template_id body string no form_templates UUID of the workspace referral form, or null to clear.
referrer_portal_template_id body string no portal_templates UUID of the referrer portal, or null to clear.

📄 /api/company/patch-our-company-referral-settings.md

GET /our-company/ai-fill-prompts Scopes: company:read

List every "Fill with AI" form in the workspace with its label, what it controls, the built-in default master prompt, and the current workspace override (if any). Call this first when configuring how AI Fill writes fields — it returns the valid form_ids to pass to set_ai_fill_prompt. The create-opportunity form is form_id "create-deal-multi-step"; per-entity custom fields are "custom-fields-deal" / "custom-fields-contact" / "custom-fields-account".

📄 /api/company/get-our-company-ai-fill-prompts.md

PUT /our-company/ai-fill-prompts/:form_id|str Scopes: company:write

Set the master prompt for one "Fill with AI" form. The master prompt is prepended to the AI Fill system prompt for that form, so it steers tone, format, and field rules every time AI Fill runs there (e.g. set form_id "create-deal-multi-step" to enforce a consistent Opportunity Title format). Get valid form_ids from list_ai_fill_prompts. Overrides only the named form; other forms are untouched.

2 parameters
Name In Type Required Description
form_id body string yes Form to configure. Get valid ids from list_ai_fill_prompts (e.g. "create-deal-multi-step").
master_prompt body string yes Instruction prepended to the AI Fill system prompt for this form.

📄 /api/company/put-our-company-ai-fill-prompts-form-id-str.md

DELETE /our-company/ai-fill-prompts/:form_id|str Scopes: company:write

Remove the workspace master-prompt override for one "Fill with AI" form, reverting it to the built-in default. Get valid form_ids from list_ai_fill_prompts.

1 parameter
Name In Type Required Description
form_id query string yes Form to reset to its built-in default.

📄 /api/company/delete-our-company-ai-fill-prompts-form-id-str.md

GET /our-company/pipeline-card-config Scopes: company:read

Get the pipeline (Workflows) opportunity-card configuration. Returns: available_sections (toggleable popout sections with labels + defaults); popout_sections (resolved on/off per section for the hover/popout panel); custom_field_ids (which opportunity custom fields show when the popout "custom_fields" section is on); and card_face ({ opportunity_type, custom_field_ids }) for what shows on the card FACE itself (the opportunity name, customer and value always show; the type and chosen custom fields are opt-in). Popout: notes/next_action/tasks default ON, custom_fields OFF. Card face: all default OFF.

📄 /api/company/get-our-company-pipeline-card-config.md

PATCH /our-company/pipeline-card-config Scopes: company:write

Configure the opportunity card on the pipeline (Workflows) board. Two independent surfaces, pass either or both. Card POPOUT (hover panel): popout_sections as a partial map of section_key -> boolean (only keys you pass change; valid keys notes, next_action, tasks, custom_fields), plus custom_field_ids (opportunity custom-field ids from get_crm_settings.custom_fields.deal) shown when the custom_fields section is on. Card FACE (the card itself): card_face as { opportunity_type?: boolean, custom_field_ids?: string[] } to show/hide the opportunity type and chosen custom fields on the card (name, customer and value always show); partial, only keys you pass change. e.g. { "card_face": { "opportunity_type": true, "custom_field_ids": ["broker_name"] } } or { "popout_sections": { "custom_fields": true }, "custom_field_ids": ["lot_number"] }.

3 parameters
Name In Type Required Description
popout_sections body object no Partial map of popout section_key -> show(boolean). e.g. { "tasks": false, "custom_fields": true }.
custom_field_ids body array no Opportunity custom-field ids to show in the POPOUT when the custom_fields section is on. e.g. ["lot_number","slab_type"].
card_face body object no What shows on the card FACE. { "opportunity_type": true, "custom_field_ids": ["broker_name"] }.

📄 /api/company/patch-our-company-pipeline-card-config.md

POST /our-company/users/invite Scopes: users:write

Invite a new user to the workspace.

2 parameters
Name In Type Required Description
email body string yes
role body string yes

📄 /api/company/post-our-company-users-invite.md

CRM Templates (5 endpoints)

Manage reusable CRM templates for emails, messages, and automated communications.

📄 Full markdown: /api/crm-templates.md

GET /crm-templates Scopes: crm-templates:read

List workspace CRM templates (default custom-field templates for entities).

1 parameter
Name In Type Required Description
type query string no

📄 /api/crm-templates/get-crm-templates.md

POST /crm-templates Scopes: crm-templates:write

Create a CRM template.

4 parameters
Name In Type Required Description
type body string yes
name body string yes
category body string no
content body object no

📄 /api/crm-templates/post-crm-templates.md

Integrations (5 endpoints)

Read, query, and execute actions on native integrations (Xero, MYOB, etc.). Connecting and disconnecting integrations is done via the platform UI (OAuth browser flows).

📄 Full markdown: /api/integrations.md

GET /integrations/:integration_id Scopes: integrations:read

Fetch a single integration by UUID, including its status and capabilities.

1 parameter
Name In Type Required Description
integration_id path string yes

📄 /api/integrations/get-integrations-integration-id.md

POST /integrations/:integration_id/query Scopes: integrations:read

Read data from a connected third-party platform (e.g. list channels, get profile).

3 parameters
Name In Type Required Description
integration_id path string yes
query body string yes
args body object no

📄 /api/integrations/post-integrations-integration-id-query.md

POST /integrations/:integration_id/action Scopes: integrations:write

Execute an action on a connected third-party platform (e.g. post Slack message, add calendar event).

3 parameters
Name In Type Required Description
integration_id path string yes
action body string yes
args body object no

📄 /api/integrations/post-integrations-integration-id-action.md

POST /integrations/:integration_id/sync-receivables Scopes: invoices:write

Backfill / reconcile the outstanding-invoices (accounts receivable) ledger from a connected Xero integration. Pages all sales invoices into the workspace and powers the Invoices / Receivables report source. Idempotent — safe to re-run.

1 parameter
Name In Type Required Description
integration_id path string yes

📄 /api/integrations/post-integrations-integration-id-sync-receivables.md

Webhooks (17 endpoints)

Manage incoming and outgoing webhooks for external system integration.

📄 Full markdown: /api/webhooks.md

POST /webhooks/outgoing Scopes: webhooks:write

Create an outgoing webhook.

3 parameters
Name In Type Required Description
name body string yes
url body string yes
events body array no

📄 /api/webhooks/post-webhooks-outgoing.md

POST /webhooks/incoming Scopes: webhooks:write

Create an incoming webhook URL.

2 parameters
Name In Type Required Description
service_type body string yes
service_name body string yes

📄 /api/webhooks/post-webhooks-incoming.md

POST /webhooks/subscribe Scopes: webhooks:write

Subscribe a URL to API event notifications.

3 parameters
Name In Type Required Description
url body string yes
events body array yes
secret body string yes

📄 /api/webhooks/post-webhooks-subscribe.md

AI (15 endpoints)

AI-powered features including text editing, call coaching, needs analysis, form filling, pipeline generation, image generation, reference-guided image editing, text-to-speech generation, and AI tool generators (form, document, whiteboard, website page) that create fully-structured workspace assets from a plain-language prompt.

📄 Full markdown: /api/ai.md

POST /ai/edit-text Scopes: ai:use

Rewrite, refine, or transform a block of text. Use for "make this more formal", "shorten this", "fix grammar". Costs credits.

3 parameters
Name In Type Required Description
text body string yes
instruction body string yes
tone body string no

📄 /api/ai/post-ai-edit-text.md

POST /ai/call-coaching Scopes: ai:use

Analyze a phone call transcript for coaching feedback. Costs credits.

1 parameter
Name In Type Required Description
transcript_id body string yes

📄 /api/ai/post-ai-call-coaching.md

POST /ai/transcript-summary Scopes: ai:use

Summarise a call or meeting transcript — key topics, decisions, action items. Costs credits.

2 parameters
Name In Type Required Description
transcript_id body string yes
focus body string no

📄 /api/ai/post-ai-transcript-summary.md

POST /ai/needs-analysis Scopes: ai:use

Analyse an opportunity — activities, transcripts, notes — to surface needs, objections, next steps. Costs credits.

2 parameters
Name In Type Required Description
opportunity_id body string yes
focus body string no

📄 /api/ai/post-ai-needs-analysis.md

POST /ai/fill-form Scopes: ai:use

Auto-fill a form template from natural-language input. Pass template_id (the form template to fill) and prompt (the source text / instructions to extract field values from). The workspace master prompt configured for this template (via set_ai_fill_prompt) is applied automatically; pass master_prompt to override it for this one call. Costs credits.

5 parameters
Name In Type Required Description
template_id body string yes UUID of the form template to fill. Get ids from list_form_templates.
prompt body string yes Natural-language source text / instructions the AI extracts field values from.
master_prompt body string no Optional one-off override of the system steer for this call. Leave unset to use the workspace master prompt configured via set_ai_fill_prompt (or the built-in default).
form_id body string yes
inputs body string no

📄 /api/ai/post-ai-fill-form.md

POST /ai/generate-pipeline Scopes: ai:usepipelines:write

Generate a new pipeline (with stages) from a natural-language description.

1 parameter
Name In Type Required Description
prompt body string yes

📄 /api/ai/post-ai-generate-pipeline.md

POST /ai/generate-form Scopes: ai:useforms:write

Generate a form template from a natural-language prompt.

1 parameter
Name In Type Required Description
prompt body string yes

📄 /api/ai/post-ai-generate-form.md

POST /ai/generate-document Scopes: ai:usedocuments:write

Generate a new document from a prompt — proposals, scopes, summaries. Returns a document UUID. Costs credits.

4 parameters
Name In Type Required Description
prompt body string yes
opportunity_id body string no
contact_id body string no
title body string no

📄 /api/ai/post-ai-generate-document.md

POST /ai/generate-whiteboard Scopes: ai:use

Generate a whiteboard layout from a prompt.

1 parameter
Name In Type Required Description
prompt body string yes

📄 /api/ai/post-ai-generate-whiteboard.md

POST /ai/generate-image Scopes: ai:use

Generate an image from a prompt. Costs credits.

2 parameters
Name In Type Required Description
prompt body string yes
aspect_ratio body string no

📄 /api/ai/post-ai-generate-image.md

POST /ai/edit-image Scopes: ai:use

Edit an image based on a prompt. Costs credits.

2 parameters
Name In Type Required Description
image_id body string yes
prompt body string yes

📄 /api/ai/post-ai-edit-image.md

POST /ai/upscale-image Scopes: ai:use

Upscale an image to higher resolution. Costs credits.

1 parameter
Name In Type Required Description
image_id body string yes

📄 /api/ai/post-ai-upscale-image.md

POST /ai/generate-speech Scopes: ai:use

Generate speech audio from text. Costs credits.

2 parameters
Name In Type Required Description
text body string yes
voice_id body string no

📄 /api/ai/post-ai-generate-speech.md

POST /ai/generate-music Scopes: ai:use

Generate music audio from a prompt. Costs credits.

2 parameters
Name In Type Required Description
prompt body string yes
duration_seconds body number no

📄 /api/ai/post-ai-generate-music.md

POST /ai/generate-embedding Scopes: ai:use

Generate a vector embedding for a text string. Free.

1 parameter
Name In Type Required Description
text body string yes

📄 /api/ai/post-ai-generate-embedding.md

Billing (4 endpoints)

View billing plans, credit balance, and pricing.

📄 Full markdown: /api/billing.md

Service Requests (7 endpoints)

Submit and manage platform improvement requests. Designed for AI agents to report missing capabilities, suggest new features, and flag issues with the MCP, API, or platform. Supports listing, filtering, note threads, inline note editing, and two-way ticket linking.

📄 Full markdown: /api/service-requests.md

GET /service-requests Scopes: service-requests:read

List platform improvement / capability requests submitted by AI agents.

2 parameters
Name In Type Required Description
status query string no
limit query number no

📄 /api/service-requests/get-service-requests.md

POST /service-requests Scopes: service-requests:write

File a platform improvement / capability request. Use when you hit a missing tool, missing field, confusing error, or bug.

4 parameters
Name In Type Required Description
title body string yes
description body string yes
category body string no
priority body string no

📄 /api/service-requests/post-service-requests.md

POST /service-requests/search Scopes: service-requests:read

Semantic search across this workspace's service requests using vector embeddings. Use to find duplicates before filing, group related open requests, or find historical resolutions. Returns ranked SRs by cosine similarity.

4 parameters
Name In Type Required Description
query body string yes Natural-language description of what you're looking for
status body string no Optional: restrict to a single status
limit body number no Max results, 1-50 (default 10)
threshold body number no Minimum cosine similarity 0-1 (default 0.5)

📄 /api/service-requests/post-service-requests-search.md

Approvals (6 endpoints)

Manage API actions queued for human approval. When an API key has a "with Approval" permission level, write operations are held here until a team member reviews them.

📄 Full markdown: /api/approvals.md

GET /approvals Scopes: approvals:read

List pending approvals — actions queued for human review. Use after a 202 to check what is waiting.

3 parameters
Name In Type Required Description
status query string no pending (default), approved, rejected, expired, executed, failed
resource query string no
limit query number no

📄 /api/approvals/get-approvals.md

GET /approvals/:approval_id Scopes: approvals:read

Fetch a single approval by UUID — full action details, request body, status, reviewer assignment.

1 parameter
Name In Type Required Description
approval_id path string yes

📄 /api/approvals/get-approvals-approval-id.md

POST /approvals/:approval_id/approve Scopes: approvals:write

Approve a pending action and execute it. Destructive — runs the underlying queued operation.

1 parameter
Name In Type Required Description
approval_id path string yes

📄 /api/approvals/post-approvals-approval-id-approve.md

POST /approvals/:approval_id/reject Scopes: approvals:write

Reject a pending action. Cancels the queued operation.

2 parameters
Name In Type Required Description
approval_id path string yes
reason body string no

📄 /api/approvals/post-approvals-approval-id-reject.md

POST /approvals/:approval_id/assign Scopes: approvals:reassign

Reassign a pending approval to a different reviewer. Does not approve or reject.

3 parameters
Name In Type Required Description
approval_id path string yes
primary_assignee_id body string yes
secondary_assignee_id body string no

📄 /api/approvals/post-approvals-approval-id-assign.md

POST /approvals/:approval_id/edit Scopes: approvals:edit

Rewrite the request_body of a pending approval. Lets agents iterate on AI-drafted content (e.g. fix an email body) without approving.

2 parameters
Name In Type Required Description
approval_id path string yes
request_body body object yes New request body to replace the queued one

📄 /api/approvals/post-approvals-approval-id-edit.md

AI Instructions (1 endpoint)

Structured behavioral instructions for AI agents. Call once per session, cache the result. Free (0 credits).

📄 Full markdown: /api/ai-instructions.md

Voices (8 endpoints)

Manage saved workspace voices and browse platform-recommended voices. Workspace voices are saved ElevenLabs voices scoped to your company. Platform voices are pre-seeded recommended voices available to all workspaces (read-only). Use these with POST /ai/generate-speech.

📄 Full markdown: /api/voices.md

POST /voices/:voice_id/provider-mapping Scopes: voices:write

Map a workspace voice to a provider voice id so agent creation uses the right voice.

2 parameters
Name In Type Required Description
voice_id path string yes
retell_voice_id body string yes

📄 /api/voices/post-voices-voice-id-provider-mapping.md

GET /voices Scopes: voices:read

List workspace voices.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/voices/get-voices.md

POST /voices Scopes: voices:write

Add a voice to the workspace (resolves metadata from provider on create).

2 parameters
Name In Type Required Description
provider_voice_id body string yes
name body string no

📄 /api/voices/post-voices.md

GET /voices/:voice_id Scopes: voices:read

Fetch a workspace voice by UUID.

1 parameter
Name In Type Required Description
voice_id path string yes

📄 /api/voices/get-voices-voice-id.md

PATCH /voices/:voice_id Scopes: voices:write

Update a workspace voice.

2 parameters
Name In Type Required Description
voice_id path string yes
name body string no

📄 /api/voices/patch-voices-voice-id.md

DELETE /voices/:voice_id Scopes: voices:delete

Delete a workspace voice.

1 parameter
Name In Type Required Description
voice_id path string yes

📄 /api/voices/delete-voices-voice-id.md

Agent Proposals (6 endpoints)

Agent action proposals submitted by AI agents for human review and approval. Agents submit proposals when they identify an action that should be taken but requires a human decision. Proposals surface in the Agent Hub at /auto/agent-hub?tab=proposals.

📄 Full markdown: /api/agent-proposals.md

GET /agent-proposals Scopes: agent-ops:read

List agent action proposals. Filter by status (pending, approved, rejected) and agent_name.

4 parameters
Name In Type Required Description
status query string no
agent_name query string no
category query string no
limit query number no

📄 /api/agent-proposals/get-agent-proposals.md

POST /agent-proposals Scopes: agent-ops:write

Create a new agent action proposal for human review.

5 parameters
Name In Type Required Description
agent_name body string yes
category body string yes
title body string yes
proposed_action body object yes
rationale body string no

📄 /api/agent-proposals/post-agent-proposals.md

Lead Generation (10 endpoints)

Search for businesses via Google Maps (powered by Apify), match against existing CRM records, save search configurations, and import results as contacts, customers, and deals. Requires lead-gen:read, lead-gen:write, or lead-gen:delete scopes.

📄 Full markdown: /api/lead-gen.md

POST /lead-gen/search Scopes: lead-gen:write

Start a new lead-gen search via Apify Google Maps. Costs credits.

3 parameters
Name In Type Required Description
query body string yes
location body string yes
limit body number no

📄 /api/lead-gen/post-lead-gen-search.md

POST /lead-gen/searches/:search_id/cancel Scopes: lead-gen:write

Force-cancel a running lead-gen search and refund any credits that were charged. Use this to clear searches stuck in "running" — typically because the dispatch edge function timed out / was killed before it could mark the row completed or failed, leaving the row orphaned and the user's credits locked up. Only searches in status="running" can be cancelled; completed/failed/cancelled rows return a 400. On success the row flips to status="cancelled" with error_message="Cancelled by user" and credits_charged is refunded via a "refund" ledger transaction. Response includes credits_refunded and credit_balance_after for confirmation.

1 parameter
Name In Type Required Description
search_id path string yes

📄 /api/lead-gen/post-lead-gen-searches-search-id-cancel.md

POST /lead-gen/import Scopes: lead-gen:write

Convert lead_gen_results into CRM contacts + customers (+ optional pipeline opportunity). Every conversion requires a per-result contact mapping — first_name is mandatory for each row so the CRM contact has a real person attached, not the business name. Find-or-create semantics: existing customers matched by name and contacts matched by email are reused instead of duplicated. Importing a lead that's already fully in CRM is a no-op; partial/zombie imports (imported flag flipped but contact record never created) are retried automatically.

5 parameters
Name In Type Required Description
contacts body array yes Required. Per-result contact mapping. Each entry creates or reuses a contact with the supplied name + email + phone, links to the lead's customer record (by business name), and optionally creates a deal in the named pipeline + stage.
pipeline_id body string no Optional. When set with stage_id, creates a deal per imported lead and places it in this pipeline.
stage_id body string no Optional. Required when pipeline_id is provided.
lead_source body string no Defaults to "Lead Generation".
tags body array no Optional tags applied to the created deal(s).

📄 /api/lead-gen/post-lead-gen-import.md

POST /lead-gen/saved-searches Scopes: lead-gen:write

Save a lead-gen search query for reuse.

3 parameters
Name In Type Required Description
name body string yes
search_query body string yes
location body string yes

📄 /api/lead-gen/post-lead-gen-saved-searches.md

Playbooks (8 endpoints)

Manage Playbooks and their cards. Playbooks are drag-and-drop boards of cards that can embed YouTube videos, external links, iframes, notepads, PDFs, images, and secure files.

📄 Full markdown: /api/training.md

GET /playbooks Scopes: resources:read

List Playbooks in the workspace. Free read.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/training/get-playbooks.md

POST /playbooks Scopes: resources:write

Create a new Playbook. Optional template: "blank" or "getting_started".

2 parameters
Name In Type Required Description
name body string yes
template body string no

📄 /api/training/post-playbooks.md

GET /playbooks/:playbook_id Scopes: resources:read

Fetch a Playbook by UUID with its cards.

1 parameter
Name In Type Required Description
playbook_id path string yes

📄 /api/training/get-playbooks-playbook-id.md

POST /playbooks/:playbook_id/cards Scopes: resources:write

Add a card to a Playbook.

4 parameters
Name In Type Required Description
playbook_id path string yes
title body string no
content body string no
position body number no

📄 /api/training/post-playbooks-playbook-id-cards.md

PATCH /playbook-cards/:card_id Scopes: resources:write

Update a Playbook card.

3 parameters
Name In Type Required Description
card_id path string yes
title body string no
content body string no

📄 /api/training/patch-playbook-cards-card-id.md

Scheduled Communications (7 endpoints)

Queue deferred emails, SMS, and AI voice calls for future dispatch. The communications_scheduler_tick cron (runs every minute) claims pending rows, enforces business-hours windows, retries with exponential backoff, and dispatches via the automation pipeline. Row lifecycle: pending -> dispatching -> dispatched | failed | cancelled | skipped.

📄 Full markdown: /api/scheduled-communications.md

POST /scheduled-communications Scopes: dispatcher:write

Schedule a deferred email, SMS or voice call for future dispatch.

5 parameters
Name In Type Required Description
channel body string yes
scheduled_for body string yes
payload body object yes
contact_id body string no
deal_id body string no

📄 /api/scheduled-communications/post-scheduled-communications.md

Schemas (2 endpoints)

Discoverable reference data for automation trigger types. Returns the shape of trigger_data each trigger publishes, the {{variable}} tokens available in action templates, and CRM-enriched variable namespaces. Free -- 0 credits, no scope required.

📄 Full markdown: /api/schemas.md

GET /schemas/triggers/:trigger_type|str

Fetch a single trigger schema by trigger_type (e.g. contact_created). Free read.

1 parameter
Name In Type Required Description
trigger_type query string yes Trigger type identifier

📄 /api/schemas/get-schemas-triggers-trigger-type-str.md

Reputation (22 endpoints)

Public B2B reputation profiles, verified reviews, and case studies. Build credibility with a public reputation page at trustpager.com/reputation/<slug>. Includes a companion anonymous image upload endpoint for reviewer logos and avatars.

📄 Full markdown: /api/reputation.md

POST /reputation/profile Scopes: reputation:write

Create or replace the workspace reputation profile.

3 parameters
Name In Type Required Description
slug body string no
brand_name body string no
description body string no

📄 /api/reputation/post-reputation-profile.md

PATCH /reputation/profile Scopes: reputation:write

Partially update the reputation profile.

2 parameters
Name In Type Required Description
brand_name body string no
description body string no

📄 /api/reputation/patch-reputation-profile.md

POST /reputation/request-review Scopes: reputation:write

Send a tokenised review request to a contact.

2 parameters
Name In Type Required Description
contact_id body string no
email body string no

📄 /api/reputation/post-reputation-request-review.md

GET /reputation/reviews Scopes: reputation:read

List reputation reviews.

2 parameters
Name In Type Required Description
status query string no
limit query number no

📄 /api/reputation/get-reputation-reviews.md

POST /reputation/reviews Scopes: reputation:write

Create a reputation review.

4 parameters
Name In Type Required Description
profile_id body string yes
reviewer_name body string yes
rating body number yes
testimonial_text body string yes

📄 /api/reputation/post-reputation-reviews.md

POST /reputation/case-studies Scopes: reputation:write

Create a case study.

4 parameters
Name In Type Required Description
profile_id body string yes
title body string yes
slug body string yes
client_name body string yes

📄 /api/reputation/post-reputation-case-studies.md

Referrals (18 endpoints)

Track the referrer -> referred contact -> opportunity chain. Includes workspace-defined category picklist, a leaderboard endpoint, a public token-based submission form, and a create_referral automation action for pipeline-driven partner registration. Every write to the referrals table fires the referral_attributed automation trigger (see GET /schemas/triggers/referral_attributed). Attribution is also cached on the opportunity: crm_deals.primary_referrer_contact_id and crm_deals.primary_referrer_category are maintained by a Postgres trigger and surface in GET /opportunities/:id (including the expand=referrer expansion).

📄 Full markdown: /api/referrals.md

GET /referrals Scopes: referrals:read

List referrals in the workspace.

1 parameter
Name In Type Required Description
limit query number no

📄 /api/referrals/get-referrals.md

POST /referrals Scopes: referrals:write

Create a referral entry. Requires referrer_contact_id.

4 parameters
Name In Type Required Description
referrer_contact_id body string yes
referred_contact_id body string no
notes body string no
deal_id body string no

📄 /api/referrals/post-referrals.md

POST /referrals/request Scopes: referrals:write

Ask a contact to refer someone — sends the referral-request flow.

2 parameters
Name In Type Required Description
contact_id body string yes
channel body string no

📄 /api/referrals/post-referrals-request.md

POST /referrals/attribute Scopes: referrals:write

Set, reassign, or clear the primary referrer on an opportunity. Pass referrer_contact_id to attribute it to a contact, or null to clear. Updates the referral graph in place so commission tracking and history survive a reassignment, and leaves form/automation-sourced referrals intact.

3 parameters
Name In Type Required Description
opportunity_id body string yes Opportunity (deal) UUID to attribute. Required.
referrer_contact_id body string,null yes Contact UUID of the referrer. Pass null to clear the referrer.
category body string no Optional referral category (modality, service type, lead source).

📄 /api/referrals/post-referrals-attribute.md

GET /referrals/links Scopes: referrals:read

List referral links — a referrer's stable, reusable referral/affiliate links. Each carries link_url (the shareable app.trustpager.com/r/{workspace}/{handle} link). Filter by referrer_contact_id or active.

2 parameters
Name In Type Required Description
referrer_contact_id query string no
active query boolean no

📄 /api/referrals/get-referrals-links.md

POST /referrals/links Scopes: referrals:write

Create a stable referral/affiliate link for a referrer contact. Binds them to the workspace's public referral form so every signup through the link is attributed to them. slug (the public handle) defaults to the referrer's name; form_template_id defaults to the workspace 'refer-a-client' form. Returns link_url to share.

4 parameters
Name In Type Required Description
referrer_contact_id body string yes Contact UUID of the referrer/partner. Required.
slug body string no Optional public handle for the link (e.g. 'aiafy'). Defaults to a slug of the referrer's name; must be unique in the workspace.
form_template_id body string no Optional public form to bind. Defaults to the workspace's 'refer-a-client' form.
active body boolean no Defaults to true.

📄 /api/referrals/post-referrals-links.md

GET /referrals/links/:link_id Scopes: referrals:read

Fetch a referral link by UUID (includes link_url).

1 parameter
Name In Type Required Description
link_id path string yes

📄 /api/referrals/get-referrals-links-link-id.md

PATCH /referrals/links/:link_id Scopes: referrals:write

Update a referral link — change its handle (slug), bound form, or active state (deactivate to disable a partner link without deleting it).

4 parameters
Name In Type Required Description
link_id path string yes
slug body string no
form_template_id body string no
active body boolean no

📄 /api/referrals/patch-referrals-links-link-id.md

DELETE /referrals/links/:link_id Scopes: referrals:delete

Delete a referral link. Prefer setting active=false to disable a partner link while keeping its history.

1 parameter
Name In Type Required Description
link_id path string yes

📄 /api/referrals/delete-referrals-links-link-id.md

PATCH /referrals/:referral_id Scopes: referrals:write

Update a referral.

3 parameters
Name In Type Required Description
referral_id path string yes
status body string no
notes body string no

📄 /api/referrals/patch-referrals-referral-id.md

GET /referrals/:referral_id/commissions Scopes: referrals:read

List the commission instalments (scheduled / paid / cancelled) attached to a referral, ordered by due date.

1 parameter
Name In Type Required Description
referral_id path string yes

📄 /api/referrals/get-referrals-referral-id-commissions.md

POST /referrals/:referral_id/commissions Scopes: referrals:write

Add a commission instalment to a referral. amount is required; status defaults to scheduled. The cached commission summary (paid-to-date / pending / next-payment) on the referral updates automatically.

6 parameters
Name In Type Required Description
referral_id path string yes
amount body number yes
status body string no scheduled | paid | cancelled. Defaults to scheduled.
due_date body string no ISO date (YYYY-MM-DD) the instalment is expected.
paid_date body string no ISO date (YYYY-MM-DD) the instalment was paid.
notes body string no

📄 /api/referrals/post-referrals-referral-id-commissions.md

PATCH /referrals/:referral_id/commissions/:payment_id Scopes: referrals:write

Update a commission instalment (amount, status, due_date, paid_date, notes). Setting status to paid auto-stamps paid_date when none is supplied.

7 parameters
Name In Type Required Description
referral_id path string yes
payment_id path string yes
amount body number no
status body string no
due_date body string no
paid_date body string no
notes body string no

📄 /api/referrals/patch-referrals-referral-id-commissions-payment-id.md

DELETE /referrals/:referral_id/commissions/:payment_id Scopes: referrals:write

Delete a commission instalment from a referral. The cached commission summary on the referral updates automatically.

2 parameters
Name In Type Required Description
referral_id path string yes
payment_id path string yes

📄 /api/referrals/delete-referrals-referral-id-commissions-payment-id.md

CRM Export (1 endpoint)

Bulk-export CRM data as XLSX or CSV. Supports all four entity types (contacts, customers, deals, work-orders) with entity-specific filters. Custom fields auto-expand into dedicated columns. Maximum 50,000 rows per request.

📄 Full markdown: /api/crm-export.md

GET /crm/export Scopes: contacts:readcompanies:readopportunities:readwork-orders:read

Export CRM data as a downloadable file. Returns the file as an attachment (XLSX or CSV). Custom fields from company_settings are appended as dynamic columns. Work-order dynamic fields come from crm_work_order_fields. Response headers include X-Row-Count (actual rows returned) and X-Truncated (1 if the 50,000-row cap was hit).

20 parameters
Name In Type Required Description
type query string yes Entity type to export. One of: contacts, customers, deals, work-orders. The caller must hold the matching read scope for the chosen type.
format query string no File format. One of: xlsx (default), csv.
search query string no Text search. Contacts: first_name, last_name, email, phone, landline. Customers: name, email, phone, landline. Deals: name only. Not available for work-orders.
created_after query string no ISO 8601 datetime. Return records created on or after this timestamp.
created_before query string no ISO 8601 datetime. Return records created on or before this timestamp.
source query string no (contacts only) Filter by lead source string.
customer_id query uuid no (contacts, deals) Filter contacts linked to this customer, or deals belonging to this customer.
email_unsubscribed query string no (contacts only) true = opted-out contacts only, false = opted-in contacts only.
sms_unsubscribed query string no (contacts only) true = opted-out contacts only, false = opted-in contacts only.
is_customer query string no (customers only) true = is a customer, false = is not.
is_supplier query string no (customers only) true = is a supplier, false = is not.
industry query string no (customers only) Exact industry match.
status query string no (deals only) Filter by deal status. Valid values: open, won, lost.
pipeline_id query uuid no (deals only) Filter deals that are placed in this pipeline.
stage_id query uuid no (deals only) Filter deals that are placed in this specific stage.
contact_id query uuid no (deals only) Filter deals linked to this contact.
assigned_to query uuid no (deals, work-orders) Filter by assigned user UUID.
status_id query uuid no (work-orders only) Filter by work order status UUID.
deal_product_id query uuid no (work-orders only) Filter by deal product UUID.
schedule_date query string no (work-orders only) Exact date match (YYYY-MM-DD).

📄 /api/crm-export/get-crm-export.md

Export Templates (12 endpoints)

Reusable export configurations that combine a column layout, filters, sort order, and output format into a named template. Run a template to get XLSX or CSV data; preview returns the first 10 rows. Named views let each user persist their own filter/sort variant on a shared template. Scopes: exports:read, exports:write, exports:delete.

📄 Full markdown: /api/export-templates.md

GET /exports/field-catalog Scopes: exports:read

Discover which fields are available as columns and filters for a given root entity. Returns filter_fields (with allowed operator sets per field type) and column_fields (source + relation options). Call this before building a create_export_template payload so column IDs and filter ops are correct.

1 parameter
Name In Type Required Description
root_entity query string yes Entity to explore. One of: opportunity, contact, account, work_order.

📄 /api/export-templates/get-exports-field-catalog.md

GET /exports/templates Scopes: exports:read

List all export templates for this workspace.

4 parameters
Name In Type Required Description
root_entity query string no Filter by root entity. One of: opportunity, contact, account, work_order.
search query string no Partial name match.
limit query number no Items per page (default 25, max 100).
after query string no Cursor: last ID from previous page.

📄 /api/export-templates/get-exports-templates.md

GET /exports/templates/:id Scopes: exports:read

Get a single export template with full column, filter, and output config.

1 parameter
Name In Type Required Description
id path uuid yes Template ID.

📄 /api/export-templates/get-exports-templates-id.md

POST /exports/templates Scopes: exports:write

Create an export template. Define columns (root fields or relation fields), filters, optional sort, and output format.

6 parameters
Name In Type Required Description
name body string yes Template name.
root_entity body string yes One of: opportunity, contact, account, work_order.
columns body array yes Array of ExportColumn objects. Each has: id (uuid), source ("root" or "relation"), field (for root source, dotted path e.g. "name", "created_at", "metadata.cf_custom"), relation (for relation source, e.g. "primary_contact", "pipeline", "stage"), relation_mode ("primary", "first_n", "comma_joined", "explode"), relation_field (field on the related entity, e.g. "email", "name"), header (column label), format (optional: "date", "datetime", "currency", "boolean", "array").
filters body array no Array of ExportFilter objects. Each has: id (uuid), field (dotted path), op, value. Canonical ops: eq, neq, in, not_in, gte, lte, between, contains (text substring), is_null, not_null. Tags use "in" (OR -- "has any of these tags") and "not_in" (NOR -- "has none of these tags"). Reference fields (pipeline_id, stage_id, assigned_to, status): in, not_in. Legacy: "not_contains" on tags is a back-compat alias for "not_in" -- new code should use "not_in".
sort body array no Array of ExportSortEntry objects: { column_id, direction: "asc"|"desc" }. column_id must reference an ExportColumn.id from the columns array. Only root-source scalar columns can be sorted; relation columns are silently skipped.
output body object no ExportOutput config: { format: "xlsx"|"csv", bom: boolean (CSV UTF-8 BOM, default true), filename_template: string (tokens: {name}, {YYYY}, {MM}, {DD}, {YYYY-MM-DD}) }.

📄 /api/export-templates/post-exports-templates.md

PATCH /exports/templates/:id Scopes: exports:write

Update an export template. All body fields are optional; send only the fields you want to change.

6 parameters
Name In Type Required Description
id path uuid yes Template ID.
name body string no New name.
columns body array no Replacement column array (full replace, not merge).
filters body array no Replacement filter array. Canonical ops: eq, neq, in, not_in, gte, lte, between, contains (text substring), is_null, not_null. Tags use in (OR) / not_in (NOR). Legacy not_contains is a back-compat alias for not_in.
sort body array no Replacement sort array.
output body object no Replacement output config.

📄 /api/export-templates/patch-exports-templates-id.md

POST /exports/templates/:id/preview Scopes: exports:read

Preview the first 10 rows of an export template (or a saved view). Returns JSON with headers and rows -- useful for verifying filter logic before running a full export. Filters, sort, and column layout from the template (or overrides in the request body) are applied. All filter operators are supported: tags use in (OR/"has any of") / not_in (NOR/"has none of"). Legacy not_contains is a back-compat alias for not_in.

2 parameters
Name In Type Required Description
id path uuid yes Template ID.
view_id body uuid no Apply a saved view's filter/sort overrides on top of the template.

📄 /api/export-templates/post-exports-templates-id-preview.md

POST /exports/templates/:id/run Scopes: exports:read

Run an export template and download the resulting XLSX or CSV file. Up to 250,000 rows are exported (X-Truncated: 1 header if the cap is hit). Optionally apply a saved view's filter/sort overrides. Supports all filter operators: tags use in (OR/"has any of") / not_in (NOR/"has none of"); not_contains is a back-compat alias for not_in.

2 parameters
Name In Type Required Description
id path uuid yes Template ID.
view_id body uuid no Apply a saved view's filter/sort overrides before running.

📄 /api/export-templates/post-exports-templates-id-run.md

POST /exports/templates/:id/views Scopes: exports:write

Create a saved view on an export template. A view stores a per-user filter/sort overlay without modifying the base template.

4 parameters
Name In Type Required Description
id path uuid yes Template ID.
name body string yes View name.
filters body array no Filter overrides. Same ExportFilter shape as the template (see POST /exports/templates).
sort body array no Sort overrides. Same ExportSortEntry shape as the template.

📄 /api/export-templates/post-exports-templates-id-views.md

PATCH /exports/templates/:template_id/views/:id Scopes: exports:write

Update a saved view name, filters, or sort.

5 parameters
Name In Type Required Description
template_id path uuid yes Template ID.
id path uuid yes View ID.
name body string no New name.
filters body array no Replacement filter array.
sort body array no Replacement sort array.

📄 /api/export-templates/patch-exports-templates-template-id-views-id.md

Evie (In-App Agent) (4 endpoints)

Evie is the conversational AI assistant embedded in the TrustPager CRM sidebar. These endpoints are separate from the standard /api/v1 gateway and use OAuth tokens minted specifically for the in-app agent.

📄 Full markdown: /api/evie.md

POST /evie-grant

Mint an Evie OAuth token for the authenticated user. The caller must supply a Supabase JWT (portal session token) as the Bearer credential. The endpoint verifies workspace membership and returns a tp_oauth_* token scoped to the intersection of the client max-scopes and the user role scopes. Idempotent: re-calling revokes any prior Evie token for the same (user, company) pair and issues a fresh one. Store the returned access_token in sessionStorage; include it as Bearer on all /agent-chat calls.

1 parameter
Name In Type Required Description
company_id body uuid yes Target workspace company ID. Must be a workspace the authenticated user belongs to.

📄 /api/evie/post-evie-grant.md

POST /agent-chat

Run a single Evie conversation turn and stream the result via Server-Sent Events (SSE). The caller supplies a tp_oauth_* token (from /evie-grant) as the Bearer credential. Evie uses the token scopes to determine which CRM tools she can call, dispatches tool calls in-process (no HTTP round-trip per tool), and streams text + tool-call events back in real time. The thread is created automatically on the first message; supply thread_id on subsequent messages to continue a conversation. Model: TrustPager AI Standard (fast) by default; prefix your message with /think for TrustPager AI Advanced.

4 parameters
Name In Type Required Description
message body string yes User message text. Prefix with /think to use the advanced reasoning model.
thread_id body uuid no Existing thread ID for multi-turn conversations. Omit to start a new thread.
context body object no Portal context for grounding Evie in the user current location. Include current_route (e.g. /crm/opportunities/123), entity_type (opportunity|contact|company), and entity_id when on a detail page.
attachments body array no Image attachments (jpeg, png, gif, webp). Each item: { media_type, data (base64 without data: prefix), secure_file_id? }. Max 5MB per image.

📄 /api/evie/post-agent-chat.md

POST /agent-chat-compact

Compact a long Evie conversation thread into a new thread seeded with a summary of the original. Call this when a thread grows too long for efficient context handling. The original thread is marked as compacted (superseded_by_thread_id is set); the returned new_thread_id is ready for continued conversation. A mechanical compaction pass runs first (free); if the thread is still too long after that, a lightweight AI summarisation pass runs (small credit cost). The new thread starts with one assistant message summarising the conversation so far.

1 parameter
Name In Type Required Description
thread_id body uuid yes The thread to compact. Must belong to the authenticated (user, company) pair.

📄 /api/evie/post-agent-chat-compact.md

GET /api/v1/_meta/tools

Return the list of CRM tools available to the authenticated API key holder. Each tool entry includes: name (snake_case), description, input_schema (JSON Schema), preferred_model (haiku|sonnet), api_path, required_scopes, is_write, and portal_path. Tools are filtered by the caller scopes - a tp_live_* key with only contacts:read will see only read-scoped contact tools. Used internally by Evie to populate her tool catalog at chat-open; also useful for building your own agent on top of the TrustPager API.

📄 /api/evie/get-api-v1-meta-tools.md

Agent Ops (26 endpoints)

Observability and management for AI agent infrastructure. Covers: registry, run log, signals, metrics, tool log, report runs, alert rules, fired alerts, and the aggregated dashboard. All routes require agent-ops:read (reads) or agent-ops:write (writes/actions).

📄 Full markdown: /api/agent-ops.md

POST /agent-ops/registry Scopes: agent-ops:write

Register a new agent.

2 parameters
Name In Type Required Description
name body string yes
display_name body string yes

📄 /api/agent-ops/post-agent-ops-registry.md

GET /agent-ops/runs Scopes: agent-ops:read

List agent execution runs.

2 parameters
Name In Type Required Description
agent_name query string no
limit query number no

📄 /api/agent-ops/get-agent-ops-runs.md

POST /agent-ops/signals Scopes: agent-ops:write

Send an inter-agent signal.

3 parameters
Name In Type Required Description
for_agent body string yes
created_by body string yes
signal body object yes

📄 /api/agent-ops/post-agent-ops-signals.md

POST /agent-ops/metrics Scopes: agent-ops:write

Upsert a metric row.

2 parameters
Name In Type Required Description
agent_name body string yes
run_date body string yes

📄 /api/agent-ops/post-agent-ops-metrics.md

GET /agent-ops/tool-log Scopes: agent-ops:read

List agent tool-call log entries.

1 parameter
Name In Type Required Description
agent_name query string no

📄 /api/agent-ops/get-agent-ops-tool-log.md

POST /agent-ops/reports Scopes: agent-ops:write

Create an agent report-run entry.

2 parameters
Name In Type Required Description
report_name body string yes
run_date body string yes

📄 /api/agent-ops/post-agent-ops-reports.md

POST /agent-ops/alert-rules Scopes: agent-ops:write

Create an agent alert rule.

2 parameters
Name In Type Required Description
rule_type body string yes
threshold body number yes

📄 /api/agent-ops/post-agent-ops-alert-rules.md

POST /agent-ops/alerts Scopes: agent-ops:write

Record a fired agent alert.

3 parameters
Name In Type Required Description
agent_name body string yes
alert_type body string yes
message body string yes

📄 /api/agent-ops/post-agent-ops-alerts.md

INVENTORY (14 endpoints)

inventory endpoints.

📄 Full markdown: /api/inventory.md

GET /inventory/locations Scopes: products:read

List inventory locations (warehouses / stockrooms) in the workspace.

4 parameters
Name In Type Required Description
limit query number no
after query string no
search query string no
is_active query boolean no

📄 /api/inventory/get-inventory-locations.md

POST /inventory/locations Scopes: products:write

Create an inventory location (warehouse / stockroom). Requires name.

8 parameters
Name In Type Required Description
name body string yes
address_line1 body string no
city body string no
state body string no
postal_code body string no
country body string no
is_default body boolean no
is_active body boolean no

📄 /api/inventory/post-inventory-locations.md

PATCH /inventory/locations/:location_id Scopes: products:write

Update an inventory location. Pass only the fields you want to change.

4 parameters
Name In Type Required Description
location_id path string yes
name body string no
is_default body boolean no
is_active body boolean no

📄 /api/inventory/patch-inventory-locations-location-id.md

GET /inventory/batches Scopes: products:read

List inventory batches/lots. Filter by product_id or search by batch_number.

4 parameters
Name In Type Required Description
limit query number no
after query string no
product_id query string no
search query string no

📄 /api/inventory/get-inventory-batches.md

POST /inventory/batches Scopes: products:write

Create an inventory batch/lot for a product. Stock is added separately by recording a receive movement.

8 parameters
Name In Type Required Description
product_id body string yes
batch_number body string yes
initial_quantity body number yes
received_date body string no
expiry_date body string no
supplier_name body string no
purchase_cost body number no
notes body string no

📄 /api/inventory/post-inventory-batches.md

PATCH /inventory/batches/:batch_id Scopes: products:write

Update an inventory batch. The product it belongs to cannot be changed.

5 parameters
Name In Type Required Description
batch_id path string yes
batch_number body string no
expiry_date body string no
supplier_name body string no
notes body string no

📄 /api/inventory/patch-inventory-batches-batch-id.md

GET /inventory/movements Scopes: products:read

List inventory stock movements (the ledger). Filter by product_id, batch_id, or reference.

6 parameters
Name In Type Required Description
limit query number no
after query string no
product_id query string no
batch_id query string no
reference_type query string no
reference_id query string no

📄 /api/inventory/get-inventory-movements.md

POST /inventory/movements Scopes: products:write

Record a stock movement (receive, ship, transfer, adjust_in, adjust_out, dispose). Stock on hand updates automatically. receive/adjust_in need to_location_id; ship/adjust_out/dispose need from_location_id; transfer needs both. The ledger is append-only — correct mistakes with an offsetting movement.

9 parameters
Name In Type Required Description
batch_id body string yes
movement_type body string yes
quantity body number yes
from_location_id body string no
to_location_id body string no
reference_type body string no
reference_id body string no
reason body string no
notes body string no

📄 /api/inventory/post-inventory-movements.md

GET /inventory/stock Scopes: products:read

List current stock on hand (per batch, per location). Filter by batch_id or location_id. Maintained automatically from the movements ledger.

4 parameters
Name In Type Required Description
limit query number no
after query string no
batch_id query string no
location_id query string no

📄 /api/inventory/get-inventory-stock.md

GET /inventory/stock/summary Scopes: products:read

Per-product stock summary (total on hand, batch count, earliest expiry) for inventory-tracked products. Filter by product_id.

1 parameter
Name In Type Required Description
product_id query string no

📄 /api/inventory/get-inventory-stock-summary.md

COMPONENTS (12 endpoints)

components endpoints.

📄 Full markdown: /api/components.md

GET /product-components Scopes: products:read

List a product's template components (bill-of-materials parts/bundles). Filter by product_id, type, or search by label. These are product-level and reused across opportunities — for the actual lab samples/units of a job use list_component_instances.

5 parameters
Name In Type Required Description
limit query number no
after query string no
product_id query string no
type query string no
search query string no

📄 /api/components/get-product-components.md

POST /product-components Scopes: products:write

Add a template component (a BOM part/bundle) to a product. Product-level, not tied to any opportunity. Requires product_id.

8 parameters
Name In Type Required Description
product_id body string yes
type body string no
label body string no
status body string no
attributes body object no
sort_order body number no
external_ref body string no
source body string no

📄 /api/components/post-product-components.md

POST /product-components/bulk Scopes: products:write

Create up to 500 product template components in one call. Body: { components: [...] }, each item the same shape as create_product_component.

1 parameter
Name In Type Required Description
components body array yes

📄 /api/components/post-product-components-bulk.md

PATCH /product-components/:product_component_id Scopes: products:write

Update a product template component. The product it belongs to cannot be changed.

6 parameters
Name In Type Required Description
product_component_id path string yes
type body string no
label body string no
status body string no
attributes body object no
sort_order body number no

📄 /api/components/patch-product-components-product-component-id.md

GET /component-instances Scopes: products:read

List component instances (the actual units / lab samples processed for jobs), carrying result data in attributes. Filter by opportunity_id, product_id, status, or search by label.

6 parameters
Name In Type Required Description
limit query number no
after query string no
opportunity_id query string no
product_id query string no
status query string no
search query string no

📄 /api/components/get-component-instances.md

POST /component-instances Scopes: products:write

Create a component instance (a unit / lab sample) for a job. REQUIRES both product_id and opportunity_id — an instance always belongs to a product and a specific opportunity. Carry result data in attributes.

7 parameters
Name In Type Required Description
product_id body string yes
opportunity_id body string yes
label body string no
status body string no
attributes body object no
external_ref body string no
source body string no

📄 /api/components/post-component-instances.md

POST /component-instances/bulk Scopes: products:write

Create up to 500 component instances in one call. Body: { instances: [...] }, each item the same shape as create_component_instance (product_id + opportunity_id required). Used for sample-data imports.

1 parameter
Name In Type Required Description
instances body array yes

📄 /api/components/post-component-instances-bulk.md

PATCH /component-instances/:instance_id Scopes: products:write

Update a component instance. The product and opportunity it belongs to cannot be changed. Pass only the fields you want to change (e.g. status, attributes).

6 parameters
Name In Type Required Description
instance_id path string yes
label body string no
status body string no
attributes body object no
external_ref body string no
source body string no

📄 /api/components/patch-component-instances-instance-id.md