# Escalate a conversation to an agent In this setup we expect you to have your own widget for the end user to start the conversation. And then you will use our import conversation endpoint to either escalate to an agent or have a closed conversation be added to Dixa for analytics and auto QA. The document covers three main sections — Handoff Setup, Adding Conversations to Dixa, and Adding Custom Attributes — with all API endpoints linked, curl examples formatted as proper code blocks, and a field reference table for the key IDs. ## Handoff Setup To prepare your conversation for the escalation then you need to know which end-user ID to use, which you can find at [List end-user](https://docs.dixa.io/openapi/dixa-api/v1/end-users/getendusers). To create a conversation use the [Import Conversation API](https://docs.dixa.io/openapi/dixa-api/v1/conversations/postconversationsimport). The "genericChannelName" should be set to "genericapimessaging", and the "agentId" must be the chatbot user that's created for you. After the conversations have been created, transfer it to a queue using the [Transfer to Queue API](https://docs.dixa.io/openapi/dixa-api/v1/conversations/putconversationsconversationidtransferqueue) endpoint. Queues in Dixa is used different between the customers, so make sure that you are transfering the conversation to the appropriate queue. For webhooks, add a filter for **Generic API Messaging** to keep focus on relevant events and only receive relevant events. Select **Message added** and **Closed conversation** events so that the chatbot can pick up the contact again when the agent has helped out. Optionally, check for **"Typing started"** to show typing indicators on the chatbot's widget. Note: it is not possible to read events and show them in the agent interface. ## Add Conversation Between Contact and Chatbot to Dixa Use the [Import Conversation API](https://docs.dixa.io/openapi/dixa-api/v1/conversations/postconversationsimport). ### Field Reference | Field | Description | | --- | --- | | `requesterId` | End-user ID | | `agentId` | Bot ID | | `queueId` | Queue ID for human staffed queues | ## Add Custom Attribute to the Conversation Use the [Patch Custom Attributes API](https://docs.dixa.io/openapi/dixa-api/v1/tag/Custom-Attributes/#tag/Custom-Attributes/operation/patchConversationsConversationidCustom-attributes). To retrieve available custom attributes, use the [Get Custom Attributes API](https://docs.dixa.io/openapi/dixa-api/v1/tag/Custom-Attributes/#tag/Custom-Attributes/operation/getCustom-attributes).