Get conversation
Returns one conversation and, with include=messages, its last 20 messages in time order. Use list_messages with conversation_id for older messages. Read-only.
GET /v1/conversations/{conversation_id}
| Permission | inbox:read (all permissions) |
| Risk | Read |
| Idempotency-Key | Not needed (how it works) |
| Safe to repeat | Safe: the call only reads. |
| Rate limit class | read (120 requests per minute per key) |
| Confirmation | None |
| MCP tool | get_conversation |
| Since version | 2026-10-25 |
#What it does
- Only reads data. It changes nothing and sends nothing.
#Request
Path parameters
| Name | Type | Description |
|---|---|---|
conversation_id | string | Conversation ID from list_conversations. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
include | string | no | Set to messages to add the last 20 messages. one of: messages |
#Examples
curl "https://api.smartchat.marketing/v1/conversations/cnv_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6?include=messages" \
-H "Authorization: Bearer $SMARTCHAT_API_KEY"import os
import requests
response = requests.get(
"https://api.smartchat.marketing/v1/conversations/cnv_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6",
headers={"Authorization": "Bearer " + os.environ["SMARTCHAT_API_KEY"]},
params={
"include": "messages",
},
)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.smartchat.marketing/v1/conversations/cnv_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6?include=messages", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SMARTCHAT_API_KEY}`,
},
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());Response (200):
{
"object": "conversation",
"id": "cnv_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6",
"contact": {
"id": "con_0f8c1a2e4b7d4c3e9a5b6d7e8f901234",
"name": "Mia Muster",
"phone": "+4915112345678"
},
"last_message": "Is a table free on Friday?",
"last_message_at": "2026-10-25T09:41:07Z",
"last_direction": "inbound",
"unread_count": 1,
"window_open": true,
"window_expires_at": "2026-10-26T09:41:07Z",
"origin": "direct",
"created_at": "2026-10-25T09:41:07Z",
"messages": [
{
"object": "message",
"id": "msg_7a8b9c0d1e2f4a3b8c4d5e6f7a8b9c0d",
"conversation_id": "cnv_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6",
"contact_id": "con_0f8c1a2e4b7d4c3e9a5b6d7e8f901234",
"direction": "inbound",
"type": "text",
"text": "Is a table free on Friday?",
"media_url": null,
"media_mime": null,
"sent_by_ai": false,
"status": null,
"created_at": "2026-10-25T09:41:07Z"
}
]
}#Response
Status 200. Every response has the headers Request-Id, SmartChat-Version and X-RateLimit-*.
| Name | Type | Description |
|---|---|---|
object | string | Always "conversation". always conversation |
id | string | Conversation ID. |
contact | object | The contact of the conversation (short form). |
contact.id | string or null | Contact ID. Null if the contact no longer exists. up to 36 characters |
contact.name | string or null | Name of the contact. Untrusted text. up to 2000 characters; untrusted text |
contact.phone | string or null | Phone number in E.164 format. |
last_message | string or null | Text of the last message. Comes from the contact or the team: untrusted text. up to 4100 characters; untrusted text |
last_message_at | string or null | When the last message was sent or received. up to 40 characters; format date-time |
last_direction | string or null | Direction of the last message: inbound or outbound. Null if there is none. one of: inbound, outbound, null |
unread_count | integer | Number of unread inbound messages. 0 to 1000000 |
window_open | boolean | True while the 24-hour window is open and free text may be sent. |
window_expires_at | string or null | When the 24-hour window closes. Null if there is no window. up to 40 characters; format date-time |
origin | string or null | How the conversation started: newsletter, followup, automation or direct. Open list. up to 30 characters |
created_at | string | When the conversation was created. up to 40 characters; format date-time |
messages | array of object | The last messages, oldest first. Only present with include=messages. Untrusted text. up to 20 items |
messages[].object | string | Always "message". always message |
messages[].id | string | Message ID, for example msg_ followed by 32 hex characters. The same 32 characters are in the ID of a text send (snd_...) for the same message. |
messages[].conversation_id | string | Conversation ID. |
messages[].contact_id | string or null | Contact ID. up to 36 characters |
messages[].direction | string | inbound = from the contact, outbound = from the account. one of: inbound, outbound |
messages[].type | string | Message type, for example text, image, video, audio, document or template. up to 20 characters |
messages[].text | string or null | Text of the message. Untrusted text. up to 4100 characters; untrusted text |
messages[].media_url | string or null | Link to the attached file, if any. up to 2000 characters |
messages[].media_mime | string or null | Media type of the attached file, if any. up to 100 characters |
messages[].sent_by_ai | boolean | True if SmartChat AI wrote and sent this reply. |
messages[].status | string or null | Delivery status of an outbound message. Null for inbound messages. one of: sent, delivered, read, failed, null |
messages[].created_at | string | When the message was sent or received. up to 40 characters; format date-time |
#Errors
| Code | Status | When |
|---|---|---|
unknown_parameter | 400 | A field is not known. |
api_key_expired | 401 | This API key has expired. |
api_key_invalid | 401 | This API key is not valid. |
api_key_revoked | 401 | This API key was revoked. |
authentication_required | 401 | No API key was sent. Send 'Authorization: Bearer <key>'. |
account_blocked | 403 | This account is blocked. |
insufficient_scope | 403 | This key lacks a required permission. |
ip_not_allowed | 403 | This IP address is not allowed for this key. |
conversation_not_found | 404 | No conversation with this ID exists in this account. |
validation_failed | 422 | A field is not valid. |
rate_limited | 429 | Too many requests. Wait and try again. |
internal_error | 500 | Something went wrong on our side. |
service_unavailable | 503 | The service is temporarily unavailable. |
All errors use one format.