get.chat WhatsApp Integration API

Download OpenAPI specification:Download

Version Version date
0.67.15 2024.01.11

About Integration API

WhatsApp Integration API allows you to use your WhatsApp Business Account with many messaging solution concurrently. It lets you integrate your favorite chat solution with any chatbot or CRM you prefer.

Beta program

Your deployment documentation might differ if you participate in beta program for selected features.

If not, the API is the same.

For your instance-specific docs, go to https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/. To get YOUR_STACK_NAME, go to your Stacks and use the value after the Stack: text visible.

Introduction

A missing puzzle piece

APIs
Our API and Inbox together make a missing puzzle piece you always needed.

WhatsApp Integration API and Web Inbox act as an extension layer for WhatsApp Business API (WABA). Here is a list of benefits of using both of the solutions:

Feature Web Inbox WhatsApp Integration API WABA
Connect unlimited simultaneous apps to your WA Business account N/A
Graphical user interface for you and your employees N/A
Multi-user access to sending and receiving of your WA Business account messages
Search within the last 1.5 mio messages
Deeplinking into message threads
Synchronize each app (or system) separately
  • Push messages from WABA to each app (or system) separately using separate webhook or websockets
  • Push messages from each app (or system) to WABA, preserving the information which app or system or real user (Inbox) has sent the message
N/A

FAQ

How is WhatsApp Integration API different from other integration platforms?

It is an integration platform specially designed for WhatsApp Business API, focusing only on functions around WhatsApp and typical solutions integrating into WhatsApp. Every number has its own database and the Integration API syncs incoming messages actively into all integrated solutions.

Where are messages stored?

Messages are stored in an own database per number in the Integration API until a threshold of 1.5 million messages is reached. So different accounts do not share the same database.

Which limitations does the system have?

Message volume is limited on 1.5 million messages. System does not have it’s own routing system or rule engine.

Is a search index part of the Integration API or is an external solution needed?

Search for up to 1 Million messages is supported, but when search function for more messages is needed, then an external search index is needed to be used.

How can routing rules be applied to the system

Routing rules are manageable either through CRM or ticketing solution or through any external rule engine.

Which functions apply to the Integration API?

The Web Inbox is just a frontend of the Integration API. There are not (yet) any additional functions on the frontend level.

Accessing the API

Base URL

Your inbox is reachable at https://{YOUR_STACK_NAME}.inbox.platform.get.chat/ and all API endpoints are reachable at https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/.

For example, sending a POST to /api/v1/auth/token/ means sending a POST to https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/auth/token/.

Different base URL for each inbox is connected to providing separate servers and databases for your inbox, so that all your data is well isolated from other inboxes.

Authorization

Currently, there are three ways of authorization available:

Token authorization is designed for accessing the API from your own services / apps / chatbots.

Session authorization mechanism is what is used by default when logging into the admin panel.

Provider authorization can be used when you need to log in using WABA Stack provider credentials (360dialog).

See below sections for more details.

Token

Token authorization should be preferred.

Each of your service or app or chatbot that will reach the API needs to have its own User account and authorization token bound to the account.

This type of authorization is done with Authorization: Token <token> header, where <token> value needs to be obtained first.

To obtain a token, send POST to /api/v1/auth/token/ with username and password fields either as JSON fields or POST data.

Example:

curl -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -X POST \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/auth/token/ \
    --data "{\"username\": \"peter\", \"password\": \"secret\"}"

When valid username and password are provided, API will send you a (new or existing available) token in JSON body field token, for example:

{"token": "8aeb44f5a318542d32bb13019d68198467ee21f0"}

Make sure all authorization requests are done via HTTPS connection, otherwise username and password are not encrypted.

Session

Each accessible page will provide to you with CSRF token, for example:

HTTP/1.1 200 OK
Set-Cookie:  csrftoken=TezohQtkhqw03yaiSOyvOVFymCeIm3VfdYKLkaG33DWz0lgR7nVroQREeV3Hj3Rw; expires=Thu, 20 Jan 2022 11:19:51 GMT; Max-Age=31449600; Path=/; SameSite=Lax

API endpoints are not accessible until you authorize (either by token or session), but several pages are accessible without authorizing. For example, you can send a GET request to /api/v1/ and obtain token this way.

This unique token identifies you, so that's why it should be saved as cookie and then used later on in further requests.

After logging in via official form /login/, you will obtain sessionid too, for example:

HTTP/1.1 302 Found
Set-Cookie: csrftoken=mc73th9HxjMpy5UuCC3981LZeE0jt8sH4i8Md8BZoy9Agygv9M7WimALSVXCV1hL; expires=Thu, 20 Jan 2022 14:48:54 GMT; Max-Age=31449600; Path=/; SameSite=Lax
Set-Cookie: sessionid=mdsxd9cczt27tp2d806hfi245emmxuvk; expires=Thu, 04 Feb 2021 14:48:54 GMT; HttpOnly; Max-Age=1209600; Path=/; SameSite=Lax

These two cookies identify you as a logged in user. Thanks to them no 'Authorization' header is needed, but Cookie header should be used instead with above cookies.

Provider

Provider authorization can be used when you need to log in using WABA Stack provider credentials (360dialog).

To authenticate using Provider method, provide 360dialog API Key header when calling the API.

For example:

curl -H "D360-Api-Key: xEZOvMBDS6zEZtbR2xCJkP5R75szhCUIvMH" \
     -H "Accept: application/json" \
     -X GET \
     https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/users/current/

Integration API will then reach to 360dialog and will ask 360dialog systems if the key is valid.

If the provided D360-Api-Key is valid, you will be authenticated as Integration API admin User. If there are more than one admin group members, you will be authenticated as the admin User that was registered when the inbox was created for the first time. If said User is no longer active or was removed, this method will authenticate you as an admin User of following conditions:

  • this User's account is still active (when you decide a particular User should no longer have the access, User accounts are marked as inactive instead of removed)
  • this User's account creation date is the oldest

If provided API Key is invalid, this method will silently fail and then Token and Session auth methods will be checked. That means if invalid D360-Api-Key is the only authorization data provided, you will see a following response:

HTTP/1.1 403 Forbidden
{"detail":"Authentication credentials were not provided."}

Note that above example calls Retrieve Current User endpoint and will show you the exact account that was authenticated during your request. For example:

curl -H "D360-Api-Key: xEZOvMBDS6zEZtbR2xCJkP5R75szhCUIvMH" \
     -H "Accept: application/json" \
     -X GET \
     https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/users/current/ \
    | python -m json.tool

{
    "url": "https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/users/2/",
    "id": 2,
    "username": "peter",
    "first_name": "Peter",
    "last_name": "Rabbit",
    "email": "peter@example.com",
    "profile": {
        "role": "admin"
    },
    "groups": [
        {
            "id": 3,
            "name": "Admin"
        }
    ],
    "permissions": {
        "can_use_tags": true,
        "can_read_chats": "all",
        "can_write_to_chats": "all"
    }
}

Making requests

Each endpoint described later in the docs has to be accessed with HTTP Request with SSL and one of available authorization methods: Token, Session or Provider.

When making POST requests, JSON data specified in the docs has to be sent as POST data payload.

Base URL shown in this documentation is https://{ YOUR_STACK_NAME }.inbox.platform.get.chat/

To get YOUR_STACK_NAME, go to your Stacks and use the value after the Stack: text visible.

Example for GET request with curl:

curl \
    -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -X GET \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/chats/ \
    -H "Accept: application/json"

Example for POST request with curl:

curl -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -X POST \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/messages/ \
    --data "{\"wa_id\": \"48123456789\", \"text\": {\"body\": \"Hello!\"}}"

Note that our API supports passing request payload parameters as either POST data application/json, application/x-www-form-urlencoded or multipart/form-data.

Getting started

You should start with /chats/ endpoint:

curl -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -X GET \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/chats/ \
    | python -m json.tool

[
    {
        "wa_id": "48500500500",
        "new_messages": 11
    },
    {
        "wa_id": "4912312312312",
        "new_messages": 0
    },
    {
        "wa_id": "90123123123",
        "new_messages": 22
    }
]

Read more about /chats/ endpoint here.

You can use python -m json.tool to make the output more readable, but it is not necessary.

Above response makes it clear how many new messages you have and where to find them.

You can read each contact messages like this:


curl -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -X GET \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/messages/?wa_id=48123123123&limit=1 \
    | python -m json.tool

{
    "count": 276,
    "next": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/messages/?wa_id=48123123123/&limit=1&offset=1",
    "previous": null,
    "results": [
        {
            "waba_payload": {
                "from": "48123123123",
                "id": "ABGGSFEBeRJ_AhD8o8zP9ulNeUPgdKvfzvgh",
                "timestamp": "1612544982",
                "type": "video",
                "video": {
                    "id": "20854d67-189e-4e78-a8ac-123sdf234ad",
                    "mime_type": "video/mp4",
                    "sha256": "da7f4ab0b60e7df1d1e8b0537bcdec3a86d605e79fa28333c4c1dc50561d86ac",
                    "link": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/media/20854d67-189e-4e78-a8ac-123sdf234ad/"
                }
            },
            "customer_wa_id": "48123123123",
            "from_us": false,
            "received": false,
            "sender": null
        }
    ]
}

Read more about /messages/ endpoint here. The main payload of the message is waba_payload JSON field, which copies data returned by WhatsApp Business API. In waba_payload you will always have information about type of the message, id, from and timestamp.

In above example, a limit=1 query parameter was used, so that only one message is returned, for readability of this tutorial. In reality, you will be reading messages in batches, for example 20 messages:

curl -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -X GET \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/messages/?wa_id=48123123123&limit=20

This endpoint returns to you most recent messages, ordered from newest to oldest.

Then, if you want to read next 20 (older) messages, you need to use before_time query parameter, indicating the POSIX timestamp of the last message you had before (in previous batch). The API will then return 20 messages before given timestamp:

curl -H "Authorization: Token 8aeb44f5a318542d32bb13019d68198467ee21f0" \
    -X GET \
    https://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/messages/?wa_id=48123123123&limit=20&before_time=1612544982

The default pagination method is implemented as offset and limit params in most of the endpoints. But for this endpoint, before_time is provided, to be able to paginate elements correctly, even when new messages arrive at the time of pagination.

Whenever you think you no longer need these messages being indicated as new (in our first /chats/ call) you can mark these messages as received. Marking messages as received by you is needed to generate proper lists of unread messages.

You can mark messages as received in three ways:

  1. Use /mark_as_received/ endpoint.
  2. Use mark_as_received parameter of /messages/ endpoint.
  3. Use WABA Webhook

The choice of method depends on your use case. For example, first method is useful when you prefetch these messages and then you make sure whether user received them or not (for example a web based app or mobile app). Second method, on the other hand, is handy when you are just passing messages from our inbox to some other system.

It is required to use one of above methods if you want to keep track of what was already received by your users, bots or any integrated systems. You want to keep track of it basically always, for example:

  • when you implement any kind of indication of new/unread messages (on the frontend or in any other way)
  • when you simply forward messages to your system in batches and would like to receive only fresh messages on each iteration

WABA Webhooks take care of it for you. It works the "old way" you should be familiar with if you used WhatsApp Business API before.

Integration

WABA Webhook

WhatsApp Integration API provides a (de)multiplexing solution of original WhatsApp Business API (WABA) webhook. WABA itself allows you to integrate only one webhook. With our API you can set up multiple per-user webhooks.

Webhooks
How Webhooks are created and used

