Complete instant messaging API for WhatsApp Multi-Device & Business API.

Base URLs:

Authentication

SCOPE SCOPE DESCRIPTION
ACCOUNT_READ Read all available accounts
ACCOUNTS_READ_ASSIGNED Access to read assigned channels
ACCOUNT_CREATE Add an additional IM account
ACCOUNT_PATCH Update an existing IM account (open, close, logout etc)
ACCOUNT_DELETE Delete an IM account
CHATS_ACCESS_ALL Allow the access of All Chats
CHATS_ACCESS_ASSIGNED Allow the access of assigned Chats
MESSAGES_SEND_TO_ASSIGNED Allow the sending of Messages to Assigned
MESSAGES_DELETE Allow the deletion of Messages
MESSAGES_SEND_TO_ALL Allow the access of Messages to All
GROUPS_UPDATE Allow the updating of Groups
GROUPS_CREATE Allow the creating of Groups
CONTACTS_READ_ALL Read All contacts
CONTACTS_READ_ASSIGNED Read Assigned contacts
CONTACTS_UPDATE Allow the updating of contacts
CONTACTS_DELETE Allow the deletion of contacts
CONTACTS_CREATE Allow the creation of contacts
TAGS_READ Can read tags
TAGS_DELETE Allow the deletion of Tags
TAGS_CREATE Allow the creation of Tags
TEMPLATES_CREATE Allow the creation of Message Flows
PRODUCTS_CREATE Create a platform product
PRODUCTS_UPDATE Update a platform product
PRODUCTS_DELETE Delete a platform product

Account

accountsGet

GET /accounts

Get the list of all accounts

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
q query string false search accounts by ID/Nickname
all query boolean false none
state query AccountState false only fetch accounts with a state
page query integer false none
count query integer false none
returnCount query boolean false return total count of accounts
Enumerated Values
PARAMETER VALUE
state open
state connecting
state close
{
“accounts”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“ownerId”: “5a0555af-b9a0-4c41-865e-c6e3562a72aa”,
“assignees”: [
“string”
],
“nickname”: “string”,
“credentials”: {
“property1”: null,
“property2”: null
},
“type”: “wa”,
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“lastLoginAt”: “2019-08-24T14:15:22Z”,
“lastLogoutAt”: “2019-08-24T14:15:22Z”,
“lastClosedAt”: “2019-08-24T14:15:22Z”,
“state”: “open”,
“error”: {
“message”: “string”
},
“stateInfo”: {
“property1”: null,
“property2”: null
},
“canLogin”: true,
“userId”: “string”,
“user”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“settings”: {
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: []
},
“outgoing”: {
“enabled”: true,
“assignees”: []
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
}
}
],
“total”: 0
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» accounts [Account] true none none
»»» tags [ContactTag] true none Tags associated with this contact
»»» assignee string¦null false none The assignee of the contact
»»» assigner string¦null false none The person who assigned this contact
»»» messagesSent number true none none
»»» messagesReceived number true none none
»»» chat object false none none
»»» sendButtonsAsPoll boolean false none Should polls be sent as buttons instead of a message. This is useful for the regular WhatsApp API
»»» autoSyncProductsToPlatform boolean false none Should products be synced to WhatsApp automatically.
» total number false none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_READ ACCOUNTS_READ_ASSIGNED )

accountsPost

POST /accounts

Add a new account

{
“type”: “wa”,
“tier”: “limited_msg_no_chat_history”,
“nickname”: “string”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
body body object false none
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“ownerId”: “5a0555af-b9a0-4c41-865e-c6e3562a72aa”,
“assignees”: [
“string”
],
“nickname”: “string”,
“credentials”: {
“property1”: null,
“property2”: null
},
“type”: “wa”,
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“lastLoginAt”: “2019-08-24T14:15:22Z”,
“lastLogoutAt”: “2019-08-24T14:15:22Z”,
“lastClosedAt”: “2019-08-24T14:15:22Z”,
“state”: “open”,
“error”: {
“message”: “string”
},
“stateInfo”: {
“property1”: null,
“property2”: null
},
“canLogin”: true,
“userId”: “string”,
“user”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“settings”: {
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: [
“string”
]
},
“outgoing”: {
“enabled”: true,
“assignees”: [
“string”
]
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
}
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Account

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_CREATE )

accountsOpen

POST /accounts/{accountId}/open

Open connection to the account

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK None

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

accountsClose

POST /accounts/{accountId}/close

Close connection to the account

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
logout query boolean false Closes the account and logs out from the account
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK None

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

accountsLogout

POST /accounts/{accountId}/logout

Logout and clear credentials from the account

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

accountsPatch

PATCH /accounts/{accountId}

Update an account

Update name of the account or its settings

{
“nickname”: “string”,
“tier”: “limited_msg_no_chat_history”,
“settings”: {
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: [
“string”
]
},
“outgoing”: {
“enabled”: true,
“assignees”: [
“string”
]
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
},
“credentials”: {
“type”: “alibaba-cams-v2”,
“initialAccessToken”: “string”,
“wabaId”: “string”,
“templateNamespace”: “string”,
“custSpaceId”: “string”,
“secret”: “string”
},
“assignees”: [
“string”
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
body body AccountsPatchRequest false none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

accountsDelete

DELETE /accounts/{accountId}

Delete an account

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_DELETE )

accountsArchive

POST /accounts/{accountId}/archive

Archive an account. Logs out of the account & removes all synced chats, messages. Keeps contacts, and notes.

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_DELETE )

Chats

chatsGet

GET /chats

Get chats

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
count query number false none
page query string false none
archive query boolean false none
unread query boolean false none
hasPendingMessage query boolean false none
mentioned query string false none
hasUnsolvedNote query boolean false none
hasFailedMessage query boolean false none
lastMessageFromMe query boolean false none
tags query array[string] false Get contacts who fall in either of these tags
notTags query array[string] false Get contacts who are not in any of these tags
contacts query array[string] false Get these specific contact ids
q query string false Search string for contact name/phone number/email
assignee query array[string] false Get contacts assigned to the specified users
accountId query array[string] false Get contacts only belonging to this account
type query string false only get contacts of type
returnUnreadChatCount query boolean false none
Enumerated Values
PARAMETER VALUE
type group
type individual
{
“nextPage”: “string”,
“unreadChatCount”: 0,
“hasMoreUnread”: true,
“chats”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“lastMessage”: “2019-08-24T14:15:22Z”,
“unread”: -1,
“spam”: true,
“archive”: true,
“readOnly”: true,
“mute”: 0,
“pin”: 0,
“isUserGenerated”: true,
“hasPendingMessage”: true,
“hasUnsolvedNote”: true,
“hasFailedMessage”: true,
“mentions”: [
“string”
],
“disappearingMessages”: 0,
“hasEntireMessageHistory”: true,
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: []
},
“attachments”: [
{}
],
“buttons”: [
{}
],
“poll”: {
“options”: [],
“maxSelections”: 0
},
“products”: [
{}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{}
]
}
],
“presences”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“contactId”: “string”,
“userId”: “string”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“type”: “available”
}
],
“cursor”: “string”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» nextPage string false none next page cursor, if it exists
» unreadChatCount number false none number of total unread chats given the filter
» hasMoreUnread boolean false none the API counts at most N unread chats, if there are more unread chats that were not fetched, this flag is true
» chats [Chat] true none none
»»» tags [ContactTag] true none Tags associated with this contact
»»» assignee string¦null false none The assignee of the contact
»»» assigner string¦null false none The person who assigned this contact
»»» messagesSent number true none none
»»» messagesReceived number true none none
»»» chat object false none none
»» messages [allOf] false none none

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»»»» randomizeMessage boolean false none Adds random whitespace to produce a distinct message
»»»»» buttonReplyId string false none the ID of the button clicked
»»»»» pollReplyOptions [string] false none the option of the poll that was clicked
»»»»» cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received

