Skip to main content
POST
Webhook - Decide which agent receives the conversation

Headers

Authorization
string

Only if you configured Token / API Key authentication in the block. Treble sends the token with the format Bearer YOUR_TOKEN.

Body

application/json

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.

company_id
integer

Your company's identifier in Treble.

Example:

1234

survey_user_id
integer

Identifier of the contact's session in the conversation.

Example:

567890

contact
object

Information about the contact in the conversation.

crm_type
string | null

The CRM your account is integrated with, for example salesforce or hubspot. It's null if the account has no CRM integration.

Example:

"salesforce"

crm_objects
object[]

CRM records associated with the contact. An empty array means the contact isn't associated with any record yet.

channel
object

Channel the conversation came in through.

metadata
object

Context of the flow and the block that originated the call.

Response

200 - application/json

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.

agent_email
string

The agent's email as registered in Treble. It's the recommended option because it doesn't depend on Treble's internal identifiers.

Example:

"andrea.soto@yourcompany.com"

agent_id
integer

The agent's identifier in Treble.

Example:

4567