How to read above picture: Integration API provides Webhooks as a resource. Then you (manually), or your app (automatically) can create and delete Webhooks. In above example, your chatbot solution can create a Webhook, using proper username+password credentials. Then, Webhook calls your chatbot solution endpoint, triggered by specific events like incoming messages or status updates.

Multiple Webhooks
How Multiple Webhooks are called

Each WABA Webhook is configured per API user - Your Chatbot, Your CRM System etc.

One user can have multiple WABA Webhook configs, for example:

[{
    "id": 1,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": true,
    "on_outgoing_message": false,
    "on_assigned": false
}, {
    "id": 2,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": true,
    "on_assigned": false,
    "headers": {}
}, {
    "id": 3,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": false,
    "on_assigned": true,
    "headers": {"Authorization": "Token 8aeb44f5a318542d32bb13019d68198467ee21f0"}
}]

or you can have following webhooks:

[{
    "id": 1,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": true,
    "on_outgoing_message": true,
    "on_assigned": false
}, {
    "id": 2,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": false,
    "on_assigned": true,
    "headers": {"Authorization": "Token 8aeb44f5a318542d32bb13019d68198467ee21f0"}
}]

When WABA webhook calls our API, all created Webhooks are triggered and each of them is calling your configured endpoints.

You are not required to set up one webhook per one app (or system). If you want, you can configure only one webhook for all your apps, and then distribute messages and notifications to your apps yourself. One webhook per app however is the recommended method.

See following endpoints to learn more on how to manage your WABA Webhooks:

Correctly configured WABA Webhook will propagate webhooks incoming from WABA to each of your endpoints. Propagated webhook call will be exactly the same POST call as original WhatsApp Business API webhook:

POST /