and

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»»» deleted boolean false none True, if the message was deleted
»»»» action object¦null false none none
»»»»» type string true none none
»»»»» parameters [string] false none none
»»»» attachments [MessageAttachment] false none none
»»»» buttons [MessageButton]¦null false none none
»»»» products [MessageProduct]¦null false none none
»»»» order object¦null false none none
»»»»» orderId string true none none
»»»»» jpegThumbnail string(base64) false none none
»»»»» itemCount integer false none none
»»»»» sellerId string true none none
»»»»» token string true none none

continued

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»» presences [ChatPresence] false none none
»» cursor string true none cursor to sort chats by

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL CHATS_ACCESS_ASSIGNED )

chatsPatch

PATCH /chats/{accountId}/{id}

Update a chat — read, unread, archive, pin etc.

{
“action”: “archive”,
“value”: true
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path ContactID true none
body body ChatAction false none
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“lastMessage”: “2019-08-24T14:15:22Z”,
“unread”: -1,
“spam”: true,
“archive”: true,
“readOnly”: true,
“mute”: 0,
“pin”: 0,
“isUserGenerated”: true,
“hasPendingMessage”: true,
“hasUnsolvedNote”: true,
“hasFailedMessage”: true,
“mentions”: [
“string”
],
“disappearingMessages”: 0,
“hasEntireMessageHistory”: true,
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: []
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
],
“presences”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“contactId”: “string”,
“userId”: “string”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“type”: “available”
}
],
“cursor”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Chat

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL CHATS_ACCESS_ASSIGNED )

chatsPresencePost

POST /chats/{accountId}/{id}/presence

Update a chat’s presence.

Note: Sending an “available” presence, will also subscribe you to events from the other party

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
presence query PresenceType true none
accountId path string true none
id path ContactID true none
Enumerated Values
PARAMETER VALUE
presence available
presence unavailable
presence typing
presence stoppedTyping
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ASSIGNED CHATS_ACCESS_ALL )

Chat History

getChatHistory

GET /chat-history

Fetch chat history as a file

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
timeZone query string false none
chatId query array[string] false none
{
“requestId”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» requestId string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL )

pollChatHistory

GET /chat-history/{requestId}

Poll route to see if file is done

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
requestId path string true none
{
“url”: “string”,
“status”: “success”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» url string false none none
» status string false none none
Enumerated Values
PROPERTY VALUE
status success
status executing
status error

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL )

Contacts

contactsImageGet

GET /contacts/{accountId}/{id}/image

