Skip to content

Import conversation

Request

Import a previously created conversation into Dixa. For inbound messages the author is assumed to be the requester of the conversation (end user), unless the specific channel supports overriding the message author through its attributes. For outbound messages the author is specified using the agentId field.

Security
ApiKeyAuth(Required scopes: conversation.import)
Bodyapplication/jsonrequired

The type of conversation to import

genericChannelNamestringrequired

The conversation channel. Currently supported values are 'email' and 'genericapimessaging'. See payload examples for each case.

requesterIdstring, (uuid)required
requesterConnectionStatusstring

values: [Connected, Disconnected]

directionstringrequired

values: [Inbound, Outbound]

messagesArray of any(ImportMessageInput)
createdAtstring, (date-time)required
assignmentobject(Assignment)
externalIdstring
closingobject(Closing)

Triggers the closing of the conversation

attributesany

A set of dynamic attributes that are specific to the conversation channel, but not limited to it. See channel specific examples for your use case.

POST
/v1/conversations/import
curl -i -X POST \
  https://dev.dixa.io/v1/conversations/import \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "genericChannelName": "genericapimessaging",
    "requesterId": "9c2a2cce-699f-4a72-89d9-fda5bc8dec8b",
    "requesterConnectionStatus": "Connected",
    "direction": "Inbound",
    "messages": [
      {
        "content": {
          "value": "Hi, I need help with my order",
          "_type": "Text"
        },
        "attachments": [],
        "createdAt": "2021-12-01T13:00:00.003Z",
        "_type": "InboundImport"
      },
      {
        "content": {
          "value": "Sure — what seems to be the problem?",
          "_type": "Text"
        },
        "agentId": "cd4ceb58-bb3a-443c-9cd8-4f088feafe5b",
        "attachments": [],
        "createdAt": "2021-12-01T14:00:00.004Z",
        "_type": "OutboundImport"
      }
    ],
    "createdAt": "2021-12-01T11:00:00.001Z",
    "assignment": {
      "agentId": "cd4ceb58-bb3a-443c-9cd8-4f088feafe5b",
      "assignedAt": "2021-12-01T12:00:00.002Z"
    },
    "_type": "GenericConversationImport"
  }'

Responses

The id of the imported conversation

Bodyapplication/json
dataobject(ImportConversationResponse)required
Response
{ "data": { "id": 100, "partialErrors": [ … ] } }