{
  "contacts": [ {
    "profile": {
        "name": "sender-profile-name"
    },
    "wa_id": "wa-id-of-contact"
  } ],
  "messages": [ {
    "context": {
         "from": "sender-wa-id-of-context-message",
         "id": "message-id-of-context-message",
         "mentions": [ "wa-id1", "wa-id2" ],
         "forwarded": true | false,
         "frequently_forwarded": true | false
    },
    "from": "sender-wa-id",
    "id": "message-id",
    "timestamp": "message-timestamp",
    "type": "audio | document | image | location | system | text | video | voice",

    # If there are any errors the errors field (array) will be present.
    # The errors field can be returned as part of any callback event.
    "errors": [ { ... } ],

    "audio": {
        "file": "absolute-filepath-on-coreapp",
        "id": "media-id",
        "link": "link-to-audio-file",
        "mime_type": "media-mime-type",
         "sha256": "checksum"
    }

    "document": {
        "file": "absolute-filepath-on-coreapp",
        "id": "media-id",
        "link": "link-to-document-file",
        "mime_type": "media-mime-type",
        "sha256": "checksum",
        "caption": "document-caption"
    }

    "image": {
        "file": "absolute-filepath-on-coreapp",
        "id": "media-id",
        "link": "link-to-image-file",
        "mime_type": "media-mime-type",
        "sha256": "checksum",
        "caption": "image-caption"
    }

    "location": {
        "address": "1 Hacker Way, Menlo Park, CA, 94025",
        "latitude": latitude,
        "longitude": longitude,
        "name": "location-name"
    }

    "system": {
        "body": "system-message-content"
    }

    "text": {
        "body": "text-message-content"
    }

    "video": {
        "file": "absolute-filepath-on-coreapp",
        "id": "media-id",
        "link": "link-to-video-file",
        "mime_type": "media-mime-type",
        "sha256": "checksum"
    }

    "voice": {
        "file": "absolute-filepath-on-coreapp",
        "id": "media-id",
        "link": "link-to-audio-file",
        "mime_type": "media-mime-type",
        "sha256": "checksum"
    }
  ]
}

WABA Webhook extension

Official WhatsApp Business API Webhook definition, provides three fields: "contacts", "messages" and "statuses" notifications. Our Integration API adds several new fields to this set, which has following benefits:

  • It keeps backward compatibility, leaving original fields unchanged.
  • Provides more flexibility, allowing you to receive all available events at yor single endpoint, or to distribute each event to a separate endpoint, depending on your use case and needs.

Additional fields to original events:

  • "statuses" - a new field is added: "getchat_id" that will help you link messages and statuses using get.chat's internal message ID. This ID is returned by post Create Message endpoint so that you can easily link this message to a status, even if the message was only added to the queue and hasn't yet been sent to WhatsApp.

    Example:

    {
        "statuses": [
          {
            "id": "gBEGkFO33SUyAgm0lj123TmE5lc",
            "getchat_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
            "recipient_id": "48123123123",
            "status": "read",
            "timestamp": "1634833334",
            "type": "message"
          }
        ]
    }
    

Below is a description of all new fields and when to expect them:

  • "incoming_messages" will show up always when original/official WhatsApp Business API Webhook is called. Any API User that is configured to receive all incoming Messages, will receive a webhook containing both "messages" field (with exactly the same list of objects that are sent by WABA Stack) and our new "incoming_messages" field.

  • "outgoing_messages" will show up whenever one of the Inbox Users writes a new Message and WABA Webhook recipient is configured to receive all outgoing Messages. This field contains only messages sent from get.chat Inbox by your inbox Users.

  • "assigned_messages" will show up whenever new Messages arrive to the Chat that is currently assigned to the User receiving this Webhook and also when one or more Chats are assigned to the User just now. It is important to note that Messages are never assigned to Users. Only Chats are assigned to inbox Users. This field name might then look misleading, however the true meaning of this field is not "assigned messages" but "new Messages from an assigned Chat". Provided name is just shorter.

  • "chat_assignment" will show up for all webhook receivers whenever someone changes an assignment of a Chat either via API or Web App.

  • "chat_tagging" will show up for all webhook receivers each time any Message is tagged or tagging is removed. This event is also send to Rule Engine. Learn more about Rule Engine.

  • "message_tagging" will show up for all webhook receivers each time any Chat is tagged or tagging is removed. Keep in mind that when a Message is tagged with a Tag, then a corresponding Chat is tagged with the same Tag immediately! This event is also send to Rule Engine. Learn more about Rule Engine.

  • "tagged_messages" deprecated, use "message_tagging"

  • "tagged_chats" deprecated, use "chat_tagging"

WhatsApp Business API does not call your webhook with outgoing messages, but we do!

Each field has its own schema defined below:

  • "incoming_messages" | "outgoing_messages" | "assigned_messages" - a JSON Array of Object elements of exactly the same schema as in get List Messages API endpoint (results Array entries).

  • "chat_tagging" - a JSON Object of exactly the same schema as in get List Chat Tagging Events API endpoint (results Array entries).

  • "message_tagging" - a JSON Object of exactly the same schema as in get List Message Tagging Events API endpoint (results Array entries).

  • "chat_assignment" - a JSON Object of exactly the same schema as in get List Chat Assignment Events API endpoint (results Array entries).

  • "tagged_messages" deprecated, use "message_tagging"

  • "tagged_chats" deprecated , use "chat_tagging"

Example payload of a Webhook call containing either "outgoing_messages" or "assigned_messages" event:

POST /

{
  "outgoing_messages": [
        {
            "id": "8e04bff7-9a07-486b-90a4-09c2e5d85e69",
            "waba_payload": {
                "preview_url": false,
                "recipient_type": "individual",
                "to": "48123123123",
                "type": "image",
                "image": {
                    "link": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/media/e4b60f1d-1847-4233-8a88-58e123123123"
                },
                "id": "gBGGSFEBeRJ_AglpKKJ1s123123",
                "timestamp": 1612372697
            },
            "waba_statuses": {
                "sent": null,
                "delivered": null,
                "read": null
            },
            "contact": {
                "wa_id": "48123123123",
                "waba_payload": {
                    "profile": {
                        "name": "Konrad Tester"
                    },
                    "wa_id": "48123123123"
                },
                "initials": "KT",
                "last_message_timestamp": 1613398401
            },
            "from_us": true,
            "received": true,
            "sender": {
                "url": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/users/1/",
                "id": 1,
                "username": "konrad",
                "first_name": "Konrad",
                "last_name": "Tester",
                "email": "konrad@example.com",
                "profile": {
                    "role": "admin"
                }
            },
            "context": null,
            "customer_wa_id": "48123123123"
        },
        {
            "id": "e6a310b5-b184-4381-bb83-60ee2d0cff13",
            "waba_payload": {
                "preview_url": false,
                "recipient_type": "individual",
                "to": "48123123123",
                "type": "image",
                "image": {
                    "link": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/media/bc4bd93e-a522-4bce-aac8-cc1123123123"
                },
                "id": "gBGGSFEBeRJ_AgnJK-don123123",
                "timestamp": 1612372571
            },
            "waba_statuses": {
                "sent": null,
                "delivered": null,
                "read": null
            },
            "contact": {
                "wa_id": "48123123123",
                "waba_payload": {
                    "profile": {
                        "name": "Konrad Tester"
                    },
                    "wa_id": "48123123123"
                },
                "initials": "KT",
                "last_message_timestamp": 1613398401
            },
            "from_us": true,
            "received": true,
            "sender": {
                "url": "http://{YOUR_STACK_NAME}.inbox.platform.get.chat/api/v1/users/1/",
                "id": 1,
                "username": "konrad",
                "first_name": "Konrad",
                "last_name": "Tester",
                "email": "konrad@example.com",
                "profile": {
                    "role": "admin"
                }
            },
            "context": null,
            "customer_wa_id": "48123123123"
        }
    ]
}

Example payload of a Webhook call containing "message_tagging" event:

(See get List Message Tagging Events API endpoint results Array entries to learn more)

POST /

{
    "results":
    [
        {
            "timestamp": 0,
            "action": "added",
            "tag":
            {
                "id": 0,
                "name": "string",
                "web_inbox_color": "string"
            },
            "message": "string",
            "extra": {},
            "done_by":
            {
                "url": "string",
                "id": 0,
                "username": "string",
                "first_name": "string",
                "last_name": "string",
                "email": "user@example.com",
                "profile":
                {
                    "role": "user"
                },
                "groups":
                [
                    {
                        "id": 0,
                        "name": "string"
                    }
                ],
                "permissions":
                {
                    "can_use_tags": true,
                    "can_read_chats": "all",
                    "can_write_to_chats": "all"
                }
            }
        }
    ]
}

Example payload of a Webhook call containing "chat_tagging" event.

(get List Chat Tagging Events API endpoint (results Array entries))

POST /

{
    "chat_tagging":
    [
        {
            "timestamp": 0,
            "action": "added",
            "tag":
            {
                "id": 0,
                "name": "string",
                "web_inbox_color": "string"
            },
            "chat": "string",
            "extra": {},
            "done_by":
            {
                "url": "string",
                "id": 0,
                "username": "string",
                "first_name": "string",
                "last_name": "string",
                "email": "user@example.com",
                "profile":
                {
                    "role": "user"
                },
                "groups":
                [
                    {}
                ],
                "permissions":
                {
                    "can_use_tags": true,
                    "can_read_chats": "all",
                    "can_write_to_chats": "all"
                }
            }
        }
    ]
}

Messages marked as received

Our API provides a way of determining whether a specific API User or Inbox User has received the message. This is used in /chats/ endpoint to provide a way of quickly determining which chats have still new messages. This feature is especially useful for frontends like our Web Inbox.

Message "received" status is considered for every API User separately.

Messages delivered via WABA Webhook successfully are automatically marked as received!

Integrating a bot

In order to integrate a bot, you'll need to understand the Rule Engine concept and configure your bot correctly. A Rule Engine is a component that determines when messages should be assigned to real users or bot users. By configuring a Rule Engine, you can direct fresh new messages to a bot first, or you can choose to direct messages only when they are tagged by other users with tags specified by you.

Assuming you already know how Rule Engine works, below is a short explanation on how to connect a bot to your inbox.

To add your bot to the system you need to:

  • Create a new User for your bot using either User API or Admin Panel (Users section). If you choose the API, you need to create a new User with profile.role equal to "app". If via Admin Panel, you need to add your new User to "App integration" group. This will provide some security restrictions for your automated (non-human) User.
  • Set up a Webhook for your bot, so that your bot receives a webhook call whenever any of selected events happen. Again, you can create a Webhook via API or Admin Panel (WABA Webhooks section). Possible Webhook events are: on incoming message, on outgoing message, on assigned. Read more about when to expect these events and what is the data schema in WABA Webhook extension section.

If you just need a bot that is passively consuming messages and does not participate in any conversation, you can do allright with no Rule Engine configuration being set. In such case, you can create a Webhook that is executed with "on incoming message" event. Then, your bot is not assigned to the related Chat and can passively archive or monitor incoming messages, transparently to all other users of the inbox.

However, if you need to assign a Chat conversation to a bot user, you will need to configure the Rule Engine.

The Rule Engine configuration controls the main flow (or pipelining) of your Messages. If you're not developing your own custom Rule Engine, you should go to Rule Engine section of Admin Panel and configure the Default Rule Engine to decide when your bot should be assigned to Chats automatically.

In Default Rule Engine config you have two options:

  • To automatically assign your bot to any new Chat (or any new Message coming to an unassigned Chat) you need to create a new Rule and leave the "Tagged with" field blank, then pick your bot User in the field "Assign to user".
  • To automatically assign your bot to a Chat when a Chat is tagged by a specific Tag, you need to create a new Rule like above, providing a specific Tag in "Tagged with" field.

Chats and Messages can be tagged by any API user (and thus bot) with Tags API.

Monitoring or archiving bot example

As explained above, a monitoring/archiving bot does not require too much config. For this example, we will create a new User using Admin Panel (Users section) and add this User to "App integration" Group. Then we create a WABA Webhook for this User with one of these two events selected: "on incoming message", "on outgoing message", depending on what we want to monitor/archive.

Spam filtering bot example

To create a spam filtering bot that will receive Messages as a very first User, we will configure our Message pipeline using Default Rule Engine.

First, we will create a new User (Users section > Add user) and add this User to "App integration" Group. Then we will create a new Rule (Rule Engine > Add new Rule > WHEN: WhatsApp User wrote a message to an untagged Chat) and choose this User in "Assign to user" field. Thanks to the "WHEN" option we selected, we create a Rule that is executed whenever any fresh new message comes to the Inbox from WhatsApp directly. This Rule makes sure our spam filtering bot is the only recipient of given messages (except Users with read permissions equal to "All Chats").

Above Rule cannot work alone without a Webhook. It can work if you create a Rule for a human User that is logging in to a Web App frontend, but that is not the case here.

So we will create a new Webhook for this User again using Admin Panel, section: WABA Webhooks > Add WABA Webhook. When creating, we need to check the "On assigned" field and only this field.

Then, we will need to create a new Tag that will be used by our bot. Our bot will mark Chats with this Tag as soon as human interaction is needed. Let's create a Tag using Admin Panel section "Tags" and name it "Agent needed". After you create the Tag, you can find the Tag ID in the Tag list (Click on the "Tags" section). Save this ID for later, because our bot will be using this number.

We now need to create a new Rule and set it up so that our bot could pass the Message flow to human inbox users. Let's create a new Rule (Rule Engine section) for our new Tag, so let's pick our "Agent needed" Tag in the "Tagged with" field and let's pick "Regular user" Group in the "Assign to group" field.

After saving this Rule, our Rule Engine will know that as soon as a Chat is tagged with "Agent needed" Tag, Users in Regular user Group need to be notified and will have access to related Messages.

As a result, we will have the following flow:

  1. A new Message is sent from WhatsApp to your Inbox

  2. get.chat Integration API calls your Rule Engine Webhook with following payload:

    (Irrelevant data hidden for readability)

    {
      "contacts": "...",
      "messages": [ {
        "from": "48123123123",
        "id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
        "...": "..."
      } ]
    }
    
  3. Rule Engine replies with following payload:

    (Assuming the bot User id is 42, for example)

    {
      "assignment": [{
        "message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
        "user": 42
      }]
    }
    
  4. get.chat Integration API handles the assignment change and notifies corresponding bot User (user id = 42)

  5. Bot User then receives its own Webhook with following payload:

    (Irrelevant data hidden for readability)

    {
        "assigned_messages": [ {
            "waba_payload": {
                "from": "48123123123",
                "id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
                "type": "text",
                "text": {
                    "body": "Hello"
                },
                "...": "..."
            },
            "...": "..."
        } ]
    }
    
  6. Bot User is then able to reply to the WhatsApp User using Integration API endpoint post Create Message:

    (Irrelevant data hidden for readability)

    {
      "wa_id": "48123123123",
      "type": "text",
      "text": {
        "body": "Hello! How may I help you?"
      }
    }
    

    IMPORTANT: It is important to use the same wa_id as in received message (assigned_messages.0.waba_payload.from in the 5. step). By default, bot will be able to reply to assigned Chat only.

    NOTE: A bot might use a template message at this point, showing possible action button answers to the user.

  7. The conversation continues as long as bot can handle the message:

    • Incoming Messages sent from WhatsApp to the bot, arrive as Webhooks with "messages" payload
    • Each response from the bot to the WhatsApp User have to be sent as API post Create Message calls
  8. Eventually, bot cannot handle the conversation no more or human interaction is requested by WhatsApp User explicitly. Then, bot User calls the Integration API to tag the message accordingly using post Create Tagging call.

    When a Message is tagged, then the related Chat is tagged as well and this is what executes the Rule Engine Rule. Still, we recommend to tag Messages instead of Chats, to preserve the history of when the flow has changed. You can choose however to tag the Chat directly instead and this flow will work exactly the same.

  9. Because a new Tagging was made, Rule Engine is called again and determines that a Chat tagged with "Agent needed" tag means "Regular user" Group needs to be assigned and notified.

  10. Integration API assigns then this Message Chat to "Regular user" Group and notifies each User in the Group letting them to decide who will be assigned or letting them to continue without any assignment.

    Depending on user group membership, Users may assign themselves to the Chat:

    • by default, they can assign themselves to the Chat they have read access to
    • if in admin group, they can assign themselves and other Users with no restrictions

    Users can also reply to the Chat:

    • if their Group is assigned to this Chat
    • if the User is assigned directly to the Chat

    By default, a User is not allowed to write to Chats they're not directly assigned to.

    If in admin group, the User can write to any existing Chat.

Websockets

A Websockets Server is available at wss://websockets-{YOUR_STACK_NAME}.inbox.platform.get.chat/

Note the wss:// means SSL is used and ws:// prefix will not work.

Websockets protocol

get.chat WhatsApp Integration API Websockets Server communicates with events serialized as JSON data strings.

Websockets protocol allows bi-directional messages, so a message can be either sent by Client (to Server) or by Server (to Client). Our own protocol distinguishes different types of messages, denoted by type field of each message payload. An exception here is a "Token authentication" message. This type of message is always expected as a first message and it's the only type of message allowed to be sent by Client, so the type field is omitted for simplicity.

Check below list of valid message types.

Message type Token authentication
Sent by Client
Description Send this message as your first message to authenticate yourself so that Websockets Server will know you are authorized to receive messages and will register you for future notifications.
Field Description
token String value of your token
Example payload
{"token": "8aeb44f5a318542d32bb13019d68198467ee21f0"}
Message type Server response
Sent by Server
Description Server can "reply" to Client messages with this type of message right after any kind of Client message. As for now, it can happen only after Token authentication type of message, because that's the only type of message that can be sent by Client.
Field Description
type Equal to "response"
status Possible values: "bad_request" - Meaning Client has sent a request of wrong format or value in its previous request.
message Human-readable description of the Server response - for example why Token authentication payload JSON is formatted incorrectly.
Example payload
{
"type": "response",
"status": "bad_request",
"message": "Expecting value: line 1 column 1 (char 0)"
}
Message type Token authentication result
Sent by Server
Description Token authentication result sent after Token authentication Client message
Field Description
type Equal to "token"
status Possible values: "success", "failed"
message Human-readable description of the status
Example payload
{
"type": "token",
"status": "success",
"message": "Welcome, peter!"
}
Example payload
{
"type": "token",
"status": "failed",
"message": "Token matching query does not exist."
}
Message type WABA Webhook
Sent by Server
Description By this event, your Client will receive WABA Webhooks in websockets message payload. For more details on what is placed inside "waba_payload": { object } see WABA Webhook section.
Field Description
type Equal to "waba_webhook"
waba_payload Object of exactly the same format and data as in WABA Webhook payload.
Example payload
{
"type": "waba_webhook",
"waba_payload": { object }
}

Main protocol algorithm looks like this:

  1. Client sends Token authentication message to the Server
    • Eventually, Server response message will be sent to the Client, if previous message payload was wrong format.
  2. Server sends Token authentication result message to the Client
  3. If Token authentication result status is success, Client can now expect and receive future events of WABA Webhook type

WABA Webhook inside websockets

In contrast to HTTP-transferred WABA Webhooks (normal webhooks), webhooks successfully transferred via Websockets are not marking related messages as received by you! This is because of the main reason we provide Webhooks here - to allow building of apps similar to our Web Inbox.

Solutions like Web Inbox frontend will mainly use the WABA Webhook message type for things like message delivery status update.

Rule Engine

A Rule Engine is a component that determines when messages should be assigned to real Users or bot Users.

WhatsApp Integration API distributes Webhooks among different configured recipient Users, as described in WABA Webhook section.

In order to determine which messages go to which Users, Integration API backend communicates with the Rule Engine.

You are able to provide your own custom Rule Engine implementation. If you don't do that, your inbox is running a Default Rule Engine.

Communication with a Rule Engine (either Default or custom) is made on following events:

  • Whenever a new Message arrives from WhatsApp directly to your Inbox, the API backend asks the Rule Engine which User should be assigned to this message
  • Whenever a new Message is created and sent from your Inbox to WhatsApp, the API backend asks the Rule Engine if assignment should be changed now
  • Whenever any existing Message is tagged with a text Tag or advanced metadata, the API backend asks the Rule Engine about assignment as well
  • Whenever any existing Chat is tagged with a text Tag or advanced metadata

When backend receives a response from the Rule Engine, the Integration API takes care of notifying assigned Users with web browser desktop notification (Web App human Users) or Webhooks (integrated apps or bots).

Default Rule Engine

Default Rule Engine allows you to set simple set of User assignment Rules based on Message tagging.

For example, you're able to configure Default Rule Engine to forward fresh new Messages to your bot or spam-filtering solution first, before they go to real customer support or agents.

Then, you can implement your bot or spam-filtering solution so that it tags a specified Message on events like:

  • the bot can no longer continue this conversation, and a real person needs to be involved
  • or spam-filtering solution accepted the message, and it can go forward

You do that by making your bot or spam-filtering solution call Integration API directly and tag related Message or entire Chat. In our example:

  • the bot might tag a Message with a "Agent needed" tag
  • the spam-filtering solution might give a "No spam" tag

When a new tagging is created, the Rule Engine is called again, to determine if any action needs to be taken. In our case:

  • API backend tells Rule Engine that a Message was tagged with "Agent needed" Tag
  • Rule Engine then checks its set of Rules
  • One Rule says that "Agent needed" Tag message should be assigned to one of the Users in "Agents" Group
  • Rule Engine replies with one of the Users from the "Agents" user Group

You can configure the Default Rule Engine in "Rule Engine" section of Admin Panel.

get.chat Inbox settings allow defining read/write (or receive/send) permissions to Users and user Groups, based on assignment. Thanks to that, you can easily configure:

  • if a User is allowed to write to a Chat they are assigned to (by default: you can write to Chats you are assigned to)
  • if a User is allowed to read from Chats assigned to other members of the same Group (by default: you can read from Chats assigned to other members of your Group)
  • if a User is allowed to write to Chats assigned to other members of the same Group (by default: you're not allowed to write to Chats assigned to another User)

Permissions are managed in "Permissions" section of the Admin Panel.

Custom Rule Engine

If a Default Rule Engine feature set does not cover your use case, you can implement your custom Rule Engine. In that case you will need to:

  1. Implement Rule Engine HTTP API with an HTTP Server Webhook receiver
  2. Expose the server and provide URL to your custom Rule Engine endpoint, using get.chat Hub Admin Panel

How to configure your custom Rule Engine at the get.chat Hub Admin Panel: Go to your Admin Panel and click "Rule Engine" then click "Switch to Custom Rule Engine". You will see a form where your custom Rule Engine can be entered. You can also provide optional additional headers that are needed to reach your webhook receiver server, such as Authorization header for security.

Custom Rule Engine needs to expose only one endpoint and will receive WABA Webhook to this endpoint.

As described at the beginning of Rule Engine chapter, there are three events on which Rule Engine Webhook is called. Each event will call your custom Rule Engine with a separate payload exclusively:

  • "incoming_messages" - whenever a new Message arrives from WhatsApp directly to your Inbox,
  • "outgoing_messages" - whenever one of the Inbox Users writes a new Message
  • "chat_tagging" - whenever any Message is tagged or tagging is removed.
  • "message_tagging"- whenever any Chat is tagged or tagging is removed. (Keep in mind that when a Message is tagged with a Tag, then a corresponding Chat is tagged with the same Tag immediately!)

See WABA Webhook extension for above fields description.

The result JSON data of custom Rule Engine response has following fields:

Field assignment
Type Array
Required no
Description A list of assignments, if needed.
Example value
[
{
"message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
"user": 42
},
{
"message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60be",
"group": 23,
"group_assign_method": "let_group_decide"
}
]
Field assignment.message_id
Type String
Required yes
Description ID of the Message that we want to make assignment on
Example value "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd"
Field assignment.user
Type Integer
Required no
Description ID of the User that has to be assigned to this Message Chat
Example value 42
Field assignment.group
Type Integer
Required no
Description ID of the Group that has to be assigned to this Message Chat
Example value 23
Field assignment.group_assign_method
Type String
Required Required when assignment.group field is returned
Description Which method to use when assigning the Chat to a Group
Possible values "round_robin" (Round Robin) - will instantly assign one of the Group members on a round-robin manner.
"let_group_decide" (Let Group members decide) - will let Group members decide, assigning Group only and leaving the User assignment blank, so that Group members could choose the assignment themself.

Custom Rule Engine response example

Below is an example of response returned by custom Rule Engine implementation:

{
  "assignment": [
        {
            "message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
            "user": 42
        },
        {
            "message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60be",
            "group": 23,
            "group_assign_method": "let_group_decide"
        }
    ]
}

Custom Rule Engine implementation example

Below is an example of simple custom Rule Engine writen in Python using AIOHttp library:

#!/usr/bin/env python3

import loguru
import traceback

from aiohttp import web


logger = loguru.logger


routes = web.RouteTableDef()


@routes.post('/webhook')
async def webhook(request: web.Request):

    try:
        response = {
            'assignment': []
        }
        request_data = await request.json()

        if request_data.get('incoming_messages'):
            for message in request_data.get('incoming_messages'):
                # Assign every new message to a bot with User ID = 42
                response['assignment'].append({
                    'message_id': message['id'],
                    'user': 42
                })

        if request_data.get('chat_tagging'):
            tagging = request_data.get('chat_tagging')
            # Assign every Chat rejected by a bot, to a group of Agents
            if tagging['action'] == 'added' and tagging['tag']['name'] == 'Agent needed':
                response['assignment'].append({
                    # Assign a chat to a group
                    'chat_id': tagging['chat'],
                    'group': 23,
                    'group_assign_method': 'let_group_decide'
                })

        if request_data.get('message_tagging'):
            tagging = request_data.get('message_tagging')
            # Remember that Messages can be tagged separately, too
            if tagging['action'] == 'added' and tagging['tag']['name'] == 'Agent needed':
                response['assignment'].append({
                    # Assign a chat to a group, but also indicate which message the assignment is started
                    'message_id': tagging['message'],
                    'group': 23,
                    'group_assign_method': 'let_group_decide'
                })

        return web.json_response(response)

    except Exception as error:
        logger.error(traceback.format_exc())
        return web.json_response({'error': str(error)})


if __name__ == '__main__':
    app = web.Application()
    app.add_routes(routes)
    web.run_app(app)

Here is how an exemplary flow (with participation of above code) could look like. Some details are provided about participating app or bot Users as well.

  1. A new Message is sent from WhatsApp to your Inbox

  2. get.chat Integration API calls your Rule Engine Webhook with following payload:

    (Irrelevant data hidden for readability)

    {
      "contacts": "...",
      "messages": [ {
        "from": "48123123123",
        "id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
        "...": "..."
      } ]
    }
    
  3. Rule Engine replies with following payload:

    (Assuming the bot User id is 42, for example)

    {
      "assignment": [{
        "message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60bd",
        "user": 42
      }]
    }
    
  4. get.chat Integration API handles the assignment change and notifies corresponding bot User (user id = 42)

  5. Bot User then receives its own Webhook with following payload:

    (Irrelevant data hidden for readability)

    {
        "assigned_messages": [ {
            "waba_payload": {
                "from": "48123123123",
                "id": "ABGGSFEBeRJ_AhD8o8zP9ulNeUPgdK123456",
                "type": "text",
                "text": {
                    "body": "Hello"
                },
                "...": "..."
            },
            "...": "..."
        } ]
    }
    
  6. Bot User then replies to the WhatsApp User using Integration API endpoint post Create Message:

    (Irrelevant data hidden for readability)

    {
      "wa_id": "48123123123",
      "type": "text",
      "text": {
        "body": "Hello! How may I help you?"
      }
    }
    

    IMPORTANT: It is important to use the same wa_id as in received message (assigned_messages.0.waba_payload.from in the 5. step). By default, bot will be able to reply to assigned Chat only.

    NOTE: A bot might use a template message at this point, showing possible action button answers to the user.

  7. The conversation continues as long as bot can handle the message:

    • Incoming Messages sent from WhatsApp to the bot, arrive as Webhooks with "messages" payload
    • Each response from the bot to the WhatsApp User have to be sent as API post Create Message calls
  8. Eventually, bot cannot handle the conversation no more or human interaction is requested by WhatsApp user explicitly. Then, bot User calls the Integration API to tag the message accordingly using post Create Tagging call.

    When a Message is tagged, then the related Chat is tagged as well and this is what executes the Rule Engine Rule. Still, we recommend to tag Messages instead of Chats, to preserve the history of when the flow has changed. You can choose however to tag the Chat directly instead and this flow will work exactly the same.

  9. Because a new Tagging was made, Integration API calls your custom Rule Engine what to do with following data:

    (Irrelevant data hidden for readability)

    {
      "message_tagging": [ {
        "message": "d9d2244d-3f31-4229-a7e0-ec38ebcc60be",
        "tag": {
          "name": "Agent needed",
          "id": 5,
          "extra": {}
        },
        "action": "added"
      } ]
    }
    
  10. Rule Engine replies with following payload:

    {
      "assignment": [{
        "message_id": "d9d2244d-3f31-4229-a7e0-ec38ebcc60be",
        "group": 23,
        "group_assign_method": "let_group_decide"
      }]
    }
    
  11. Integration API assigns then this Message Chat to "Agents" Group (id = 23) and notifies each User in the Group letting them to decide who will be assigned or letting them to continue without any assignment.

    Depending on assignment permission settings, Users may assign themselves to the Chat (by default, they can assign themselves to the Chat they have read access to) or can reply to the Chat their Group is assigned to (by default, they're not allowed to write to Chats they're not directly assigned to)

Authorization

Endpoints related to Authorization

convertIdToken

Converts the ID Token to Auth Token.

The ID Token is acquired by get.chat partners via Account Portal API and can be used to authenticate inbox users without password. Read more about that here.

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.

Note that if there is no such user with that e-mail on the related inbox, the user is automatically created as a Regular User member, so this can be used for single-sign-on scenarios.

Request Body schema:
id_token
required
string

ID Token acquired from get.chat's account portal. Read more about that here.

Responses

Request samples

Content type
{
  • "id_token": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

createAuthToken

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,

Request Body schema: application/json
username
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

Messages

You can receive and send WhatsApp messages using following endpoints.

listBulkMessageTasks

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createBulkMessageTask

Create a new task of sending bulk messages to multiple recipients. You can select recipients either by a list of WhatsApp IDs individually, or by selected Tags.

Request Body schema:
Array of objects

A list of explicit recipients. Max length is 1000

Array of objects

A list of Tags that recipients are tagged with.

required
object

Actual message. Note that technically you are able to send any kind of message, but in practice you should mostly send template as bulk message.

Responses

Request samples

Content type
{
  • "recipients": [
    ],
  • "tags": [
    ],
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "recipients": [
    ],
  • "tags": [
    ],
  • "payload": {
    },
  • "total": 0,
  • "done": 0,
  • "timestamp": 0
}

listBulkMessageTaskElements

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

listMessages

A wrapper of messages object of Inbound Notifications from WhatsApp Business API (WABA Stack).

This object field waba_payload contains exactly the same data as specified in WhatsApp Business API.

This endpoint is useful for loading messages into a view. Example use cases:

  • Message view is loaded for the first time
  • Contact message history is loaded or is scrolled

To get the number of new messages for all contacts, see chats endpoint.

Messages are ordered from newest to oldest.

You can use limit and offset query parameters to access each page, but it is often advised to use before_time instead of offset.

For example, if you only need to get most recent 20 messages, you will use:

/api/v1/messages/?limit=20

But if you need to read the history of 20 messages before, you should use before_time equal to the timestamp of the last (20th) message you got before:

/api/v1/messages/?limit=20&before_time=1234567890

As a result, you will get up to 20 messages that were sent before previous 20 messages.

Using before_time instead of offset is advised because it is possible you will get new messages when you browse your paginated history of messages. Since messages are ordered from newest to oldest, offset based pagination is changing each time you receive a new message from a contact. Using before_time solves this problem.

query Parameters
wa_id
string

WhatsApp id of related contact

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

since_time
integer

POSIX timestamp. Returns only messages that are at the same timestamp or newer than specified since_time.

This should be used when implementing scroll of the messages from oldest to newest.

before_time
integer

POSIX timestamp. Returns only messages that are older than specified before_time. This parameter makes it easy to just pass the timestamp of the last message you have and receive only messages older than related message.

This should be used when implementing scroll of the messages from newest to oldest.

mark_as_received
integer

Mark all returned messages as received by you (logged in user). You need to use either this param or POST to /mark_as_received/ endpoint to mark messages as received. Marking messages as received by you is needed to generate a proper list of new messages. (You can check how many unread messages there are for each contact with /chats/ endpoint.) It is required to use one or the other when you implement any kind of indication of new/unread messages or when you simply forward messages to your system in batches and would like to receive only fresh messages on each iteration.

chat_tag_id
integer

Filter only Messages of Chats having given tag ID.

search
string

Filter Messages by string query - search for messages containing specified text phrase.

The API will search in following places:

  • text.body field of waba_payload JSON

  • {media_type}.caption or {media_type}.filename of media type message fields: image, document, audio, video ,voice, sticker"

  • name field of each Tag in tags field of each Message

assigned_to_me
boolean

Filter only Messages of Chats assigned to currently logged in User. Skip this param or leave default false to display all messages User has access to.

assigned_group
integer

Filter only Messages of Chats assigned to specified Group. Skip this param to display all messages currently logged in User has access to. Param value is an integer identifier of the Group. Only Groups the User is member of can be used.

from_us
boolean

Filter only Messages that are either from us (inbox users and automation) or not.

Responses

Response samples

Content type
application/json
Example
{
  • "count": 1,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

createMessage

Create a new message

This object contains selected data that is following specification of WhatsApp Business API.

The type field determines the type of message. Choosing one of possible types makes related field required. For example, choosing "type": "text" makes field text required.

If the recipient does not have WhatsApp, the resulting WhatsApp Business API error (WhatsApp Business API Client Error Code 470) will be forwarded to you asynchronously using another channel (e.g. websocket).

Request Body schema: application/json
type
required
string
Enum: "text" "image" "contacts" "document" "hsm" "location" "sticker" "template" "audio" "video" "interactive"
verify_contact
boolean or null
Default: false

Deprecated parameter: Will be treated as false regardless of value, as contact verification has been removed from WhatsApp side.

See endpoint description. It has been updated to reflect the new workflow.

object
object
contacts
object
hsm
object

Deprecated: The hsm object has been deprecated with v2.39 of the WhatsApp Business API.See 2.39.1 changelog and WhatsApp Business API Documentation.

location
object
template
object
object
interactive
wa_id
required
string^[0-9]+$

WhatsApp ID of the message recipient (phone number in canonical form)

Responses

Request samples

Content type
application/json
Example
{
  • "wa_id": "48123123123",
  • "type": "text",
  • "text": {
    }
}

Response samples

Content type
application/json
{
  • "reason": "Message is saved and will be sent as soon as other messages currently pending for this user are delivered.",
  • "id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0"
}

retrieveMessage

query Parameters
wa_id
string

WhatsApp id of related contact

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

since_time
integer

POSIX timestamp. Returns only messages that are at the same timestamp or newer than specified since_time.

This should be used when implementing scroll of the messages from oldest to newest.

before_time
integer

POSIX timestamp. Returns only messages that are older than specified before_time. This parameter makes it easy to just pass the timestamp of the last message you have and receive only messages older than related message.

This should be used when implementing scroll of the messages from newest to oldest.

mark_as_received
integer

Mark all returned messages as received by you (logged in user). You need to use either this param or POST to /mark_as_received/ endpoint to mark messages as received. Marking messages as received by you is needed to generate a proper list of new messages. (You can check how many unread messages there are for each contact with /chats/ endpoint.) It is required to use one or the other when you implement any kind of indication of new/unread messages or when you simply forward messages to your system in batches and would like to receive only fresh messages on each iteration.

chat_tag_id
integer

Filter only Messages of Chats having given tag ID.

search
string

Filter Messages by string query - search for messages containing specified text phrase.

The API will search in following places:

  • text.body field of waba_payload JSON

  • {media_type}.caption or {media_type}.filename of media type message fields: image, document, audio, video ,voice, sticker"

  • name field of each Tag in tags field of each Message

assigned_to_me
boolean

Filter only Messages of Chats assigned to currently logged in User. Skip this param or leave default false to display all messages User has access to.

assigned_group
integer

Filter only Messages of Chats assigned to specified Group. Skip this param to display all messages currently logged in User has access to. Param value is an integer identifier of the Group. Only Groups the User is member of can be used.

from_us
boolean

Filter only Messages that are either from us (inbox users and automation) or not.

Responses

Response samples

Content type
application/json
Example
{
  • "count": 1,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

createReceivedMessageMark

Create a new mark, marking messages as received.

Every new message will be provided via /chats/ endpoint. In order to no longer receive these messages via above endpoint, you need to mark them as received.

You can parse /messages/ endpoint object field received to determine if a given message still needs to be marked as received. By POSTing data to this endpoint, you create (or update) a mark of timestamp in relation to a conversation with a contact of given customer_wa_id.

It is recommended to

  • use WABA Webhooks
  • or to POST to this endpoint whenever you receive a batch of messages using /messages/ endpoint and you confirmed the message was received by the user.

Forwarding messages to your system

If you develop some kind of integration of data between systems or simply bridge these messages to other systems, received message mark is useful for determining which Chats have new messages. By using /chats/ endpoint you can quickly determine which contacts have new, unreceived messages. But to keep this endpoint up to date, you need to create received message marks.

Instant mark

Messages propagated to a User via WABA Webhook successfully (200 OK status code) are automatically marked as received by related User.

It is also possible to mark messages as received "instantly" when polling them via our API directly. In such case you should use mark_as_received parameter of /messages/ endpoint.

If you use mentioned mark_as_received parameter or you configured a WABA Webhook, usage of the /mark_as_received/ endpoint described here is no longer needed.

Request Body schema:
timestamp
required
integer

A timestamp of the latest message that was received by the User calling this API.

This API cannot mark messages as received for timestamps that are in the future. The message must be first stored in the Inbox in order to mark it as received in the Inbox and then mark as read in WhatsApp. Make sure to not use current timestamp from your local clock as it might be off with the Inbox server clock. The best idea is to use only timestamps from incoming message payload. Only then you can avoid race conditions of marking messages as received while not (yet) receiving them.

customer_wa_id
required
string

WhatsApp ID of the message sender

Responses

Request samples

Content type
{
  • "timestamp": 0,
  • "customer_wa_id": "string"
}

Response samples

Content type
application/json
{ }

Persons

WhatsApp Users who contacted your Inbox

retrievePerson

path Parameters
wa_id
required
string

Responses

Response samples

Content type
application/json
{
  • "wa_id": "string",
  • "waba_payload": {
    },
  • "initials": "string",
  • "last_message_timestamp": 0
}

listPersons

query Parameters
limit
integer
offset
integer
search
string

Filter Persons by string query - search for Persons containing specified text phrase.

The API will search in following places:

  • waba_payload.wa_id

  • waba_payload.profile.name

Responses

Response samples

Content type
application/json
{}

Contacts

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.

listContacts

query Parameters
limit
integer

Number of results to return per page.

This endpoint will return as many results as requested × the number of available Contact Providers. So for example if requesting 2 results per page and there are 3 available Contact Providers, the total number of results can be up to 3 × 2 = 6 results.

Some providers do not support pagination on filtering (e.g. Google People API for personal contacts - G Suite is not the case). In such cases, this parameter will not be respected and all filtered results are returned.

search
string

Filter Contacts by string query.

Each available Contact Provider will perform search in their data. Details on where search is performed varies between contact providers, but it often means searching inside contact name, contact phone number and sometimes inside all fields provided by related contact provider.

Searching Contact Providers is expensive, so when implementing this functionality on the frontend, make sure the user really finished typing the search query before calling this endpoint.

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

listBlockedContacts

View blocked contacts list. These phone numbers are blocked by the user due to spam and abuse of WhatsApp.

get.chat WhatsApp Inbox does not keep or manage your contacts. Instead, you can connect your existing contact books or databases, using Contact Providers.

query Parameters
phone_number
string

Phone number which needs to be blocked.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "contacts": [
    ],
  • "pagination": {
    }
}

resolveContact

Resolves Contact details by querying all Contact Providers connected to your inbox. This endpoint communicates with each provider directly, so it provides up-to-date data and isn't very efficient. You should try to use this endpoint as little as possible, for example:

  • when a list of Persons is displayed and you want to update the list of names with Contact Provider data

  • when a detailed view of one Person is displayed

path Parameters
wa_id
required
string

WhatsApp ID of WhatsApp user (phone number in canonical form)

Responses

Response samples

Content type
application/json
{
  • "person": {
    },
  • "contact_provider_results": [
    ]
}

verifyContacts

WABA This endpoint works the same as /v1/contacts WhatsApp Business API endpoint.

Verifies given contacts, by calling WhatsApp Business API directly.

Request Body schema:
blocking
string
Default: "no_wait"
Enum: "no_wait" "wait"

Whether the API request should wait for processing to complete or not before returning a response. For more information, read the Blocking section of WhatsApp Business API documentation.

contacts
required
Array of strings

Array of phone numbers that you are validating.

The numbers can be in any standard telephone number format. The recommended format for contact phone numbers is with a plus sign (+) and the country code. For more information, see the Phone Number Formats section of WhatsApp Business API documentation.

force_check
boolean
Default: false

Whether to check the contacts cache or not. Contact information is normally cached for 7 days. By setting the force_check parameter to true, the cache will be bypassed ensuring a check is performed.

Responses

Request samples

Content type
{
  • "blocking": "no_wait",
  • "contacts": [
    ],
  • "force_check": false
}

Response samples

Content type
application/json
{
  • "contacts": [
    ]
}

blockContact

Block contacts due to spam and abuse of WhatsApp. To block a contact they had to have sent you a message in the last 24 hours.

query Parameters
phone_number
required
string

Phone number which needs to be blocked.

Request Body schema:
reason
string <= 60 characters
Default: ""

Optional string with max length 60. Free form block reason. Will be used when another business account is being blocked.

Responses

Request samples

Content type
{
  • "reason": ""
}

Response samples

Content type
application/json
{ }

unblockContact

Unblock contacts which were blocked or reported to block previously.

query Parameters
phone_number
required
string

Phone number which needs to be blocked.

Request Body schema:
reason
string <= 60 characters
Default: ""

Optional string with max length 60. Free form block reason. Will be used when another business account is being blocked.

Responses

Request samples

Content type
{
  • "reason": ""
}

Response samples

Content type
application/json
{ }

reportContact

Report contacts due to spam and abuse of WhatsApp. Before reporting a contact, they had to have sent you a message in the last 24 hours.

query Parameters
phone_number
string

Phone number which needs to be blocked.

Request Body schema:
reason
string <= 60 characters
Default: ""

Optional string with max length 60. Free form block reason. Will be used when another business account is being blocked.

block
boolean
Default: false

True or false optional boolean with default of false

message_id
string

Optional reported message id

Responses

Request samples

Content type
{
  • "reason": "",
  • "block": false,
  • "message_id": "string"
}

Response samples

Content type
application/json
{ }

Chats

Existing conversations with WhatsApp Users

listChats

Get existing chats and the number of new messages in each chat.

This endpoint is similar to /persons/ endpoint

  • here also contacts are listed, but only these contacts for which conversation already exists.

Chats are sorted by last_message_timestamp, newest to oldest.

To mark these messages as received, first store wa_id (WhatsApp ID) field value of this endpoint. Then use messages endpoint to read messages for related contact and store the message id. After making sure the user has received the message on the frontend, check the timestamp of the most recent message received and use it with /mark_as_received/ endpoint to actually mark it as received.

Marking messages as received is important to prevent duplicate notifications.

Response is paginated. Use limit and offset query parameters to access each page. Query parameter limit default value is 100. JSON response body field count tells the total number of elements available on all pages.

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

chat_tag_id
integer

Filter only Chats having given tag ID.

search
string

Filter Chats by string query - search for chats containing specified text phrase. The API will search in following places:

  • contact.waba_payload.profile.name and contact.waba_payload.wa_id of each Chat
  • name field of each Tag in tags of each Chat
assigned_to_me
boolean

Filter only Chats assigned to currently logged in User. Skip this param or leave default false to display all messages User has access to.

assigned_group
integer

Filter only Chats assigned to specified Group. Skip this param to display all messages currently logged in User has access to. Param value is an integer identifier of the Group. Only Groups the User is member of can be used.

messages_since_time
integer

POSIX timestamp. Returns only Chats containing Messages at the same timestamp or newer than specified value.

messages_before_time
integer

POSIX timestamp. Returns only Chats containing Messages that are older than specified value.

blocked
boolean

Filter only Chats which are blocked due to spam and abuse of WhatsApp.

reported
boolean

Filter only Chats which are reported due to spam and abuse of WhatsApp.

message_has_referral
boolean

When set to true, only Chats having Message with referral object are returned.

message_referral_source_url
string

Filter only Chats that had a Message with referral.source_url, and the last such Message had referral.source_url containing phrase of message_referral_source_url. For example, message_referral_source_url=asd matches referral.source_url = https://asd.com

message_referral_source_id
string

Filter only Chats that had a Message with referral.source_id, and the last such Message had referral.source_id equal to given param.

message_referral_source_type
string

Filter only Chats that had a Message with referral.source_type, and the last such Message had referral.source_type equal to given param. Possible values are "ad" and "post".

message_referral_headline
string

Filter only Chats that had a Message with referral.headline, and the last such Message had referral.headline equal to given param.

message_referral_body
string

Filter only Chats that had a Message with referral.body, and the last such Message had referral.body equal to given param.

message_referral_media_type
string

Filter only Chats that had a Message with referral.media_type, and the last such Message had referral.media_type equal to given param. Possible values are "image" and "video".

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

retrieveChat

path Parameters
wa_id
required
string

Responses

Response samples

Content type
application/json
{
  • "contact": {
    },
  • "new_messages": 0,
  • "wa_id": "string",
  • "last_message": {
    },
  • "assigned_to_user": {
    },
  • "assigned_group": {
    },
  • "tags": [
    ]
}

createChatImport

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.

Request Body schema: application/json
chat_text
required
string

The text chat log as given to you by WhatsApp

Array of objects

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

Responses

Request samples

Content type
application/json
{
  • "chat_text": "10/03/2022, 11:00 - Customer 1: Message 1 10/03/2022, 11:00 - Customer 1: Message 2 Line 1 Message 2 Line 2",
  • "chat_participants": [
    ],
  • "utc_offset_minutes": -420,
  • "device_language_code": "en-US",
  • "media_files": [
    ]
}

Response samples

Content type
application/json
{
  • "contact": {
    },
  • "new_messages": 0,
  • "wa_id": "string",
  • "last_message": {
    },
  • "assigned_to_user": {
    },
  • "assigned_group": {
    },
  • "tags": [
    ]
}

Tags

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.

retrieveChatTagging

path Parameters
id
required
string

A unique integer value identifying this chat tagging.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "tag": 0,
  • "chat": "string",
  • "extra": { }
}

destroyChatTagging

tags: - Tags

path Parameters
id
required
string

A unique integer value identifying this chat tagging.

Responses

listChatTaggingEvents

List all Chat tagging events for selected Chat

query Parameters
wa_id
string

WhatsApp ID of related Chat

since_time
integer

POSIX timestamp. Returns only events that are at the same timestamp or newer than specified since_time. Note that, as opposed to before_time param, this param returns messages where timestamp is equal to the given value.

This should be used when implementing scroll of the event view from oldest to newest.

before_time
integer

POSIX timestamp. Returns only events that are older than specified before_time.

This should be used when implementing scroll of the event view from newest to oldest.

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

retrieveMessageTagging

path Parameters
id
required
string

A unique integer value identifying this message tagging.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "tag": 0,
  • "message": "string",
  • "extra": { }
}

destroyMessageTagging

tags: - Tags

path Parameters
id
required
string

A unique integer value identifying this message tagging.

Responses

listMessageTaggingEvents

List all Message tagging events for selected Chat or Message

query Parameters
wa_id
string

WhatsApp ID of related Chat

message_id
string

Message ID

since_time
integer

POSIX timestamp. Returns only events that are at the same timestamp or newer than specified since_time. Note that, as opposed to before_time param, this param returns messages where timestamp is equal to the given value.

This should be used when implementing scroll of the event view from oldest to newest.

before_time
integer

POSIX timestamp. Returns only events that are older than specified before_time.

This should be used when implementing scroll of the event view from newest to oldest.

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

listTags

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createTag

Create a new Tag that can be later used to tag Messages or Chats

Request Body schema:
name
required
string <= 1000 characters
web_inbox_color
string or null <= 1000 characters

A Web App related setting - which color to show on the Web App frontend

Responses

Request samples

Content type
{
  • "name": "string",
  • "web_inbox_color": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "web_inbox_color": "string"
}

createChatTagging

Assign a Tag to selected Chat.

You cannot create the same Chat + Tag Tagging pair twice, however you can delete and create the same pair again.

Request Body schema:
tag
required
integer

ID of related Tag

chat
required
string

WhatsApp ID of related WhatsApp User the Chat is made with

extra
object or null

Optional additional data. Should not be used on front-end apps. Use only to pass extra data between systems / apps / bots, when Chat is tagged.

Responses

Request samples

Content type
{
  • "tag": 0,
  • "chat": "string",
  • "extra": { }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "tag": 0,
  • "chat": "string",
  • "extra": { }
}

createMessageTagging

Assign a Tag to selected Message. Note that by tagging a Message, corresponding Chat is tagged automatically with the same tag.

You cannot create the same Message + Tag Tagging pair twice, however you can delete and create the same pair again.

Request Body schema:
tag
required
integer

ID of related Tag

message
required
string

Message ID string known from WABA payload

extra
object or null

Optional additional data. Should not be used on front-end apps. Use only to pass extra data between systems / apps / bots, when Message is tagged.

Responses

Request samples

Content type
{
  • "tag": 0,
  • "message": "string",
  • "extra": { }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "tag": 0,
  • "message": "string",
  • "extra": { }
}

destroyTag

tags: - Tags

path Parameters
id
required
string

Responses

Assignment

You can assign Chats to Users or Groups.

retrieveChatAssignment

path Parameters
wa_id
required
string

WhatsApp ID of WhatsApp user (phone number in canonical form)

Responses

Response samples

Content type
application/json
{
  • "wa_id": "string",
  • "assigned_to_user": 0,
  • "assigned_group": 0
}

updateChatAssignment

Assign a Chat to yourself or any User or Group You can remove Chat assignment by passing null value.

path Parameters
wa_id
required
string

WhatsApp ID of WhatsApp user (phone number in canonical form)

Request Body schema:
wa_id
required
string <= 100 characters ^[0-9]+$

WhatsApp ID of WhatsApp user (phone number in canonical form)

assigned_to_user
integer or null

ID of the User this Chat is assigned to

assigned_group
integer or null

ID of the Group assigned

Responses

Request samples

Content type
{
  • "wa_id": "string",
  • "assigned_to_user": 0,
  • "assigned_group": 0
}

Response samples

Content type
application/json
{
  • "wa_id": "string",
  • "assigned_to_user": 0,
  • "assigned_group": 0
}

partialUpdateChatAssignment

Assign a Chat to yourself or any User or Group You can remove Chat assignment by passing null value.

path Parameters
wa_id
required
string

WhatsApp ID of WhatsApp user (phone number in canonical form)

Request Body schema:
wa_id
required
string <= 100 characters ^[0-9]+$

WhatsApp ID of WhatsApp user (phone number in canonical form)

assigned_to_user
integer or null

ID of the User this Chat is assigned to

assigned_group
integer or null

ID of the Group assigned

Responses

Request samples

Content type
{
  • "wa_id": "string",
  • "assigned_to_user": 0,
  • "assigned_group": 0
}

Response samples

Content type
application/json
{
  • "wa_id": "string",
  • "assigned_to_user": 0,
  • "assigned_group": 0
}

listChatAssignmentEvents

List all Chat assignment events for selected Chat

query Parameters
wa_id
string

WhatsApp ID of related Chat

since_time
integer

POSIX timestamp. Returns only events that are at the same timestamp or newer than specified since_time. Note that, as opposed to before_time param, this param returns messages where timestamp is equal to the given value.

This should be used when implementing scroll of the event view from oldest to newest.

before_time
integer

POSIX timestamp. Returns only events that are older than specified before_time.

This should be used when implementing scroll of the event view from newest to oldest.

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

Saved Responses

You can keep simple text Saved Responses that your Inbox Users can use separately from Templates

listSavedResponses

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createSavedResponse

Request Body schema:
text
required
string

Responses

Request samples

Content type
{
  • "text": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "text": "string",
  • "created_by": "string",
  • "timestamp": 0
}

deleteSavedResponse

operationId: deleteSavedResponse tags: - Saved Responses

path Parameters
id
required
string

A unique integer value identifying this saved response.

Responses

Templates

Message Templates management proxy

listTemplates

List all your message templates.

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createTemplate

Create a new message template.

Editing templates is not supported. To update one of your templates, please delete current template and then create a new one.

Entire body schema follows schema as explained in WhatsApp Business API Message Templates documentation.

In above link, you can find more information about parameters, components, and buttons. There is also a list of all supported languages here.

Request Body schema:
name
required
string

The name of the message template.

category
required
string

The type of message template. Values: ACCOUNT_UPDATE, PAYMENT_UPDATE, PERSONAL_FINANCE_UPDATE, SHIPPING_UPDATE, RESERVATION_UPDATE, ISSUE_RESOLUTION, APPOINTMENT_UPDATE, TRANSPORTATION_UPDATE, TICKET_UPDATE, ALERT_UPDATE, AUTO_REPLY

language
required
string

The language of message template, e.g. en_US

components
required
Array of objects

The list of definitions of parts of message template. See WhatsApp Business API Documentation.

Responses

Request samples

Content type
{
  • "name": "string",
  • "category": "string",
  • "language": "string",
  • "components": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "category": "string",
  • "language": "string",
  • "components": [
    ],
  • "namespace": "string",
  • "rejected_reason": "string",
  • "status": "string"
}

checkTemplateRefreshStatus

Check if the refresh operation is currently in progress.

Responses

Response samples

Content type
application/json
{
  • "currently_refreshing": false
}

issueTemplateRefreshRequest

Issue refresh of all your templates from WhatsApp Business API

Without calling this endpoint, your templates are refreshed every few hours.

This will start a refresh task, if no refresh is currently ongoing. Refresh operation might take a few minutes to complete.

Request Body schema:
object (RefreshRequest)

Responses

Request samples

Content type
{ }

Response samples

Content type
application/json
{ }

destroyTemplate

Delete a given message template

path Parameters
name
required
string

Responses

Business Profile

Your WhatsApp Business Profile

checkSettingsRefreshStatus

Check if the refresh operation is currently in progress.

Responses

Response samples

Content type
application/json
{
  • "currently_refreshing": false
}

retrieveBusinessProfileSettings

Responses

Response samples

Content type
application/json
{
  • "address": "string",
  • "description": "string",
  • "email": "user@example.com",
  • "vertical": "Automotive",
  • "websites": [
    ]
}

partialUpdateBusinessProfileSettings

Request Body schema:
address
required
string
description
required
string
email
required
string <email>
vertical
required
string
Enum: "Automotive" "Beauty, Spa and Salon" "Clothing and Apparel" "Education" "Entertainment" "Event Planning and Service" "Finance and Banking" "Food and Grocery" "Public Service" "Hotel and Lodging" "Medical and Health" "Non-profit" "Professional Services" "Shopping and Retail" "Travel and Transportation" "Restaurant" "Other"
websites
Array of any

Responses

Request samples

Content type
{
  • "address": "string",
  • "description": "string",
  • "email": "user@example.com",
  • "vertical": "Automotive",
  • "websites": [
    ]
}

Response samples

Content type
application/json
{
  • "address": "string",
  • "description": "string",
  • "email": "user@example.com",
  • "vertical": "Automotive",
  • "websites": [
    ]
}

retrieveProfileAbout

Retrieve Profile "about" section

Responses

Response samples

Content type
application/json
{
  • "settings": {
    }
}

updateProfileAbout

Update Profile "about" section - only available for admin Users.

Request Body schema:
required
object

Responses

Request samples

Content type
{
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "settings": {
    }
}

retrieveProfilePhoto

Retrieve Profile Photo - only available for admin Users.

Responses

updateProfilePhoto

Update Profile Photo - only available for admin Users.

Request Body schema:
file_encoded
required
string <binary>

Binary file

Responses

Request samples

Content type
{
  • "file_encoded": "string"
}

Response samples

Content type
application/json
{ }

deleteProfilePhoto

Delete Profile Photo - only available for admin Users.

Responses

issueSettingsRefreshRequest

Issue refresh of your settings: Business Profile, Profile About and Profile Photo, from WhatsApp Business API

Without calling this endpoint, your settings are refreshed every few hours.

This will start a refresh task, if no refresh is currently ongoing. Refresh operation might take a few minutes to complete.

Request Body schema:
object (RefreshRequest)

Responses

Request samples

Content type
{ }

Response samples

Content type
application/json
{ }

Media Files

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.

retrieveMediaFile

Retrieve binary raw media file

Used in media messages and for display.

query Parameters
id
required
string

A UUID string identifying this media file.

mime_type_type
string

mime_type_type and mime_type_subtype that, when combined together, determine for you a content type of retrieved media file: {mime_type_type}/{mime_type_subtype}. For example mime_type_type=image&mime_type_subtype=jpeg means Content-Type image/jpeg. This information is not needed for HTTP client that will ignore file type (for example most of web browsers during file download) but it will be crucial for others (for example web browsers during file display or WhatsApp displaying outgoing message media to end users)

mime_type_subtype
string

mime_type_type and mime_type_subtype that, when combined together, determine for you a content type of retrieved media file - {mime_type_type}/{mime_type_subtype}. For example mime_type_type=image&mime_type_subtype=jpeg means Content-Type image/jpeg. This information is not needed for HTTP client that will ignore file type (for example most of web browsers during file download) but it will be crucial for others (for example web browsers during file display or WhatsApp displaying outgoing message media to end users)

Responses

createMediaFile

Create a new media file

Use this endpoint to upload a new media file before you enter it into a new message as an attachment.

Request Body schema: multipart/form-data
file_encoded
string <binary>

Encoded in Base64.

Responses

Response samples

Content type
application/json
{
  • "file": "string",
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Users

Inbox Users

listUsers

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createNewUser

Creates a new User. Only admin Users can create new Users.

IMPORTANT: Heads up! This request response returns an activation_url field, which is returned this way only once!

When you create a new User using this API, you need to call returned activation_url in order to activate newly created account.

Activating app Users

If you created a new User with role "app", calling the activation_url will result with a JSON response equal to Token Authorization request response, for example:

{"token": "8aeb44f5a318542d32bb13019d68198467ee21f0"}

You can then use this token with no need to set any password for this User.

Note that for "app" users, the activation code is no longer valid after the token is returned!

Activating regular and admin Users

When creating regular users, you might want to set password first and then activate the User afterwards. Use /users/{id}/password/change/ to set a password for this new User and then activate it.

If you integrate our API to an external system, you can integrate this URL so that users activate their accounts themselves either via email or any other solution you're using.

After activation URL is called, the account is ready to be used.

Request Body schema:
username
required
string

Username that is used in combination with password during login.

Only alphanumeric characters are allowed (A-Z, a-z, 0-9).

first_name
string <= 150 characters
last_name
string <= 150 characters
email
string <email>
object

Optional field used to create app users and additional admin users

Responses

Request samples

Content type
{
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    }
}

Response samples

Content type
application/json
{
  • "url": "string",
  • "activation_url": "http://example.com",
  • "id": 0,
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    }
}

retrieveCurrentUser

Get object of currently logged in User

Responses

Response samples

Content type
application/json
{
  • "url": "string",
  • "id": 0,
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

retrieveUser

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "url": "string",
  • "id": 0,
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

updateUser

Update user data - all fields are required. Only admin Users and related User can update this data.

path Parameters
id
required
string
Request Body schema:
username
required
string

Username that is used in combination with password during login.

Only alphanumeric characters are allowed (A-Z, a-z, 0-9).

email
required
string <email>

E-mail address of this new user.

object

Optional field used to create app users and additional admin users

required
Array of objects
required
object

Responses

Request samples

Content type
{
  • "username": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

Response samples

Content type
application/json
{
  • "url": "string",
  • "id": 0,
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

partialUpdateUser

Partially update user data - all fields are optional. Only admin Users and related User can update this data.

path Parameters
id
required
string
Request Body schema:
username
required
string

Username that is used in combination with password during login.

Only alphanumeric characters are allowed (A-Z, a-z, 0-9).

email
required
string <email>

E-mail address of this new user.

object

Optional field used to create app users and additional admin users

required
Array of objects
required
object

Responses

Request samples

Content type
{
  • "username": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

Response samples

Content type
application/json
{
  • "url": "string",
  • "id": 0,
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "profile": {
    },
  • "groups": [
    ],
  • "permissions": {
    }
}

changeMyPassword

Change your password (currently logged in User)

Request Body schema:
current_password
required
string

Provide current password for security

new_password
required
string

Provide a new password that will be set to your account now

Responses

Request samples

Content type
{
  • "current_password": "string",
  • "new_password": "string"
}

Response samples

Content type
application/json
{ }

changeUserPassword

Change password of somebody else (only available for admins)

path Parameters
id
required
string
Request Body schema:
password
required
string

Responses

Request samples

Content type
{
  • "password": "string"
}

Response samples

Content type
application/json
{ }

Groups

Groups of Inbox Users

listGroups

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

retrieveGroup

path Parameters
id
required
string

A unique integer value identifying this user group.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string"
}

Automation

These API endpoints allow you to manage Rule Engine rules.

listAutomationRules

Get all Rule Engile Rules.

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 123,
  • "results": [
    ]
}

createAutomationRule

Create a new Rule Engile Rule.

Request Body schema:
required
object

Activate this Rule each time when following conditions are met.

object

Responses

Request samples

Content type
{
  • "when": {
    },
  • "then": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "when": {
    },
  • "then": {
    }
}

retrieveAutomationRule

Get all Rule Engile Rules.

path Parameters
id
required
string

A unique integer value identifying this rule.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "when": {
    },
  • "then": {
    }
}

updateAutomationRule

Update the Rule Engile Rule.

path Parameters
id
required
string

A unique integer value identifying this rule.

Request Body schema:
required
object

Activate this Rule each time when following conditions are met.

object

Responses

Request samples

Content type
{
  • "when": {
    },
  • "then": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "when": {
    },
  • "then": {
    }
}

partialUpdateAutomationRule

Update the Rule Engile Rule.

path Parameters
id
required
string

A unique integer value identifying this rule.

Request Body schema:
required
object

Activate this Rule each time when following conditions are met.

object

Responses

Request samples

Content type
{
  • "when": {
    },
  • "then": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "when": {
    },
  • "then": {
    }
}

destroyAutomationRule

Delete the Rule Engile Rule.

path Parameters
id
required
string

A unique integer value identifying this rule.

Responses

E-mail Notifications

Send e-mail notifications

resendActivationEmailNotification

Re-try activation e-mail in case something gone wrong (e-mail inbox full, incorrect e-mail address that is now changed, etc.).

Responses

Response samples

Content type
application/json
{ }

Webhooks

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

listWabaWebhooks

Webhook sent by WhatsApp Business API to your endpoint(s)

Only admin Users can see a list of all Users WABA Webhooks. Other Users receive a list of one element of their own WABA Webhook (if configured).

This resource describes configuration of webhook sent from WhatsApp Business API / WABA Stack to one of your apps (or systems). WhatsApp Business API itself allows you to integrate only one webhook. With our API you can set up multiple per-user webhooks.

See Integration chapter to learn more about per-user webhooks.

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createWabaWebhook

Create WABA Webhook for this user (currently logged in user)

One user can have multiple WABA Webhook configs, for example:

[{
    "id": 1,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": true,
    "on_outgoing_message": false,
    "on_assigned": false
}, {
    "id": 2,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": true,
    "on_assigned": false,
    "headers": {}
}, {
    "id": 3,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": false,
    "on_assigned": true,
    "headers": {"Authorization": "Token 8aeb44f5a318542d32bb13019d68198467ee21f0"}
}]

or you can have following webhooks:

[{
    "id": 1,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": true,
    "on_outgoing_message": true,
    "on_assigned": false
}, {
    "id": 2,
    "user": {"id": 23, "username": "string", "url": "string"},
    "url": "http://example.com",
    "on_incoming_message": false,
    "on_outgoing_message": false,
    "on_assigned": true,
    "headers": {"Authorization": "Token 8aeb44f5a318542d32bb13019d68198467ee21f0"}
}]

After this webhook is created, WABA webhooks are propagated to your URL starting from next webhook.

See WABA Webhook section to learn more how propagation works.

Request Body schema:
url
required
string <uri> ^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*...

Remember to use https:// URLs for your webhooks!

Note: You can validate Webhook events by specifying a shared secret as a query parameter when you set the Webhook URL. Example: https://url?auth={shared_secret}.

on_incoming_message
boolean

Call this Webhook on every new Message coming from WhatsApp to get.chat Inbox.
This is how WABA Stack Webhooks are called.

on_outgoing_message
boolean

Call this Webhook on every new Message sent from get.chat Inbox to WhatsApp.
You should use this setting when integrating a system in which you want to have complete copies of all your conversations.

on_assigned
boolean
Default: true
headers
object

Additional headers needed when calling a Webhook. Each header needs to be provided as a key-value pair in JSON format.
Useful for things like API keys with Authorization or other headers.

Example: {"Authorization": "Token 1234567890qwertyuiop"}

Responses

Request samples

Content type
{
  • "on_incoming_message": true,
  • "on_outgoing_message": true,
  • "on_assigned": true,
  • "headers": { }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": {
    },
  • "on_incoming_message": true,
  • "on_outgoing_message": true,
  • "on_assigned": true,
  • "headers": { }
}

retrieveWabaWebhook

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": {
    },
  • "on_incoming_message": true,
  • "on_outgoing_message": true,
  • "on_assigned": true,
  • "headers": { }
}