Get the display image of a contact

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
id path string true none
accountId path string true none
type query string false Whether to fetch preview sized image or the full image
Enumerated Values
PARAMETER VALUE
type preview
type full
{
“url”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» url string¦null true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

contactsGet

GET /contacts

Get contacts

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
returnTotalCount query boolean false none
returnLastMessage query boolean false none
page query string false none
count query object false none
tags query array[string] false Get contacts who fall in either of these tags
notTags query array[string] false Get contacts who are not in any of these tags
contacts query array[string] false Get these specific contact ids
notContacts query array[string] false Do not get these specific contacts
minMessagesSent query integer false Minimum messages sent
minMessagesRecv query integer false Minimum messages received
maxMessagesSent query integer false Maximum messages sent
maxMessagesRecv query integer false Maximum messages received
q query string false Search string for contact name/phone number/email
assignee query array[string] false Get contacts assigned to the specified users
notAssignee query array[string] false Exclude contacts assigned to the specified users
accountId query array[string] false Get contacts only belonging to this account
type query string false only get contacts of type
Enumerated Values
PARAMETER VALUE
type group
type individual
{
“totalCount”: 0,
“contacts”: [
{
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
}
],
“nextPage”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» totalCount number false none total contacts present with these filters. Only returned if returnTotalCount is true
» contacts [Contact] true none none
»» tags [ContactTag] true none Tags associated with this contact
»» assignee string¦null false none The assignee of the contact
»» assigner string¦null false none The person who assigned this contact
»» messagesSent number true none none
»» messagesReceived number true none none
»» chat object false none none
» nextPage string¦null true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CONTACTS_READ_ALL CONTACTS_READ_ASSIGNED )

contactsPatch

PATCH /contacts

Update contacts

{
“patch”: {
“name”: “string”,
“phoneNumber”: “string”,
“email”: “string”,
“assignee”: “string”,
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
]
}
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
messageContainsText query string false none
messageFrom query Timestamp false none
messageTo query Timestamp false none
messageFromMe query boolean false none
body body ContactsPatch false none
tags query array[string] false Get contacts who fall in either of these tags
notTags query array[string] false Get contacts who are not in any of these tags
contacts query array[string] false Get these specific contact ids
notContacts query array[string] false Do not get these specific contacts
minMessagesSent query integer false Minimum messages sent
minMessagesRecv query integer false Minimum messages received
maxMessagesSent query integer false Maximum messages sent
maxMessagesRecv query integer false Maximum messages received
q query string false Search string for contact name/phone number/email
assignee query array[string] false Get contacts assigned to the specified users
notAssignee query array[string] false Exclude contacts assigned to the specified users
accountId query array[string] false Get contacts only belonging to this account
type query string false only get contacts of type
Enumerated Values
PARAMETER VALUE
type group
type individual
{
“updated”: 0
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» updated number true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai( Scopes: CONTACTS_UPDATE )

contactsDelete

DELETE /contacts

Delete contacts

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
tags query array[string] false Get contacts who fall in either of these tags
notTags query array[string] false Get contacts who are not in any of these tags
contacts query array[string] false Get these specific contact ids
notContacts query array[string] false Do not get these specific contacts
minMessagesSent query integer false Minimum messages sent
minMessagesRecv query integer false Minimum messages received
maxMessagesSent query integer false Maximum messages sent
maxMessagesRecv query integer false Maximum messages received
q query string false Search string for contact name/phone number/email
assignee query array[string] false Get contacts assigned to the specified users
notAssignee query array[string] false Exclude contacts assigned to the specified users
accountId query array[string] false Get contacts only belonging to this account
type query string false only get contacts of type
Enumerated Values
PARAMETER VALUE
type group
type individual
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CONTACTS_DELETE )

contactsPost

POST /contacts/upsert

Create contacts

{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“contacts”: [
{
“name”: “string”,
“phoneNumber”: “string”,
“email”: “string”,
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”
}
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
body body ContactsPost false none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CONTACTS_CREATE )

contactsCheckExists

GET /contacts/exists

Check a given user exists on the IM platform

Eg. provide a phone number to check whether the user is registered on WhatsApp

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
type query string true which account type to check from
phoneNumber query string false check for the given phone number
Enumerated Values
PARAMETER VALUE
type whatsapp
{
“exists”: true,
“id”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» exists boolean true none Whether the user exists
» id string true none True ID of the user on the platform

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CONTACTS_READ_ALL )

Messages

messagesPatchPending

PATCH /messages/{status}/retry

Retry all the messages in a given status

{
“timestamp”: “2019-08-24T14:15:22Z”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
body body object false none
status path string true none
Enumerated Values
PARAMETER VALUE
status pending
status error
status cancelled
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: MESSAGES_SEND_TO_ASSIGNED )

messagesDeletePending

DELETE /messages/{status}/retry

Clears all pending/error messages

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query string false If specified, only clears messages of this account
chatId query ContactID false If specified, only clears messages of this chat
status path string true none
Enumerated Values
PARAMETER VALUE
status pending
status error
status cancelled
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: MESSAGES_DELETE )

messagesGet

GET /messages/{accountId}/{chatId}

Fetch messages of the chat

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
chatId path ContactID true none
beforeId query string false Get messages before this message ID
count query number false Number of messages to fetch
forceReload query boolean false Deletes all cached messages for this chat & fetches messages again from the original API source
status query string false fetch only “notes”, “pending” or “error” messages
fromMe query boolean false fetch only messages sent by me/or the other party
attachmentType query array[string] false Fetch only messages with attachments of this type
includeCursorMessage query boolean false should include cursor message in the response
Enumerated Values
PARAMETER VALUE
status note
status pending
status error
attachmentType image
attachmentType video
attachmentType contact
attachmentType sticker
attachmentType audio
attachmentType document
attachmentType location
{
“nextPage”: “string”,
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: []
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» nextPage string false none none
» messages [allOf] true none none

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»»» randomizeMessage boolean false none Adds random whitespace to produce a distinct message
»»»» buttonReplyId string false none the ID of the button clicked
»»»» pollReplyOptions [string] false none the option of the poll that was clicked
»»»» cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received

and

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»» deleted boolean false none True, if the message was deleted
»»» action object¦null false none none
»»»» type string true none none
»»»» parameters [string] false none none
»»» attachments [MessageAttachment] false none none
»»» buttons [MessageButton]¦null false none none
»»» products [MessageProduct]¦null false none none
»»» order object¦null false none none
»»»» orderId string true none none
»»»» jpegThumbnail string(base64) false none none
»»»» itemCount integer false none none
»»»» sellerId string true none none
»»»» token string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

messagesPost

POST /messages/{accountId}/{chatId}

Send a message

Send a message with text and/or attachments. The text property can be used as a mustache template which automatically prefills data from the contact’s details including custom fields. Some examples:

  1. {"text": "Hello there {{name}}"} will automatically pre-fill the contact’s name (if present)
  2. {"text": "Hello {{name}} your number is {{phoneNumber}}"} will automatically pre-fill the contact’s name & phone number
  3. {"text": "Hello {{name}} your pet name is {{pet name}}"} will automatically pre-fill petName if the contact has such a custom field
{
“text”: “Hello there”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true The account to use to send the message.
chatId path ContactID true The contact to send the message to.
requireOpenAccount query boolean false Only sends the message if the account is open, returns 428 otherwise
useRandomAccountIfAccountClosed query boolean false Use random account (if available) to send the message, if the account specified is closed
includeMarketingMessage query boolean false Includes the default marketing message for the account in the message
body body MessageCompose false none
Detailed descriptions

accountId: The account to use to send the message. Pass as the literal “random” to use a random account

chatId: The contact to send the message to.

To send to a phone number, supply the phone number with country code and no spaces. Eg. 601234534211[email protected]

[
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
]
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous [allOf] false none none

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»» randomizeMessage boolean false none Adds random whitespace to produce a distinct message
»»» buttonReplyId string false none the ID of the button clicked
»»» pollReplyOptions [string] false none the option of the poll that was clicked
»»» cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received

and

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»» deleted boolean false none True, if the message was deleted
»» action object¦null false none none
»»» type string true none none
»»» parameters [string] false none none
»» attachments [MessageAttachment] false none none
»» buttons [MessageButton]¦null false none none
»» products [MessageProduct]¦null false none none
»» order object¦null false none none
»»» orderId string true none none
»»» jpegThumbnail string(base64) false none none
»»» itemCount integer false none none
»»» sellerId string true none none
»»» token string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: MESSAGES_SEND_TO_ALL MESSAGES_SEND_TO_ASSIGNED )

messagesSearch

GET /messages/search

Search messages

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query array[string] false Get contacts only belonging to this account
q query string true none
chatId query ContactID false none
page query number false Page number
count query number false Number of messages to fetch
returnChats query boolean false Return the corresponding chats alongside the messages
{
“nextPage”: 0,
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: []
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
],
“chats”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“lastMessage”: “2019-08-24T14:15:22Z”,
“unread”: -1,
“spam”: true,
“archive”: true,
“readOnly”: true,
“mute”: 0,
“pin”: 0,
“isUserGenerated”: true,
“hasPendingMessage”: true,
“hasUnsolvedNote”: true,
“hasFailedMessage”: true,
“mentions”: [
“string”
],
“disappearingMessages”: 0,
“hasEntireMessageHistory”: true,
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: []
},
“attachments”: [
{}
],
“buttons”: [
{}
],
“poll”: {
“options”: [],
“maxSelections”: 0
},
“products”: [
{}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{}
]
}
],
“presences”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“contactId”: “string”,
“userId”: “string”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“type”: “available”
}
],
“cursor”: “string”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» nextPage number false none none
» messages [allOf] true none none

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»»» randomizeMessage boolean false none Adds random whitespace to produce a distinct message
»»»» buttonReplyId string false none the ID of the button clicked
»»»» pollReplyOptions [string] false none the option of the poll that was clicked
»»»» cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received

and

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»» deleted boolean false none True, if the message was deleted
»»» action object¦null false none none
»»»» type string true none none
»»»» parameters [string] false none none
»»» attachments [MessageAttachment] false none none
»»» buttons [MessageButton]¦null false none none
»»» products [MessageProduct]¦null false none none
»»» order object¦null false none none
»»»» orderId string true none none
»»»» jpegThumbnail string(base64) false none none
»»»» itemCount integer false none none
»»»» sellerId string true none none
»»»» token string true none none

continued

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» chats [Chat] false none none
»»» tags [ContactTag] true none Tags associated with this contact
»»» assignee string¦null false none The assignee of the contact
»»» assigner string¦null false none The person who assigned this contact
»»» messagesSent number true none none
»»» messagesReceived number true none none
»»» chat object false none none
»» messages [allOf] false none none
»» cursor string true none cursor to sort chats by

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

messagesPatch

PATCH /messages/{accountId}/{chatId}/{id}

Modify a message/note

Can reschedule a message, update the content of a note or mark it as resolved

{
“resolved”: true,
“text”: “string”,
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“mentions”: [
],
“timestamp”: “2019-08-24T14:15:22Z”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
body body object false none
» resolved body boolean false none
» text body string false none
» attachments body [MessageAttachment] false none
» mentions body [ContactID] false [ID for the contact/chat on the platform]
accountId path string true none
chatId path ContactID true none
id path string true none
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Message

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

messagesDelete

DELETE /messages/{accountId}/{chatId}/{id}

Delete a message

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
chatId path ContactID true none
id path string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: MESSAGES_DELETE )

messagesForward

POST /messages/{accountId}/{chatId}/{id}/forward

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
chatId path ContactID true none
id path string true none
toChatId query array[string] true none
[
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
]
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous [allOf] false none none

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»»» randomizeMessage boolean false none Adds random whitespace to produce a distinct message
»»» buttonReplyId string false none the ID of the button clicked
»»» pollReplyOptions [string] false none the option of the poll that was clicked
»»» cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received

