Talkdesk Automation Flows permits you to start a flow based on something that happens in Talkdesk (a Talkdesk Event trigger) or based on something that happens in an external system.
For external systems, there are two options:
- API trigger: Your system calls the Talkdesk API, authenticated with an OAuth token.
- Webhook trigger: Your system sends an HTTP POST to a unique URL that Talkdesk generates for the flow. No OAuth is needed.
Which one should I use?
| API trigger | Webhook trigger | |
|---|---|---|
| Typical caller | Your own backend, scripts, or integrations that already call Talkdesk APIs | Third-party tools that can only call a URL when something happens (GitHub, Slack, billing or monitoring tools) |
| Authentication | OAuth Client Credentials: a Bearer token with the flows-platform: submit scope | None to configure. The URL itself is the secret |
| Request format | JSON, with your variables wrapped in "inputs" | JSON or form-encoded. The body fields are the variables |
| Rotating access | Manage or rotate the OAuth client credentials | Click Regenerate in the webhook component to get a new URL |
Use the API trigger when you control the calling code and want standard Talkdesk API authentication, token expiry, and scoped access. Use Webhook when the other system decides what it sends and cannot do an OAuth handshake.
Option 1: API trigger
- Choose API as the flow trigger. In Automation Flows, create a flow and add API trigger as the first step.
- Define the variables. In the trigger, add the variables the caller will send, for example, customer_id and order_id. They become the request body parameters. If the caller leaves one out, it stays undefined.
- Save and publish the flow.
- Create an OAuth client with the flows-platform: submit scope, following the client credentials guide. Store the client ID and secret in your secrets manager.
- Copy the code snippet. Open the trigger in the flow editor and click Copy code. It generates a ready-to-use call with your flow ID and variables filled in.
- Check the result. A successful response means the flow was triggered. Use the flow's execution history to see how the run went.
Notes:
- API requests are limited to 10 per second.
- Tokens expire. Request a new one when the old one expires instead of hard-coding it.
Option 2: Webhook trigger
- Choose Webhook as the flow trigger. Add Webhook Trigger as the first step.
- Define the variables. Add one variable for each field the sender includes in its payload, named exactly like the field. A variable stays empty if the sender does not send it.
- Copy the webhook URL. The editor shows a unique URL in the form {talkdesk_api_url}/flows-platform/webhooks/{token}. Click Copy code to get a sample curl.
- Save and publish the flow. The flow must be published for the webhook to start.
- Paste the URL into the external system as a POST webhook destination. Choose application/json or application/x-www-form-urlencoded.
- Test it:
curl --request POST \
--url {webhook_url} \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "CUSTOMER-ID-PLACEHOLDER",
"order_id": "ORDER-ID-PLACEHOLDER"
}'- Check the result. A successful call returns HTTP 200 with an empty body. An invalid or unknown URL returns an error, so copy the URL again from the editor. Use the flow's execution history to see the payload received and how the run went.
Keeping the URL safe
- Treat the URL like a password. Anyone who has it can trigger the flow. Do not paste it in tickets, chats, or public repositories.
- If it may have leaked, click Regenerate in the webhook component, then update the URL in the external system, save, and publish. The old URL keeps working until you save and publish the flow, so you can switch over without downtime.
Troubleshooting
| Symptom | Likely cause |
| API trigger returns 401 or 403 | Expired token, or the OAuth client does not have the flows-platform: submit scope |
| API trigger call succeeds, but variables are empty | Variables are not wrapped in "inputs", or their names do not match the trigger's variables |
| Webhook returns an error or not found | Wrong or regenerated URL, or the flow is not published |
| Webhook runs, but variables are empty | Field names in the payload do not match the variable names |
| API or Webhook triggers are not triggering the flow | Make sure that the flow is published and active |
To know more about how to troubleshoot your flow, please check this article.