Skip to main content
GET/conversations/:id/

Get single conversation

You can return details about a specific conversation.

Attributes

Optional unless marked required

idintegerrequired
A unique identifier for the conversation which is given by User automatically.

Request​

curl -X GET "https://<your_app_subdomain>.user.com/api/public/conversations/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"

Response examples​

{
"count": 1,
"next": null,
"previous": null,
"results": {
"id": 1,
"assigned_to": {
"id": 1,
"key": "g7lvoickax9e",
"name": "Jane Agent",
"email": "agent@example.com"
},
"active": true,
"agent": {
"id": 1,
"name": "Jane Agent"
},
"messages": [
8 fields
]
}
}

Response fields​

Fields returned in the 200 OK response body.

countinteger
Number of results across all pages. It can lag behind recent changes; see Response pagination.
nextstring (URL)nullable
URL of the next page of results. null on the last page.
previousstring (URL)nullable
URL of the previous page of results. null on the first page.
resultsobject
Results on this page.
results.idinteger
A unique identifier for the conversation which is given by User automatically.
results.assigned_toobject
The contact the conversation is with.
results.assigned_to.idinteger
ID of the contact.
results.assigned_to.keystring
The contact's user_key: a 12-character identifier assigned by User.
results.assigned_to.namestring
The contact's name.
results.assigned_to.emailstring
The contact's email address, or null if they have none.
results.activeboolean
Whether the conversation is open. false once it is closed.
results.agentobject
The agent group the conversation is assigned to, or null.
results.agent.idinteger
ID of the agent group.
results.agent.namestring
Name of the agent group.
results.messagesarray of objects
Messages in the conversation, newest first, 25 per page.
results.messages[].idinteger
A unique identifier for the conversation which is given by User automatically.
results.messages[].chatinteger
ID of the conversation the message belongs to.
results.messages[].userobject
Who wrote the message.
results.messages[].user.idinteger
A unique identifier for the conversation which is given by User automatically.
results.messages[].user.keystringnullable
The contact's user_key, or null when an agent wrote the message.
results.messages[].user.namestring
Name of the contact or agent who wrote the message.
results.messages[].user.emailstring
Email address of the contact or agent who wrote the message.
results.messages[].contentstring
A content of a message sent to the user.
results.messages[].timestampstring (date-time)
When the message was sent, ISO 8601.
results.messages[].source_contextobject
An additional context for your source (only visible for you).
results.messages[].sourcestring
Where the message was sent from, as a label, for example Chat, Email or API. See Message source types.
results.messages[].attachmentsobjectnullable
Files and images sent with the message, or the details of a conversation event (such as an assignment) for an event message; null if there are none.
results.messages[].attachments.typestring
Kind of conversation event, for example assignee_changed, chat_opened or chat_closed.
results.messages[].attachments.agent_idinteger
ID of the agent who assigned the conversation.
results.messages[].attachments.assigneestring
Name of the agent group the conversation was assigned to.
results.messages[].attachments.meta_textstring
Template of the event text shown in the conversation, with placeholders such as {assignee} and {assigned_by}.
results.messages[].attachments.assigned_bystring
Name of the agent who assigned the conversation.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.