Assignment webhook reference
This endpoint must be implemented on YOUR server (for example: https://yourdomain.com/webhooks/on-agent-assignation). Treble will call it when a conversation reaches a Transfer Methods block configured with the API destination, so your system can decide which agent should receive the chat.
The URL is configured in the block itself, inside the conversation editor. If you enable Token / API Key authentication, Treble will include your token in the Authorization header with the format Bearer YOUR_TOKEN.
You must respond in less than 10 seconds. If your server doesn’t respond in time, returns a status code other than 200, or returns an agent that can’t receive the conversation, Treble will apply the fallback method configured in the main platform.
Headers
Only if you configured Token / API Key authentication in the block. Treble sends the token with the format Bearer YOUR_TOKEN.
Body
Context of the contact and the conversation that Treble sends to your endpoint
Body Treble sends to your endpoint so you can decide which agent receives the conversation.
Your company's identifier in Treble.
1234
Identifier of the contact's session in the conversation.
567890
Information about the contact in the conversation.
The CRM your account is integrated with, for example salesforce or hubspot. It's null if the account has no CRM integration.
"salesforce"
CRM records associated with the contact. An empty array means the contact isn't associated with any record yet.
Channel the conversation came in through.
Context of the flow and the block that originated the call.
Response
The agent Treble must assign the conversation to. Return agent_email (recommended) or agent_id.
Response your server must return indicating the agent who will receive the conversation. Use agent_email or agent_id.