and

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
»» deleted boolean false none True, if the message was deleted
»» action object¦null false none none
»»» type string true none none
»»» parameters [string] false none none
»» attachments [MessageAttachment] false none none
»» buttons [MessageButton]¦null false none none
»» products [MessageProduct]¦null false none none
»» order object¦null false none none
»»» orderId string true none none
»»» jpegThumbnail string(base64) false none none
»»» itemCount integer false none none
»»» sellerId string true none none
»»» token string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: MESSAGES_SEND_TO_ALL )

messagesRefresh

POST /messages/{accountId}/{chatId}/{id}/refresh

refresh a message, in case the media expired

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
chatId path ContactID true none
id path string true none
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Message

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

Groups

groupsGet

GET /groups/{accountId}/{id}

Get metadata for a group

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path string true none
forceRefresh query boolean false Fetches the group metadata again from the platform
{
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“createdAt”: “2019-08-24T14:15:22Z”,
“ownerId”: “string”,
“owner”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“description”: “string”,
“restrict”: true,
“announce”: true,
“participants”: [
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK GroupMetadata

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL CHATS_ACCESS_ASSIGNED )

groupsPatch

PATCH /groups/{accountId}/{id}

Update a group

{
“action”: “add”,
“participants”: [
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path string true none
body body GroupAction false none
{
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“createdAt”: “2019-08-24T14:15:22Z”,
“ownerId”: “string”,
“owner”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“description”: “string”,
“restrict”: true,
“announce”: true,
“participants”: [
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK GroupMetadata

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: GROUPS_UPDATE )

groupsInviteCode

GET /groups/{accountId}/{id}/invite-code

Get invite code for a group

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path string true none
{
“inviteCode”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» inviteCode string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: CHATS_ACCESS_ALL CHATS_ACCESS_ASSIGNED )

groupsPost

POST /groups/{accountId}

Create a new group

{
“name”: “string”,
“participants”: [
“string”
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
body body GroupCreate false none
{
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“createdAt”: “2019-08-24T14:15:22Z”,
“ownerId”: “string”,
“owner”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“description”: “string”,
“restrict”: true,
“announce”: true,
“participants”: [
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK GroupMetadata

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: GROUPS_CREATE )

groupsJoin

POST /groups/{accountId}/{id}/join

Join a group using invite code

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path string true none
code query string true none
{
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“createdAt”: “2019-08-24T14:15:22Z”,
“ownerId”: “string”,
“owner”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“description”: “string”,
“restrict”: true,
“announce”: true,
“participants”: [
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK GroupMetadata

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: GROUPS_UPDATE )

groupsLeave

POST /groups/{accountId}/{id}/leave

Leave a group

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path string true none
id path string true none
{}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» additionalProperties any false none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: GROUPS_UPDATE )

Tags

tagsGet

GET /tags

Get all the tags

{
“tags”: [
{
“name”: “string”,
“filters”: {},
“validation”: {
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» tags [Tag] true none none

oneOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION

xor

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TAGS_READ )

tagsDelete

DELETE /tags

Delete a tag

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
name query string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TAGS_DELETE )

tagsPost

POST /tags

Create a tag

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
tags query array[string] false Get contacts who fall in either of these tags
notTags query array[string] false Get contacts who are not in any of these tags
contacts query array[string] false Get these specific contact ids
notContacts query array[string] false Do not get these specific contacts
minMessagesSent query integer false Minimum messages sent
minMessagesRecv query integer false Minimum messages received
maxMessagesSent query integer false Maximum messages sent
maxMessagesRecv query integer false Maximum messages received
q query string false Search string for contact name/phone number/email
assignee query array[string] false Get contacts assigned to the specified users
accountId query array[string] false Get contacts only belonging to this account
type query string false only get contacts of type
name query string true none
Enumerated Values
PARAMETER VALUE
type group
type individual
{
“name”: “string”,
“filters”: {},
“validation”: {
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Tag

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TAGS_CREATE )

tagsPatch

PATCH /tags

{
“validation”: {
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
name query string true none
body body object false none
{
“name”: “string”,
“filters”: {},
“validation”: {
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Tag

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TAGS_CREATE )

Files

filesPost

POST /files

Upload a file to the media files bucket

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
mimetype query string true none
name query string true none
{
“property1”: null,
“property2”: null
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» additionalProperties any false none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

Templates

templatesSubmitForReview

POST /templates/{accountId}/submit-for-review

Submit a template for review

{
“params”: {
“name”: “string”,
“language”: “strin”,
“category”: “transactional”
},
“message”: {
“text”: “string”,
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“attachments”: [
{
“type”: “image”,
“url”: “http://example.com”,
“filename”: “string”
}
]
}
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
body body object false none
{
“id”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» id string true none ID of the template submitted for review

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TEMPLATES_CREATE )

templatesDelete

DELETE /templates/{accountId}/{templateId}

Delete a template on the platform

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
templateId path string true none
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK None

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: TEMPLATES_CREATE )

Product

orderDetailsGet

GET /{accountId}/{orderId}/order-details

Fetch details of an order (likely from an order message)

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
orderId path string true none
token query string false none
{
“price”: {
“total1000”: 5000,
“subtotal1000”: 4900,
“currency”: “HKD”
},
“products”: [
{
“product”: {
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {}
},
“businessOwnerId”: “string”
}
},
“quantity”: 0
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK OrderDetails

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

platformProductsGet

GET /products

Get the products from WA catalog.

Returns the WA catalog. Only available on WA Business apps.

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query array[string] false none
teamId query string true none
q query string false Filter if product title/description contains this
category query string false Filter based on collection/category
notCategory query string false Returns products not belonging to the specified category
id query array[string] false none
cursor query string false none
count query integer false none
returnTotalCount query boolean false none
{
“totalCount”: 0,
“products”: [
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“categories”: [
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
],
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“imageUrls”: {
“property1”: “string”,
“property2”: “string”
},
“reviewStatus”: {
“property1”: “string”,
“property2”: “string”
},
“availability”: “in-stock”,
“syncStatus”: “synced”,
“isSyncing”: true,
“error”: {
“statusCode”: 200,
“error”: “string”,
“message”: “string”,
“data”: {}
},
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“cursor”: “string”
}
],
“nextPage”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» totalCount number false none total products present with these filters. Only returned if returnTotalCount is true
» products [PlatformProduct] true none [Model for a product on an external platform (eg. WhatsApp)]
»» description string true none none
»» price integer¦null true none none
»» currency string¦null true none none
»» isHidden boolean true none none
»» id string true none none
» nextPage string false none none

This operation does not require authentication

platformProductsPost

POST /products

Upsert products to the WA catalog

{
“products”: [
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“category”: “string”,
“imageUrls”: [
“string”
]
}
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query AccountID true none
body body object false none
» products body [PlatformProductCreate] true none
{
“products”: [
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“categories”: [
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
],
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“imageUrls”: {
“property1”: “string”,
“property2”: “string”
},
“reviewStatus”: {
“property1”: “string”,
“property2”: “string”
},
“availability”: “in-stock”,
“syncStatus”: “synced”,
“isSyncing”: true,
“error”: {
“statusCode”: 200,
“error”: “string”,
“message”: “string”,
“data”: {}
},
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“cursor”: “string”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» products [PlatformProduct] true none [Model for a product on an external platform (eg. WhatsApp)]
»» description string true none none
»» price integer¦null true none none
»» currency string¦null true none none
»» isHidden boolean true none none
»» id string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_CREATE )

platformProductsPatch

PATCH /products/{accountId}

Update products by the given filter in the WA catalog

{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“category”: “string”,
“imageUrls”: [
“string”
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
body body PlatformProductUpdate false none
accountId path AccountID true none
id query array[string] false none
notId query array[string] false none
q query string false none
{
“products”: [
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“categories”: [
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
],
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“imageUrls”: {
“property1”: “string”,
“property2”: “string”
},
“reviewStatus”: {
“property1”: “string”,
“property2”: “string”
},
“availability”: “in-stock”,
“syncStatus”: “synced”,
“isSyncing”: true,
“error”: {
“statusCode”: 200,
“error”: “string”,
“message”: “string”,
“data”: {}
},
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“cursor”: “string”
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» products [PlatformProduct] true none [Model for a product on an external platform (eg. WhatsApp)]
»» description string true none none
»» price integer¦null true none none
»» currency string¦null true none none
»» isHidden boolean true none none
»» id string true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_UPDATE )

platformProductsDelete

DELETE /products/{accountId}

Delete products by the given filter from the catalog

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
id query array[string] false none
notId query array[string] false none
q query string false none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_DELETE )

platformProductsSync

POST /products/sync

Trigger sync of the specified products on twowayai with WhatsApp

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query AccountID true Account ID to sync products from/to
id query array[string] false Products to sync with WhatsApp. Leave unspecified to trigger all
syncForward query boolean false Sync products from twowayai to WhatsApp
syncBackward query boolean false Sync missing products from WhatsApp to twowayai
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_UPDATE )

Alibaba Cams

alibabaCamsMetadata

GET /alibaba-cams/metadata

Query metadata for Alibaba CAMS API

{
“appId”: “string”,
“isvTermsTemplate”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» appId string true none Meta app ID for embedded sign up
» isvTermsTemplate string true none Meta terms pdf template for embedded sign up

To perform this operation, you must be authenticated by means of one of the following methods: twowayai

alibabaCamsRegister

POST /alibaba-cams/register/{accountId}

Register an account with a token from embedded sign up

{
“token”: “string”,
“selectedPhoneNumber”: “string”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
body body object false none
» token body string true Token from embedded sign up
» selectedPhoneNumber body string false Phone number to connect to the account. No formatting, just digits with country code. If not provided, the first phone number will be used.
{
“userId”: “string”
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» userId string true none User ID for the account

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

alibabaCamsIsvTerms

POST /alibaba-cams/isv-terms/{accountId}

Submit ISV terms to Alibaba CAMS API

{
“name”: “string”,
“officeAddress”: “string”,
“emailAddress”: “string”,
“countryCode”: “st”,
“description”: “string”,
“isvTerms”: “string”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
body body AlibabaCAMSISVTerms false none
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK None

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

alibabaCamsProfileUpdate

PATCH /alibaba-cams/profile/{accountId}

Update business info for Alibaba CAMS API

{
“profilePictureUrl”: “string”,
“description”: “string”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
body body object false none
» profilePictureUrl body string false Business profile picture URL
» description body string false Business description
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK None

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: ACCOUNT_PATCH )

webhookAlibabaCamsPost

POST /webhook/{accountId}/{secret}/alibaba-cams

Receive a message from Alibaba CAMS API

[
{
“Type”: “TEXT”,
“Reason”: “string”,
“AuditStatus”: “fail”,
“TemplateCode”: “string”,
“Status”: “Sent”,
“ConversationId”: “string”,
“Message”: “string”,
“From”: “911456328897”,
“To”: “85256328897”,
“Timestamp”: 0,
“MessageId”: “string”,
“Name”: “string”,
“ConversationType”: “business_initiated”,
“ErrorDescription”: “string”,
“ErrorCode”: 0
}
]
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
secret path AccountSecret true none
body body AlibabaCAMSWebhookRequest false none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

This operation does not require authentication

Product Categories

platformProductCategoriesGet

GET /product-categories

Get the categories (collections) from WA catalog.

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId query AccountID false none
teamId query string true none
{
“categories”: [
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
]
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» categories [ProductCategory] true none none

This operation does not require authentication

platformProductCategoriesPost

POST /product-categories/{accountId}

Add a new product category

{
“name”: “string”
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
body body object false none
» name body string true none
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK ProductCategory

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_CREATE )

platformProductCategoriesPatch

PATCH /product-categories/{accountId}/{categoryId}

Update a category

Update name of the category or add/remove a product

{
“name”: “string”,
“products”: [
{
“productId”: “string”,
“type”: “add”
}
]
}
Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
categoryId path string true none
body body ProductCategoryPatchRequest false none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_UPDATE )

platformProductCategoriesDelete

DELETE /product-categories/{accountId}/{categoryId}

Delete a category

Parameters
NAME IN TYPE REQUIRED DESCRIPTION
accountId path AccountID true none
categoryId path string true none
{
“success”: true
}
Responses
STATUS MEANING DESCRIPTION SCHEMA
200 OK OK Inline
Response Schema

Status Code 200

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
» success boolean true none none

To perform this operation, you must be authenticated by means of one of the following methods: twowayai ( Scopes: PRODUCTS_DELETE )

Schemas

Error
{
“statusCode”: 200,
“error”: “string”,
“message”: “string”,
“data”: {}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
statusCode number true none none
error string true none Specific description of the error
message string true none What the error was
data object false none Some extra information about the error
AccountType
“wa”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous wa
anonymous wa-business-api
anonymous mock
anonymous tiktok
PresenceType
“available”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous available
anonymous unavailable
anonymous typing
anonymous stoppedTyping
AccountState
“open”

Describes the current state of an account. 1. open => logged in & connected to WhatsApp. Can send & receive messages now 2. connecting => establishing connection to WhatsApp. QR code is available during this state 3. close => connection to WhatsApp is closed, account is inactive at the moment

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Describes the current state of an account. 1. open => logged in & connected to WhatsApp. Can send & receive messages now 2. connecting => establishing connection to WhatsApp. QR code is available during this state 3. close => connection to WhatsApp is closed, account is inactive at the moment
Enumerated Values
PROPERTY VALUE
anonymous open
anonymous connecting
anonymous close
AccountAssignees
[
“string”
]

Assignees who can access this account.

Properties

None

AccountSettings
{
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: [
“string”
]
},
“outgoing”: {
“enabled”: true,
“assignees”: [
“string”
]
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
notifyUsers [string] false none Supply a list of user IDs to notify when a new message arrives
enableHistorySync boolean false none Should chat history be synced with the database
maxMessageSync integer false none Maximum number of messages that would be synced to the database
nativeChatActionSync boolean false none Will doing a chat action (like archive, mark unread) actually sync it back with the primary device
newChatsAssignee object false none All new chats will be auto asssigned if one of the option is enabled and select any Assignee
sendButtonsAsPoll boolean false none Should polls be sent as buttons instead of a message. This is useful for the regular WhatsApp API
autoSyncProductsToPlatform boolean false none Should products be synced to WhatsApp automatically.
ChatAssignment
{
“enabled”: true,
“assignees”: [
“string”
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
enabled boolean false none This flag will define if option should enabled/disabled
assignees [string] false none Auto assigned will work for the selected teammates
AccountsPatchRequest
{
“nickname”: “string”,
“tier”: “limited_msg_no_chat_history”,
“settings”: {
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: [
“string”
]
},
“outgoing”: {
“enabled”: true,
“assignees”: [
“string”
]
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
},
“credentials”: {
“type”: “alibaba-cams-v2”,
“initialAccessToken”: “string”,
“wabaId”: “string”,
“templateNamespace”: “string”,
“custSpaceId”: “string”,
“secret”: “string”
},
“assignees”: [
“string”
]
}

Update an account. Specifying account updates the type

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
nickname string false none none

oneOf

xor

xor

continued

ProductCategoryPatchRequest
{
“name”: “string”,
“products”: [
{
“productId”: “string”,
“type”: “add”
}
]
}

Update a product category

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string false none New name of the category
products [object] false none none
» productId string true none none
» type string true none none
Enumerated Values
PROPERTY VALUE
type add
type remove
AccountCredentialsAlibabaV2
{
“type”: “alibaba-cams-v2”,
“initialAccessToken”: “string”,
“wabaId”: “string”,
“templateNamespace”: “string”,
“custSpaceId”: “string”,
“secret”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
type string true none none
initialAccessToken string false none The initial access token used to authenticate with Alibaba CAMS service
wabaId string false none The WABA ID of the business account. This is the same as the business account’s JID
templateNamespace string false none none
custSpaceId string false none The customer space ID of the business account. Used internally
secret string true none Secret for WebHook
Enumerated Values
PROPERTY VALUE
type alibaba-cams-v2
AccountCredentialsAlibaba
{
“type”: “alibaba-cams-v2”,
“initialAccessToken”: “string”,
“wabaId”: “string”,
“templateNamespace”: “string”,
“custSpaceId”: “string”,
“secret”: “string”
}
Properties

oneOf

xor

AccountCredentialsTikTok
{
“type”: “tiktok”,
“cookies”: {
“property1”: null,
“property2”: null
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
type string true none none
cookies object true none Cookies for TikTok. This must be a serialised tough-cookie cookiejar
» additionalProperties any false none none
Enumerated Values
PROPERTY VALUE
type tiktok
ContactType
“individual”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous individual
anonymous group
anonymous broadcast
anonymous post
MessageStatus
“error”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous error
anonymous pending
anonymous note
anonymous sent
anonymous delivered
anonymous read
anonymous cancelled
Account
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“ownerId”: “5a0555af-b9a0-4c41-865e-c6e3562a72aa”,
“assignees”: [
“string”
],
“nickname”: “string”,
“credentials”: {
“property1”: null,
“property2”: null
},
“type”: “wa”,
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“lastLoginAt”: “2019-08-24T14:15:22Z”,
“lastLogoutAt”: “2019-08-24T14:15:22Z”,
“lastClosedAt”: “2019-08-24T14:15:22Z”,
“state”: “open”,
“error”: {
“message”: “string”
},
“stateInfo”: {
“property1”: null,
“property2”: null
},
“canLogin”: true,
“userId”: “string”,
“user”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“settings”: {
“notifyUsers”: [
“string”
],
“enableHistorySync”: true,
“maxMessageSync”: 100000,
“nativeChatActionSync”: true,
“newChatsAssignee”: {
“incoming”: {
“enabled”: true,
“assignees”: [
“string”
]
},
“outgoing”: {
“enabled”: true,
“assignees”: [
“string”
]
}
},
“sendButtonsAsPoll”: false,
“autoSyncProductsToPlatform”: false
}
}
Properties

None

ContactsPost
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“contacts”: [
{
“name”: “string”,
“phoneNumber”: “string”,
“email”: “string”,
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”
}
]
}
Properties

None

ContactsPatch
{
“patch”: {
“name”: “string”,
“phoneNumber”: “string”,
“email”: “string”,
“assignee”: “string”,
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
]
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
patch object true none none
» name string false none none
» phoneNumber string false none none
» email string false none none
» assignee string¦null false none none
» tags [ContactTag] false none none
ContactTag
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none none
Contact
{
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
tags [ContactTag] true none Tags associated with this contact
ChatPresence
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“contactId”: “string”,
“userId”: “string”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“type”: “available”
}
Properties

None

Chat
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“lastMessage”: “2019-08-24T14:15:22Z”,
“unread”: -1,
“spam”: true,
“archive”: true,
“readOnly”: true,
“mute”: 0,
“pin”: 0,
“isUserGenerated”: true,
“hasPendingMessage”: true,
“hasUnsolvedNote”: true,
“hasFailedMessage”: true,
“mentions”: [
“string”
],
“disappearingMessages”: 0,
“hasEntireMessageHistory”: true,
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“messages”: [
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: []
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
],
“presences”: [
{
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: [email protected],
“contactId”: “string”,
“userId”: “string”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“type”: “available”
}
],
“cursor”: “string”
}
Properties

None

MiscOptions
{
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
originalId string false none Original ID from the provider
templateId string false none WA Business template
templateParams object false none WA Business template params — do not need to populate
» additionalProperties string false none none
withTyping boolean false none Emulate typing behaviour before send
forwardCount number false none none
forwarded object false none the message being forwarded
randomizeMessage boolean false none Adds random whitespace to produce a distinct message
buttonReplyId string false none the ID of the button clicked
pollReplyOptions [string] false none the option of the poll that was clicked
cancelIfReplyReceived boolean false none If true, the message will be cancelled if a reply is received
Message
{
“chatId”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“id”: “string”,
“fromMe”: true,
“senderContactId”: [email protected],
“sender”: {
“userId”: “string”
},
“timestamp”: “2019-08-24T14:15:22Z”,
“status”: “error”,
“error”: {
“message”: “string”,
“statusCode”: 0,
“retries”: 0
},
“resolvedBy”: “string”,
“resolvedAt”: “2019-08-24T14:15:22Z”,
“hidden”: true,
“revision”: 0,
“editedAt”: “2019-08-24T14:15:22Z”,
“miscOptions”: {
“originalId”: “string”,
“templateId”: “string”,
“templateParams”: {
“property1”: “string”,
“property2”: “string”
},
“withTyping”: true,
“forwardCount”: 0,
“forwarded”: {
“chatId”: [email protected],
“id”: “string”
},
“randomizeMessage”: true,
“buttonReplyId”: “string”,
“pollReplyOptions”: [
“string”
],
“cancelIfReplyReceived”: true
},
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
Properties

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none

and

OrderDetails
{
“price”: {
“total1000”: 5000,
“subtotal1000”: 4900,
“currency”: “HKD”
},
“products”: [
{
“product”: {
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {}
},
“businessOwnerId”: “string”
}
},
“quantity”: 0
}
]
}
Properties

None

OrderPrice
{
“total1000”: 5000,
“subtotal1000”: 4900,
“currency”: “HKD”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
total1000 integer false none actual price * 1000
subtotal1000 integer false none none
currency string true none none
OrderProduct
{
“product”: {
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
},
“quantity”: 0
}
Properties

None

MessageCompose
{
“text”: “Hello there”
}
Properties

allOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none
» id string false none Specify the message Id — can be used to atomically send messages.
Two messages with the same ID will never be sent twice
» status string false none Set the status of the message, use to create notes

and

Enumerated Values
PROPERTY VALUE
status note
status pending
QuotedMessage
{
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
}
Properties

None

MessageProductDetails
{
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
currencyCode string true none 3-letter ISO currency code
price1000 integer true none the actual price * 1000
title string true none none
description string false none none
url string false none none
MessageProduct
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
id string true none none
accountId string false none none
Price
{
“amount”: 0,
“currency”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
amount integer true none none
currency string true none none
MessageLinkPreview
{
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
jpegThumbnail string(base64) false none none
title string true none none
description string true none none
url string(uri) true none none
matchedText string false none none
MessageReactionType
“stri”

Describes a reaction on a message

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Describes a reaction on a message
MessageReaction
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
Properties

None

MessageContent
{
“mentions”: [
“string”
],
“text”: “string”,
“quoted”: {
“chatId”: [email protected],
“id”: “string”,
“senderContactId”: “string”,
“text”: “string”,
“jpegThumbnail”: “string”
},
“deleted”: true,
“action”: {
“type”: “string”,
“parameters”: [
“string”
]
},
“attachments”: [
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
],
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“poll”: {
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
},
“products”: [
{
“id”: “4699246246839856”,
“accountId”: “string”,
“details”: {
“currencyCode”: “USD”,
“price1000”: 5000,
“title”: “string”,
“description”: “string”,
“url”: “string”,
“image”: {
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {},
“algorithm”: “aes-256-cbc”
}
},
“businessOwnerId”: “string”
}
}
],
“order”: {
“orderId”: “string”,
“jpegThumbnail”: “string”,
“itemCount”: 0,
“sellerId”: “string”,
“token”: “string”,
“total”: {
“amount”: 0,
“currency”: “string”
}
},
“linkPreview”: {
“jpegThumbnail”: “string”,
“title”: “string”,
“description”: “string”,
“url”: “http://example.com”,
“matchedText”: “string”
},
“reactions”: [
{
“reaction”: “stri”,
“fromId”: [email protected],
“id”: “string”,
“timestamp”: “2019-08-24T14:15:22Z”
}
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
mentions [string] false none none
text string¦null true none none
Poll
{
“options”: [
{
“text”: “string”,
“voters”: [
“string”
]
}
],
“maxSelections”: 0
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
options [PollOption] true none none
PollOption
{
“text”: “string”,
“voters”: [
“string”
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
text string true none The text of the option
voters [string] false none The IDs of the contacts that selected this option
MessageButton
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
id string true none none
text string true none none
url string false none Make a button with a link
phoneNumber string false none Make a button with a phone number
MessageAttachmentType
“image”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous image
anonymous video
anonymous contact
anonymous sticker
anonymous audio
anonymous document
anonymous location
MessageLocation
{
“latitude”: -90,
“longitude”: -180
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
latitude number true none none
longitude number true none none
MessageAttachment
{
“type”: “image”,
“mimetype”: “string”,
“url”: “http://example.com”,
“location”: {
“latitude”: -90,
“longitude”: -180
},
“jpegThumbnail”: “string”,
“seconds”: 0,
“pttAudio”: true,
“filename”: “string”,
“isGif”: true,
“decryption”: {
“keys”: {
“property1”: “string”,
“property2”: “string”
},
“algorithm”: “aes-256-cbc”
}
}
Properties

None

GroupMetadata
{
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“createdAt”: “2019-08-24T14:15:22Z”,
“ownerId”: “string”,
“owner”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“description”: “string”,
“restrict”: true,
“announce”: true,
“participants”: [
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
id string true none none
GroupParticipant
{
“contact”: {
“id”: [email protected],
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“cursor”: “string”,
“type”: “individual”,
“name”: “string”,
“platformNames”: [
“string”
],
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“phoneNumber”: “string”,
“email”: [email protected],
“img”: {
“url”: “string”,
“fullUrl”: “string”,
“fetchedAt”: “2019-08-24T14:15:22Z”
},
“tags”: [
{
“name”: “string”,
“value”: “string”,
“remove”: true
}
],
“assignee”: “string”,
“assigner”: “string”,
“messagesSent”: 0,
“messagesReceived”: 0,
“chat”: {
“lastMessage”: “2019-08-24T14:15:22Z”
}
},
“admin”: “admin”
}
Properties

None

ChatAction
{
“action”: “archive”,
“value”: true
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
action string true none none
value boolean true none none
Enumerated Values
PROPERTY VALUE
action archive
action pin
action mute
action read
action delete
GroupCreate
{
“name”: “string”,
“participants”: [
“string”
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none none
participants [string] true none none
GroupActionType
“add”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous add
anonymous remove
anonymous demote
anonymous promote
GroupAction
{
“action”: “add”,
“participants”: [
]
}
Properties

None

WASyncData
{
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
}
Properties

oneOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none
» total integer true none Total number of objects received

xor

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none
» error string true none none
WASyncStateInfo
{
“chats”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
},
“contacts”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
},
“messages”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
}
}

State of how many chats, messages, contacts are synced, and if there was an error

Properties

None

WAStateInfo
{
“qr”: “string”,
“receivedPendingNotifications”: true,
“isBusiness”: true,
“isSyncingHistory”: true,
“sync”: {
“chats”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
},
“contacts”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
},
“messages”: {
“total”: 0,
“lastRecvAt”: “2019-08-24T14:15:22Z”
}
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
qr string(base64) false none The QR to scan to log into the account
receivedPendingNotifications boolean false none Whether the client has received all pending/offline notifications
isBusiness boolean false none If the user logged in with a WA business account. Product APIs would be available now
isSyncingHistory boolean false none If syncing history right now. If such is the case, regular event processing will be queued till the sync is complete
TikTokStateInfo
{
“isSyncing”: true,
“chatsSynced”: 0,
“lastSyncCursor”: “string”,
“syncCompletedAt”: “2019-08-24T14:15:22Z”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
isSyncing boolean false none none
chatsSynced integer false none none
lastSyncCursor string false none none
AlibabaCAMSStateInfo
{
“status”: “pending-approval”,
“nameStatus”: “string”,
“isBlocked”: true,
“isvTerms”: {
“name”: “string”,
“officeAddress”: “string”,
“emailAddress”: “string”,
“countryCode”: “st”,
“description”: “string”,
“isvTerms”: “string”
},
“profileDescription”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
status string false none none
nameStatus string false none Status of the company name approval from WABA
isBlocked boolean false none Whether the business account is blocked from using Alibaba CAMS by WhatsApp
Enumerated Values
PROPERTY VALUE
status pending-approval
status approved
status rejected
AlibabaCAMSISVTerms
{
“name”: “string”,
“officeAddress”: “string”,
“emailAddress”: “string”,
“countryCode”: “st”,
“description”: “string”,
“isvTerms”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none Name of the company
officeAddress string true none Office address of the company
emailAddress string true none Email address of the company
countryCode string true none ISO Country code of the company
description string true none Description of the company
isvTerms string true none URL for uploaded pdf of ISV terms
TagFieldValidation
{
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
Properties

oneOf

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none
» type string false none none
» format string false none none
» enum [string] false none none

xor

NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous object false none none
» type string false none none
Enumerated Values
PROPERTY VALUE
type string
format email
format phone
format uri
type number
type integer
type boolean
TagValue
“string”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string¦null false none none
Tag
{
“name”: “string”,
“filters”: {},
“validation”: {
“type”: “string”,
“format”: “email”,
“enum”: [
“string”
]
}
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none Unique name of Tag
filters object¦null false none The filters for a dynamic tag
TemplateParams
{
“name”: “string”,
“language”: “strin”,
“category”: “transactional”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none none
language string true none ISO language code
TemplateCategory
“transactional”

Description of the category of the template

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Description of the category of the template
Enumerated Values
PROPERTY VALUE
anonymous transactional
anonymous marketing
anonymous otp
TemplateCreate
{
“text”: “string”,
“buttons”: [
{
“id”: “string”,
“text”: “string”,
“url”: “string”,
“phoneNumber”: “string”
}
],
“attachments”: [
{
“type”: “image”,
“url”: “http://example.com”,
“filename”: “string”
}
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
text string¦null true none none
buttons [MessageButton] false none none
AlibabaCAMSWebhookRequest
[
{
“Type”: “TEXT”,
“Reason”: “string”,
“AuditStatus”: “fail”,
“TemplateCode”: “string”,
“Status”: “Sent”,
“ConversationId”: “string”,
“Message”: “string”,
“From”: “911456328897”,
“To”: “85256328897”,
“Timestamp”: 0,
“MessageId”: “string”,
“Name”: “string”,
“ConversationType”: “business_initiated”,
“ErrorDescription”: “string”,
“ErrorCode”: 0
}
]
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous [AlibabaCAMSWebhookItem] false none none
AlibabaCAMSWebhookItem
{
“Type”: “TEXT”,
“Reason”: “string”,
“AuditStatus”: “fail”,
“TemplateCode”: “string”,
“Status”: “Sent”,
“ConversationId”: “string”,
“Message”: “string”,
“From”: “911456328897”,
“To”: “85256328897”,
“Timestamp”: 0,
“MessageId”: “string”,
“Name”: “string”,
“ConversationType”: “business_initiated”,
“ErrorDescription”: “string”,
“ErrorCode”: 0
}
Properties

oneOf

xor

AlibabaCAMSWebhookTemplateItem
{
“Type”: “template”,
“TemplateCode”: “string”,
“AuditStatus”: “fail”,
“Language”: “string”,
“WabaId”: “string”,
“Reason”: “string”
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
Type string true none none
TemplateCode string true none Code of the template
AuditStatus string true none Status of the template
Language string true none Language of the template
WabaId string false none Waba ID of the template
Reason string false none none
Enumerated Values
PROPERTY VALUE
Type template
AuditStatus fail
AuditStatus pass
AlibabaCAMSWebhookMessageItem
{
“Type”: “TEXT”,
“Reason”: “string”,
“AuditStatus”: “fail”,
“TemplateCode”: “string”,
“Status”: “Sent”,
“ConversationId”: “string”,
“Message”: “string”,
“From”: “911456328897”,
“To”: “85256328897”,
“Timestamp”: 0,
“MessageId”: “string”,
“Name”: “string”,
“ConversationType”: “business_initiated”,
“ErrorDescription”: “string”,
“ErrorCode”: 0
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
Type string true none none
Reason string false none Reason for rejection of template
AuditStatus string false none Status of the template
TemplateCode string false none Code of the template
Status string false none none
ConversationId string false none none
Message string false none Raw text if type=TEXT, otherwise JSON stringified content
From string true none none
To string true none none
Timestamp integer true none Unix timestamp in MS
MessageId string true none none
Name string false none Name of the user that sent the message
ConversationType string false none none
ErrorDescription string false none none
ErrorCode integer false none none
Enumerated Values
PROPERTY VALUE
Type TEXT
Type TEMPLATE
Type IMAGE
Type VIDEO
Type AUDIO
Type DOCUMENT
Type UNKNOWN
Type LOCATION
Type INTERACTIVE
Type REPLY
AuditStatus fail
AuditStatus pass
Status Sent
Status Delivered
Status Read
Status Failed
ConversationType business_initiated
ConversationType user_initiated
AccountTier
“limited_msg_no_chat_history”

Describes the tier of the account, and which features it’ll have

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Describes the tier of the account, and which features it’ll have
Enumerated Values
PROPERTY VALUE
anonymous limited_msg_no_chat_history
anonymous unlimited_msg_chat_history
AccountID
“acc_1234567c-123b-123a-ab_0000”

Unique identifier for an account. The account ID is constructed from the first 21 characters of the team ID, prefixed by “acc” and suffixed by 4 random hex characters. This helps uniquely identify each account as well as establish a connection between the account’s team by embedding the partial team ID in it.

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Unique identifier for an account. The account ID is constructed from the first 21 characters of the team ID, prefixed by “acc” and suffixed by 4 random hex characters. This helps uniquely identify each account as well as establish a connection between the account’s team by embedding the partial team ID in it.
AccountSecret
“stringstringstringstringstringstringstringstringstringstringstr”

Password equivalent for the account. This is used to authenticate webhooks. Only available for the following account types:

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none Password equivalent for the account. This is used to authenticate webhooks. Only available for the following account types:
– “wa-business-api”
ContactID

ID for the contact/chat on the platform

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none ID for the contact/chat on the platform
NullableTimestamp
“2019-08-24T14:15:22Z”

An ISO formatted timestamp

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string(date-time)¦null false none An ISO formatted timestamp
Timestamp
“2019-08-24T14:15:22Z”

An ISO formatted timestamp

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string(date-time) false none An ISO formatted timestamp
ProductAvailability
“in-stock”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous in-stock
ProductSyncStatus
“synced”
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
anonymous string false none none
Enumerated Values
PROPERTY VALUE
anonymous synced
anonymous pendingCreate
anonymous pendingUpdate
anonymous pendingDelete
ProductCategory
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
id string true none none
name string true none none
PlatformProduct
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“categories”: [
{
“id”: “string”,
“name”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“productCount”: 0
}
],
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“id”: “string”,
“accountId”: “acc_1234567c-123b-123a-ab_0000”,
“imageUrls”: {
“property1”: “string”,
“property2”: “string”
},
“reviewStatus”: {
“property1”: “string”,
“property2”: “string”
},
“availability”: “in-stock”,
“syncStatus”: “synced”,
“isSyncing”: true,
“error”: {
“statusCode”: 200,
“error”: “string”,
“message”: “string”,
“data”: {}
},
“createdAt”: “2019-08-24T14:15:22Z”,
“updatedAt”: “2019-08-24T14:15:22Z”,
“cursor”: “string”
}

Model for a product on an external platform (eg. WhatsApp)

Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none none
retailerId string¦null false none none
url string false none none
categories [ProductCategory] false none none
PlatformProductCreate
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“category”: “string”,
“imageUrls”: [
“string”
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string true none none
retailerId string¦null false none none
url string false none none
description string true none none
price integer true none none
currency string true none none
isHidden boolean true none none
category string¦null false none none
imageUrls [string] false none List of URLs for images of the product
PlatformProductUpdate
{
“name”: “string”,
“retailerId”: “string”,
“url”: “string”,
“description”: “string”,
“price”: 0,
“currency”: “string”,
“isHidden”: true,
“category”: “string”,
“imageUrls”: [
“string”
]
}
Properties
NAME TYPE REQUIRED RESTRICTIONS DESCRIPTION
name string false none none
retailerId string¦null false none none
url string false none none
description string false none none
price integer false none none
currency string false none none
isHidden boolean false none none
category string¦null false none none
imageUrls [string] false none List of URLs for images of the product