V2 API
Errors
Handle errors to ensure a robust integration.
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.
Code | Description |
---|---|
expires_at_in_past | The expires_at parameter is in the past. Provide a future date. |
expires_at_too_far_in_future | The expires_at parameter is too far in the future. Provide a date within the next day. |
insufficient_balance | You do not have a sufficient balance to send this message. Top-up your account from the Dashboard. |
internal | An internal error occurred. Please try again later. |
invalid_api_key | The provided API key is invalid. You can get your API key from the Dashboard. |
invalid_callback_url | The provided callback URL is invalid. |
invalid_correlation_id | The provided correlation ID is invalid. Provide a string with a maximum length of 64 characters. |
invalid_date_format | The date passed is not a valid RFC3339 date. |
invalid_line_type | The provided phone number is not assigned to a mobile phone. Prelude only supports mobile phone numbers. |
invalid_phone_number | The provided phone number is invalid. Provide a valid E.164 phone number. |
invalid_request | The request is invalid. Check your request against the API documentation and try again. |
invalid_sender_id | The provided sender ID is invalid. |
invalid_template_id | The provided template ID is invalid. You can get your template ID from the Dashboard. |
invalid_template_variables | The provided template variables are invalid. Provide a JSON object with the required variables. |
invalid_locale | The provided locale is invalid. Locales should be a BCP-47 formatted string. |
invalid_device_id | The provided device ID is invalid. |
invalid_os_version | The provided OS version is invalid. |
invalid_device_model | The provided device model is invalid. |
invalid_app_version | The provided app version is invalid. |
invalid_device_type | The provided device type is invalid. |
missing_api_key | You forgot to include your API key. Add it to the Authorization header using Bearer authentication, like this: Authorization: Bearer <API_KEY> . |
suspended_account | Your account is suspended. Contact support for more information. |
template_not_found | The provided template ID was not found. |
template_not_registered_in_country | The provided template is not registered in the requested country. |
unauthorized_sender_id | The provided sender ID is not authorized to send messages. Contact support for more information. |
unsupported_country | Prelude does not support sending messages to the provided country yet. Contact support for more information. |
region_blocked_by_customer | This region is blocked for this account. |
region_missing_registration | This region needs additional registration. Contact support for information. |
premature_retry | This verification was retried too early. You can set the delay between retries from your Dashboard. |
spending_limit_exceeded | The spending limit for a time period has been exceeded. You can set the spending limits from your Dashboard. |