1MSG
ReferenceInbox API

Open or close a conversation

PATCH
/api/v1/inbox/conversations/{conversationId}/status

Send status OPEN or CLOSED in the JSON body. The conversation id alone does not change anything. A change writes a SYSTEM message. The same status again returns 409.

Authorization

bearer
headerAuthorizationBearer <token>

Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.

Path Parameters

conversationId*string

Conversation id

Request Body

application/json
  1. body
status*string

OPEN reopens the conversation. CLOSED closes it. Repeating the current value returns 409.

Value in"OPEN""CLOSED"

Response Body

application/json
  1. response
id*string
channelId*string

Channel id, for example QAF261225002

contactId*string
status*string

The key sets only OPEN or CLOSED. Other values can appear on older rows.

Value in"OPEN""CLOSED""ASSIGNED""RESOLVED""BLOCKED"
assignedTo?|

User id of the assignee. Null when unassigned.

assignedUser?|null
lastMessageAt?|
Formatdate-time
isUnread*boolean
tags*array<string>
lastMessagePreview?string|null
lastMessageType?string|null
lastMessageDirection?|
Value in"INBOUND""OUTBOUND"
lastMessageStatus?string|null
unreadCount*number
isBlocked*boolean
title?|

Custom title. Null until renamed.

lastCustomerMessageAt?|

Last inbound customer message. Used for the WhatsApp service window.

Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
contact?|

Present on GET conversation, list, and search. Absent on block, title, and status writes.

channelType?string

Present on reads.

customerPhone?|

Customer phone taken from the contact.

curl -X PATCH 'https://api.1msg.io/api/v1/inbox/conversations/string/status' \  -H 'Content-Type: application/json' \  -d '{  "status": "CLOSED"}'
{  "id": "string",  "channelId": "string",  "contactId": "string",  "status": "OPEN",  "assignedTo": "string",  "assignedUser": {    "id": "b2bb82f0-2253-4e05-b955-a21f3d699caa",    "name": "QA Stage",    "avatar": null  },  "lastMessageAt": "2019-08-24T14:15:22Z",  "isUnread": true,  "tags": [    "string"  ],  "lastMessagePreview": "string",  "lastMessageType": "string",  "lastMessageDirection": "INBOUND",  "lastMessageStatus": "string",  "unreadCount": 0,  "isBlocked": true,  "title": "string",  "lastCustomerMessageAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "contact": {    "id": "string",    "phoneNumber": "79001234567",    "name": "string",    "avatar": "string"  },  "channelType": "WABA",  "customerPhone": "string"}