Download OpenAPI specification:Download
Endpoints related to Authorization
Converts the Refresh Token to Auth Token.
DEPRECATED: In previous versions, this endpoint converted the ID Token to Auth Token. If you use this endpoint now, it will convert the Refresh Token to Auth Token.
You should migrate to convertRefreshToken method now, before convertIdToken is removed in future versions.
The Refresh Token is acquired during password-less authentication flow, or by a related inbox User via API: retrieveRefreshToken and can be used to authenticate Inbox User without password.
Refresh Token will be reset each time when it is converted to Auth Token.
Note that new Auth Token is created only if it does not exist (if there were no logins in the past, for this user). If the Auth Token already exists, it is returned here, and new Auth Token is not created.
For more information about Auth Token, see Token authorization.
| id_token required | string Refresh Token acquired from retrieveRefreshToken endpoint. |
{- "id_token": "string"
}{- "token": "string"
}Converts the Refresh Token to Auth Token.
The Refresh Token is acquired during password-less authentication flow, or by a related inbox User via API: retrieveRefreshToken and can be used to authenticate Inbox User without password.
Note that new Auth Token is created only if it does not exist (if there were no logins in the past, for this user). If the Auth Token already exists, it is returned here, and new Auth Token is not created.
For more information about Auth Token, see Token authorization.
| refresh_token required | string Refresh Token acquired from retrieveRefreshToken endpoint. |
| keep_refresh_token | boolean Default: false Keep Refresh Token unchanged in the API. By default (false), Refresh Token will be reset each time when it is converted to Auth Token. |
{- "refresh_token": "string",
- "keep_refresh_token": false
}{- "token": "string"
}Creates the Auth Token for provided username and password.
Note that new Auth Token is created only if it does not exist (if there were no logins in the past, for this user). If the Auth Token already exists, it is returned here, and new Auth Token is not created.
See Token authorization,
| username required | string |
| password required | string |
{- "token": "string"
}WhatsApp Users' contact details
get.chat WhatsApp Inbox does not keep or manage your contacts. Instead, you can connect your existing contact books or databases, using Contact Providers.
When one or more Contact Providers are successfully connected to your inbox, you will be able to request related contact data from endpoints described here.
In the /contacts/ section, there are also WhatsApp Business API provided endpoints like: verifying the Contact, blocking WhatsApp number, reporting WhatsApp user to Meta.
Import an existing WhatsApp chat generated by the "Export chat" action in the WhatsApp Business app.
Use this endpoint to upload the chat and all media files. Requires some preparation work to be done in the app that served as export target for WhatApp.
Parameters you supply such as contacts, UTC offset must come from the device you exported the WhatsApp chat on.
| chat_text required | string The text chat log as given to you by WhatsApp |
Array of objects (ChatImportContact) Required if chat partner is in the device's contacts, supply chat partner's phone number with this. If you cannot tell which contact is incoming and which is outgoing, supply both. Do not supply more than two contacts. | |
| utc_offset_minutes required | integer The device may have had a non-UTC time zone; supply the number of minutes that time zone is ahead of UTC. Supply a negative number if you are in the Americas |
| device_language_code required | string Locale code of device's system language, and optionally, country |
required | Array of objects (ChatImportMediaFile) |
{- "chat_text": "10/03/2022, 11:00 - Customer 1: Message 1\n10/03/2022, 11:00 - Customer 1: Message 2 Line 1\nMessage 2 Line 2",
- "chat_participants": [
- {
- "handle": "Customer 1",
- "phone_number": "+00 000 00000000"
}
], - "utc_offset_minutes": -420,
- "device_language_code": "en-US",
- "media_files": [
- {
- "b64_content": "AA==",
- "mime_type": "image/jpg",
- "file_name": "IMG-20220310-WA0000.jpg"
}
]
}{- "contact": {
- "wa_id": "string",
- "waba_payload": {
- "profile": {
- "name": "string"
}, - "wa_id": "string"
}, - "initials": "string",
- "last_message_timestamp": 0,
- "resolved": true
}, - "new_messages": 0,
- "wa_id": "string",
- "last_message": {
- "id": "string",
- "waba_payload": null,
- "waba_statuses": {
- "sent": 0,
- "delivered": 0,
- "read": 0
}, - "contact": {
- "wa_id": "string",
- "waba_payload": {
- "profile": {
- "name": "string"
}, - "wa_id": "string"
}, - "initials": "string",
- "last_message_timestamp": 0,
- "resolved": true
}, - "from_us": true,
- "received": false,
- "sender": {
- "id": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "email": "user@example.com",
- "profile": {
- "role": "user",
- "is_available": true
}, - "groups": [
- {
- "id": 0,
- "name": "string"
}
], - "permissions": {
- "can_use_tags": true,
- "can_read_chats": "all",
- "can_write_to_chats": "all"
}, - "assigned_wa_ids": [
- "string"
]
}, - "before_time": 0,
- "since_time": 0,
- "customer_wa_id": "string",
- "tags": [ ],
- "chat_tags": [ ]
}, - "assigned_to_user": {
- "id": 0,
- "username": "string",
- "first_name": "string",
- "last_name": "string",
- "email": "user@example.com",
- "profile": {
- "role": "user",
- "is_available": true
}, - "groups": [
- {
- "id": 0,
- "name": "string"
}
], - "permissions": {
- "can_use_tags": true,
- "can_read_chats": "all",
- "can_write_to_chats": "all"
}, - "assigned_wa_ids": [
- "string"
]
}, - "assigned_group": {
- "id": 0,
- "name": "string"
}, - "tags": [
- {
- "name": "string",
- "web_inbox_color": "string",
- "tagging_id": 0,
- "id": 0,
- "extra": null
}
]
}A Tag is an object that is used when tagging Chats and Messages.
A MessageTagging is a relationship object defining which Messages are tagged with which Tags.
A ChatTagging is a relationship object defining which Chats are tagged with which Tags.
A MessageTaggingEvent is a historical entry object defining which Messages were tagged with which Tags, by which User and when.
A ChatTaggingEvent is a historical entry object defining which Chats were tagged with which Tags, by which User and when.
You can keep simple text Saved Responses that your Inbox Users can use separately from Templates
JavaScript multipart/form-data Example To Create A Media File:
const file = document.querySelector("input[type=file]").files[0];
const data = new FormData();
data.append('file_encoded', file);
fetch('/api/v1/media/', {
'method': 'POST',
'headers': {
'Authorization': 'Token YOUR_TOKEN_HERE',
},
'body': data
}).then(response => {
return response.json();
}).then(data => {
console.log(data.file);
}).catch((error) => {
console.error('Error:', error);
});
Above POST request will produce a valid binary file upload HTTP request similar to:
-----------------------------332889473834598984683101881237
Content-Disposition: form-data; name="file_encoded"; filename="img.jpg"
Content-Type: image/jpeg
<binary data here>
After API will return with specified JSON data, line console.log(data.file); will print a direct URL
to uploaded media file.
Retrieve binary raw media file
Used in media messages and for display.
| id required | string <uuid> A UUID string identifying this media file. |
| id required | string A UUID string identifying this media file. |
| mime_type_subtype | string
|
| mime_type_type | string
|
These API endpoints allow you to manage Webhooks.
To learn more about Webhooks' payload and when to expect them see Integration > WABA Webhook extension chapter
This API endpoint allows you to list logs of various events such as chats being assigned or resolved
Manages your mobile device's Firebase Cloud Messaging token. This allows you to receive push notifications upon receiving messages, even if the app is in the background.
Note that every Token submitted using this API is associated to the authenticated User. You can only register, list, update and deregister Tokens owned by your User (currently authenticated User).
In order to get your Firebase token from Google in the first place, you need to send a request to Firebase using one of its client libraries while holding the public Firebase certificate of this service.
The inbox then also needs this token. The workflow is similar to other REST operations with one big exception, that you need to account for. After registration, the token has to be re-registered on a regular basis; once per month is recommended by Firebase itself. Re-registration is done using the same API endpoint that allows initial registration.
In case your app user logs out of the Inbox, please delete the FCM token that was in use by that device using the DELETE endpoint.