updateWabaWebhook

path Parameters
id
required
string
Request Body schema:
url
required
string <uri> ^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*...

Remember to use https:// URLs for your webhooks!

Note: You can validate Webhook events by specifying a shared secret as a query parameter when you set the Webhook URL. Example: https://url?auth={shared_secret}.

on_incoming_message
boolean

Call this Webhook on every new Message coming from WhatsApp to get.chat Inbox.
This is how WABA Stack Webhooks are called.

on_outgoing_message
boolean

Call this Webhook on every new Message sent from get.chat Inbox to WhatsApp.
You should use this setting when integrating a system in which you want to have complete copies of all your conversations.

on_assigned
boolean
Default: true
headers
object

Additional headers needed when calling a Webhook. Each header needs to be provided as a key-value pair in JSON format.
Useful for things like API keys with Authorization or other headers.

Example: {"Authorization": "Token 1234567890qwertyuiop"}

Responses

Request samples

Content type
{
  • "on_incoming_message": true,
  • "on_outgoing_message": true,
  • "on_assigned": true,
  • "headers": { }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": {
    },
  • "on_incoming_message": true,
  • "on_outgoing_message": true,
  • "on_assigned": true,
  • "headers": { }
}

deleteWabaWebhook

Deletes WABA Webhook permanently

