Response codes

Comprehensive guide to HTTP status codes returned by the Messaging API, including success and error responses with detailed explanations.

The Messaging API returns conventional HTTP status codes to indicate the success or failure of API requests. Understanding these codes helps you handle responses appropriately and troubleshoot issues effectively.


Best practices

✅ Success Handling

  • Always check for 2xx status codes to confirm successful API calls.
  • Process response data only when status indicates success.
  • Implement proper error handling for non-success responses.

🛡️ Error Prevention

  • Use input validation to prevent 4xx errors.
  • Restrict API access appropriately.
  • Display 422 error messages directly to users as they contain helpful feedback.

Status code categories

2xx status codes

Successful requests return status codes in the 2xx range, indicating that your request was received, understood, and processed successfully.

Status CodeDescription
200 OKThe request was successful and the server has returned the requested data.
201 CreatedThe resource has been successfully created or retrieved. This indicates successful POST requests.
202 AcceptedThe request was accepted for processing, but will be processed in the background asynchronously.
204 No contentThe resource was successfully updated or deleted, but no content is returned in the message body.

4xx status codes

Failed requests return status codes in the 4xx range, indicating issues with the request itself, such as authentication problems or malformed data.

Status CodeDescription
400 Bad RequestThe request could not be processed due to incorrect or missing parameters or payload data. Check your request format.
401 UnauthorizedThe authentication credentials provided are not valid. Verify your API key or authentication token.
403 ForbiddenThe authenticated user does not have permission to view the requested resource. Check your access permissions.
404 Not FoundThe resource required does not exist. Verify the endpoint URL and resource ID.
415 Unsupported Media TypeThe content type provided is not supported by the server. Ensure you're using the correct Content-Type header.
422 Unprocessable EntityThe request was well-formed but could not be processed due to semantic errors.

💡 Note: Some API calls also return a JSON response body containing a relevant message object or document payload along with the status code.


✅ Success Handling

  • Always check for 2xx status codes to confirm successful API calls
  • Process response data only when status indicates success
  • Implement proper error handling for non-success responses

🛡️ Error Prevention

  • Use input validation to prevent 4xx errors
  • Restrict API access appropriately
  • Display 422 error messages directly to users as they contain helpful feedback

Quick reference

2xx Success

Request processed successfully. Safe to proceed with response data.

4xx Client Error

Issue with your request. Check authentication, parameters, or permissions.

422 Special Case

User-friendly error messages that can be displayed directly to end users.