Troupia API
Connect any system to your automations, runs and conversations, with one key.
First: an API key
An owner or admin creates it in Settings → API keys and chooses what it may do. Every request sends it like this:
Authorization: Bearer trp_live_…
Automations
/v1/automationsAll automations
Your workspace's automations, a page at a time.
automations:read/v1/automations/{automationId}One automation
Its steps, every way it starts and its version. Never a secret.
automations:readETag: "7.1a2b3c4d"
Keep the ETag. A change sends it back.
/v1/automations/{automationId}Rename
automations:writeIf-Match: "7.1a2b3c4d"
If someone changed the automation since you read it: 412, and nothing is overwritten. Read it again and decide.
/v1/automations/{automationId}/enableTurn on
The plan's schedule floor applies, as in the app.
automations:writeIf-Match: "7.1a2b3c4d"
Asking for the state it is already in returns 200 and changes nothing. Scheduled runs are kept.
/v1/automations/{automationId}/disableTurn off
automations:writeIf-Match: "7.1a2b3c4d"
Asking for the state it is already in returns 200 and changes nothing. Scheduled runs are kept.
/v1/automations/resolve-linkFrom a link
A Troupia link → the automation or run it names.
automations:readRuns
/v1/automations/{automationId}/runsAn automation's runs
A page at a time.
runs:read/v1/automations/{automationId}/analysisRuns analysed
How many succeeded, how many failed and why, over a window.
runs:read/v1/automations/runs/{runId}One run
With what went in and out of each step.
runs:read_payloads/v1/runs/{runId}A chat run
data:readConversations
/v1/conversationsConversations
data:read/v1/conversationsStart a conversation
chat:write/v1/conversations/{conversationId}/messagesSend a message
chat:write/v1/conversations/{conversationId}/exportExport a conversation
data:readWebhooks
/v1/automations/{automationId}/webhookWebhook addresses and their secrets
webhooks:manageOnly an owner's or admin's key: checked on every call, and every call is logged.
/v1/webhook-endpoints/{endpointId}/deliveriesFailed deliveries
To one outgoing endpoint: newest first, a page at a time.
webhooks:managePlugins
/v1/plugins/{slug}/openapi.jsonA plugin's API
Each plugin publishes its own OpenAPI document.
data:read/v1/plugins/{slug}/{entity}A plugin's records
data:read/v1/plugins/{slug}/{entity}Create a record
data:write/v1/plugins/{slug}/{entity}/{id}One record
data:read/v1/plugins/{slug}/{entity}/{id}Update a record
data:write/v1/plugins/crm/{path}Read from the CRM
crm:read/v1/plugins/crm/{path}Write to the CRM
crm:writeAbout the API
/v1/openapi.jsonThis document
As OpenAPI 3.1, no key needed.
No keyWhen something does not go through
| 401 | No key, or it is not valid. |
| 403 | The key does not have this permission. |
| 404 | Not found in this workspace. |
| 412 | The automation changed since you read it. |
| 428 | If-Match is missing. |
| 429 | Too many requests. Wait and try again. |