path Parameters
id
required
string

Responses

testWabaWebhook

Test the WABA Webhook, by sending a mock "statuses" HTTP POST request to its target url

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{ }

Plugin Webhooks

Plugins are Integration Layer extensions or integrations with other systems.

Integration API communicates with Plugin API that is exposed by each installed Plugin. Sometimes, Plugins need to be accessed from the Internet (for example a webhook from an original External System that related Plugin integrates).

To reach a Plugin from the Internet, you need to use Generalized Webhooks defined below.

When calling a Generalized Webhook API endpoint, your request is redirected to /public/webhook endpoint of a plugin of plugin_id of your choice. Each Plugin then secures this request, checking any API key or token, implemented on their own.

Generalized Webhooks expose GET, POST, PUT and DELETE methods. Each of them ends up as POST method sent to /public/webhook Plugin API endpoint. Other methods are only provided for compatibility with limited External Systems.

As a result, /public/webhook receives following request, regardless of HTTP method used:

  • query params are copied to /public/webhook query params, and are provided in JSON body as an addition, as shown below
  • headers are copied to /public/webhook HTTP headers, and are provided in JSON body as an addition, as shown below
  • data provided in JSON request body is copied into request.data body

For example, if sending a HTTP request to Integration API endpoint with:

  • using method PUT
  • a header X-My-Plugin-API-Key: abc
  • query param project_id=42
  • JSON data {"ticket_id": "P-123", "status": "closed"}
