List of API response codes
2Chat uses standard HTTP response codes to contextually indicate the result of an operation. These codes try to be as contextual as possible based on the source request.
For example, an HTTP 404 reply indicates that a resource couldn't be found, but the resource being referred to could be a contact, a number, or a message, and it will always depend on the context of the request.
The API will also include a message
field on each response that will contain a description of the error to disambiguate the response's error code further.
HTTP response codes
HTTP Code | Description |
---|---|
200 | Successfully executed retrieval operation. |
201 | Content created, for example, during a contact creation. |
202 | Request accepted, usually to be processed asynchronously. |
400 | Bad request. Check if you are calling the endpoint using the right JSON structure. |
401 | Unauthorized, usually in the context of an invalid API key. |
402 | Payment required, usually when trial accounts expire, or when API credits need to be recharged. |
403 | Operation is forbidden. For example, trying to execute a flow that is not public, or connect a WhatsApp number that already exists. |
406 | Trying to execute an operation on a resource that doesn't support it. For example, trying to add a catalog to a non-WhatsApp Business account. |
410 | WhatsApp number is in the process of connection or disconnection. Try again in a few seconds. |
422 | Malformed or invalid request. Check if you are calling the endpoint using a number that is properly formatted (E.164 format). |
429 | Too many requests in too short a time. Check the API for your plan, and make sure to retry the request automatically. |
503 | Service temporarily unavailable. Check the error message to clarify which service. |
504 | Bad gateway. 2Chat API may be temporarily down. Retry the request after a few seconds. |