Prelude uses conventional HTTP statuses to indicate the success or failure of a request:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error that failed given the information provided (e.g. required parameter was omitted or an authentication failed).
  • Codes in the 5xx range indicate an error with Prelude’s servers (these are rare).

Codes

Below is a list of possible error codes, along with additional information about how to resolve them.

CodeDescription
missing_api_tokenYou forgot to include your API token. Add it to the Authorization header using Bearer authentication, like this: ‘Authorization: Bearer YOUR_SECRET_KEY’.
invalid_api_tokenThe provided API token is invalid. You can get your API token from the Dashboard.
insufficient_balanceYou do not have a sufficient balance to send this message. Top-up your account from the Dashboard.
invalid_phone_numberThe provided phone number is invalid. Provide a valid E.164 phone number.
invalid_line_typeThe provided phone number is not assigned to a mobile phone. Prelude only supports mobile phone numbers.
invalid_template_idThe provided template ID is invalid. You can get your template ID from the Dashboard.
invalid_date_formatThe date passed is not a valid RFC3339 date.
expires_at_in_pastThe expires_at parameter is in the past. Provide a future date.
expires_at_too_far_in_futureThe expires_at parameter is too far in the future. Provide a date within the next day.
invalid_template_variablesThe provided template variables are invalid. Provide a JSON object with the required variables.
template_not_foundThe provided template ID was not found.
template_not_registered_in_countryThe provided template is not registered in the requested country.
internalAn internal error occurred. Please try again later.
unsupported_countryPrelude does not support sending messages to the provided country yet. Contact support for more information.
invalid_callback_urlThe provided callback URL is invalid
suspended_accountYour account is suspended. Contact support for more information.
invalid_requestThe request is invalid. Check your request against the API documentation and try again.
invalid_correlation_idThe provided correlation ID is invalid. Provide a string with a maximum length of 512 characters.

code
string
required

The error code

message
string
required

An English message describing the error

type
string
required

The error type

param
string

The parameter that caused the error