curl -H "X-My-Plugin-API-Key: abc" \
    -H "Accept: application/json" \
    -X PUT \
    https://baseurl/api/v1/plugins/public/webhook/?project_id=42 \
    --data "{\"ticket_id\": \"P-123\", \"status\": \"closed\"}"

Your Plugin will receive following webhook as a result:

POST /public/webhook/?project_id=42

{
    "request": {
        "query_params": {
            "project_id": "42"
        },
        "method": "PUT",
        "headers": {
            "X-My-Plugin-API-Key": "abc"
        },
        "data": {
            "ticket_id": "P-123",
            "status": "closed"
        }
    }
}

getWebhook

Generalized Webhook for Plugins. See Plugins section for more info.

Providing plugin_id in either query params or request body is required.

query Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any query param you provide here will be used in forwarded Plugin API request

Request Body schema: application/json
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any param you provide here will be used in forwarded Plugin API request

Responses

Request samples

Content type
application/json
{
  • "plugin_id": "string",
  • "(any)": null
}

Response samples

Content type
application/json
{
  • "response": { }
}

postWebhook

Generalized Webhook for Plugins. See Plugins section for more info.

Providing plugin_id in either query params or request body is required.

query Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any query param you provide here will be used in forwarded Plugin API request

Request Body schema: application/json
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any param you provide here will be used in forwarded Plugin API request

