Skip to main content
If your team already has its own routing logic, with the API destination you don’t have to replicate it in Treble. Treble calls your endpoint with the chat’s context and respects the agent you return. API destination

Configuration

1

Select the API destination

In the block configuration, choose API and click Next.
2

Enter the endpoint URL

Write the URL Treble will make the POST request to when the conversation reaches the block.Configuring the endpoint URL
3

Choose the authentication type

  • No authentication — Treble calls your endpoint without credentials.
  • Token / API Key — enter a token that Treble will send in the Authorization header with the format Bearer YOUR_TOKEN, so your endpoint can verify the call comes from Treble.
Configuring the authentication token
4

Complete the team and save

Select the team in Tags, add Labels if you need them, and click Save changes.
Done! When a conversation reaches the block, Treble will call your endpoint to resolve the agent.

The contract

Your endpoint receives the contact’s and the conversation’s context, and must respond with the agent who will attend to it:
Your endpoint must respond in less than 10 seconds. If it exceeds that, returns a status code other than 200, or returns an agent that can’t receive the conversation, Treble applies the fallback method configured in the main platform.
The full reference —the exact body Treble sends, the two ways to identify the agent, and an implementation example— is in the API reference.

Webhook reference

The body Treble sends and the response you must return.

Get the agents

Look up the agents in your account to know which email or id to return.