Skip to navigation

Errors

Understand error responses from the Esendex API

Every response uses the same envelope: a data object on success and an errors array when something goes wrong.

{
"data": null,
"errors": [
{
"errorCode": "ValidationError",
"errorMessage": "The recipients field is required.",
"metadata": { "field": "recipients" }
}
]
}
FieldDescription
errorCodeA machine-readable code. Branch on this in your code.
errorMessageA human-readable description of the problem.
metadataOptional key/value pairs with extra context, such as the offending field.

HTTP status codes

StatusMeaning
200 OK / 201 CreatedThe request succeeded.
202 AcceptedThe request was accepted for asynchronous processing (for example, sending a message).
400 Bad RequestThe request was invalid. Check errors for details.
401 UnauthorizedThe X-API-Key header is missing or invalid.
404 Not FoundThe resource doesn’t exist or isn’t visible to your account.