Responses

Request samples

Content type
application/json
{
  • "plugin_id": "string",
  • "(any)": null
}

Response samples

Content type
application/json
{
  • "response": { }
}

putWebhook

Generalized Webhook for Plugins. See Plugins section for more info.

Providing plugin_id in either query params or request body is required.

query Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any query param you provide here will be used in forwarded Plugin API request

Request Body schema: application/json
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any param you provide here will be used in forwarded Plugin API request

Responses

Request samples

Content type
application/json
{
  • "plugin_id": "string",
  • "(any)": null
}

Response samples

Content type
application/json
{
  • "response": { }
}

deleteWebhook

Generalized Webhook for Plugins. See Plugins section for more info.

Providing plugin_id in either query params or request body is required.

query Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any query param you provide here will be used in forwarded Plugin API request

Request Body schema: application/json
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin. Alias: (Can be used instead of "plugin_id") "getchat_plugin_id"

(any)
any

Any param you provide here will be used in forwarded Plugin API request

Check the related plugin documentation for response specs.

Responses

Request samples

Content type
application/json
{
  • "plugin_id": "string",
  • "(any)": null
}

Plugin Storage

Key-value storage that every Plugin can use to store important data


Admin user can create/modify/delete Plugin Storage for non-existing Plugins.

App user (that is related to the Plugin) can create/modify/delete Plugin Storage only for itself but not for other and non-existing Plugins.

retrievePluginStorageEntry

path Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin.

key
required
string

Key of data in the database.

Responses

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "key": "string",
  • "value": { }
}

updatePluginStorageEntry

path Parameters
plugin_id
required
string
key
required
string
Request Body schema:
key
required
string

Key of data in the database.

value
object

Value of storage entry.

Responses

Request samples

Content type
{
  • "key": "string",
  • "value": { }
}

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "key": "string",
  • "value": { }
}

destroyPluginStorageEntry

path Parameters
plugin_id
required
string
key
required
string

Responses

searchPluginStorageEntries

path Parameters
plugin_id
required
string

Plugin id (UUID). This is used for selecting requested plugin.

query Parameters
key
required
string

Key of data in the database. Glob patterns are allowed (REDIS-like). Example: t*st[a-z][0-9]

Responses

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "key": "string",
  • "value": { }
}

createPluginStorageEntry

path Parameters
plugin_id
required
string
Request Body schema:
key
required
string

Key of data in the database.

value
object

Value of storage entry.

Responses

Request samples

Content type
{
  • "key": "string",
  • "value": { }
}

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "key": "string",
  • "value": { }
}

Infrastructure Plugins

Plugins that are created and managed by the infrastructure hosting the Inbox

listInfrastructurePlugins

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

createInfrastructurePlugin

Request Body schema:
plugin_id
string <uuid>

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

name
required
string <= 1000 characters

Provide a user-friendly name that will be displayed to end users (for example "Pipedrive Integration")

user
integer or null

User which credentials will be passed to this Plugin on init. This Plugin will be able to use the Integration API later on, with API Token of this User.
The User is created for each Plugin automatically.

plugin_api_url
string or null <uri> <= 10000 characters ^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*...

Responses

Request samples

Content type
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

retrieveInfrastructurePlugin

path Parameters
plugin_id
required
string

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

Responses

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

updateInfrastructurePlugin

path Parameters
plugin_id
required
string

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

Request Body schema:
plugin_id
string <uuid>

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

name
required
string <= 1000 characters

Provide a user-friendly name that will be displayed to end users (for example "Pipedrive Integration")

user
integer or null

User which credentials will be passed to this Plugin on init. This Plugin will be able to use the Integration API later on, with API Token of this User.
The User is created for each Plugin automatically.

plugin_api_url
string or null <uri> <= 10000 characters ^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*...

Responses

Request samples

Content type
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

partialUpdateInfrastructurePlugin

path Parameters
plugin_id
required
string

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

Request Body schema:
plugin_id
string <uuid>

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

name
required
string <= 1000 characters

Provide a user-friendly name that will be displayed to end users (for example "Pipedrive Integration")

user
integer or null

User which credentials will be passed to this Plugin on init. This Plugin will be able to use the Integration API later on, with API Token of this User.
The User is created for each Plugin automatically.

plugin_api_url
string or null <uri> <= 10000 characters ^(?:[a-z0-9.+-]*)://(?:[^\s:@/]+(?::[^\s:@/]*...

Responses

Request samples

Content type
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

Response samples

Content type
application/json
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "name": "string",
  • "user": 0,
  • "plugin_api_url": "http://example.com"
}

destroyInfrastructurePlugin

tags: - Infrastructure Plugins

path Parameters
plugin_id
required
string

Uniquely identifies this activated plugin, so that you are able to activate the same plugin type more than once, using different sources or credentials.

Responses

Status

These API endpoints allow you to check the statuses of your Inbox and installed Plugins.

listHealthStatus

Check the health status(es) of your inbox

Responses

Response samples

Content type
application/json
[
  • {
    }
]

listPluginStatus

Check the plugin status(es) of your inbox

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Errors

These API endpoints allow you to check the errors received from WABA

listWabaErrors

query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

retrieveWabaError

path Parameters
id
required
string

A unique integer value identifying this WABA error.

Responses

Response samples

Content type
application/json
{
  • "waba_payload": { },
  • "timestamp": 0,
  • "waba_id": "string",
  • "getchat_id": "string"
}

Firebase CM device tokens

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.

listFcmDeviceTokens

query Parameters
token
string

Responses

Response samples

Content type
application/json
{}

registerFcmDeviceToken

Registers your device's Firebase Cloud Messaging token. Also the primary endpoint for re-registering existing tokens.

Request Body schema:
token
required
string

Responses

Request samples

Content type
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "token": "string",
  • "user": {
    },
  • "last_seen": "2019-08-24T14:15:22Z"
}

updateFcmDeviceToken

Deregisters the old token and registers the new token (in one request, for convenience).

path Parameters
id
required
string
Request Body schema:
token
required
string

Responses

Request samples

Content type
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "token": "string",
  • "user": {
    },
  • "last_seen": "2019-08-24T14:15:22Z"
}

deregisterFcmDeviceToken

Stops a device from getting push messages.

path Parameters
id
required
string

Responses

Plugin Integration

Store Plugin integration in our centralized database, so that you can easily redirect to the related Inbox from our centralized routing endpoint.

storePluginIntegration Deprecated

Request Body schema:
plugin_id
required
string <uuid>

Unique ID of related plugin.

integration_name
required
string

Name of 3rd party system to be integrated.

integration_id_in
required
string

Indicates where id is located at. Options: [header, body, query].

integration_id_key
required
string

Variable name of id.

integration_id_value
required
string

Unique identifier given by integrated 3rd party system.

Responses

Request samples

Content type
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "integration_name": "string",
  • "integration_id_in": "string",
  • "integration_id_key": "string",
  • "integration_id_value": "string"
}

Response samples

Content type
application/json
{
  • "reason": "This API endpoint is deprecated."
}

updatePluginIntegration Deprecated

path Parameters
integration_data_id
required
string
Request Body schema:
plugin_id
required
string <uuid>

Unique ID of related plugin.

integration_name
required
string

Name of 3rd party system to be integrated.

integration_id_in
required
string

Indicates where id is located at. Options: [header, body, query].

integration_id_key
required
string

Variable name of id.

integration_id_value
required
string

Unique identifier given by integrated 3rd party system.

Responses

Request samples

Content type
{
  • "plugin_id": "8b176ba5-fa8e-458e-94ad-85d1ae8f3be0",
  • "integration_name": "string",
  • "integration_id_in": "string",
  • "integration_id_key": "string",
  • "integration_id_value": "string"
}

Response samples

Content type
application/json
{
  • "reason": "This API endpoint is deprecated."
}