Skip to content

Errors & Rate Limits

The Abelo API uses standard HTTP status codes, structured JSON error responses, and token-bucket sliding-window rate limiting.


1. HTTP Status Codes

Code Status Meaning
200 OK The request completed successfully and the response body contains the requested resource.
201 Created The resource (e.g. customer profile or webhook configuration) was successfully created.
204 No Content The request was successful and there is no response body (e.g. profile or webhook deletion).
400 Bad Request Business rule violation (e.g. campaign inactive, missing template parameter, duplicate phone number).
401 Unauthorized Missing, invalid, or expired API authentication credentials or invalid HMAC signature.
403 Forbidden API key missing required scope, or target recipient missing promotional consent.
404 Not Found The requested resource (e.g. campaign ID, profile ID, or webhook ID) does not exist.
409 Conflict Resource cannot be modified (e.g. attempting to edit/delete profiles originating from connected Shopify/WooCommerce stores).
422 Unprocessable Entity Request body failed JSON schema validation (e.g. malformed phone number, missing required fields).
429 Too Many Requests Rate limit exceeded. Back off according to Retry-After.
500 Internal Server Error An unexpected error occurred on the server.

2. Error Response Schemas

Standard Validation Error (422 Unprocessable Entity)

Returned by FastAPI when payload fields violate type, regex, or required schemas:

{
  "detail": [
    {
      "loc": ["body", "recipient", "value"],
      "msg": "Invalid E.164 phone number format",
      "type": "value_error"
    }
  ]
}

Business Logic Error (400 Bad Request / 403 Forbidden)

{
  "error": "Promotional consent not found for profile."
}

Common 400 Bad Request parameter errors:

// When a parameter value contains a link or URL in transactional/OTP messages:
{
  "error": "Template parameter 'tracking_code' cannot contain URLs or links for transactional/OTP messages."
}

// When a parameter value exceeds the 125-character limit:
{
  "error": "Template parameter 'order_details' value cannot exceed 125 characters."
}

// When an OTP campaign is sent without a valid PIN:
{
  "error": "Missing or empty required template parameter: pin"
}

Uniform Validation: Template parameter validation rules (125-character limit, prohibition of dynamic URLs for transactional/OTP categories, and mandatory non-empty PIN for OTP) are enforced identically across all messaging channels (Viber and SMS).


3. Rate Limiting

Rate limiting in Abelo is enforced globally using a Redis Token Bucket (Sliding Window) algorithm scoped per API Key (organization_id + key_id).

Rate Limit Specifications

Parameter Value Description
Bucket Capacity 100 requests Maximum burst capacity of tokens available in the bucket.
Window 60 seconds Time window for complete bucket replenishment.
Refill Rate ~1.67 tokens / sec Tokens are continuously replenished back into the bucket in real time.
Breach Response HTTP 429 Returns 429 Too Many Requests with a Retry-After header when empty.

Rate Limit Response Headers

Every authenticated API response includes real-time rate limit telemetry headers:

Header Description Example
X-RateLimit-Remaining The number of tokens remaining in your bucket for immediate use. 98
X-RateLimit-Reset UNIX timestamp when your bucket will be 100% full. 1771596780
Retry-After (Included on 429 errors) Seconds to wait before attempting the next request. 1

Handling HTTP 429 (Rate Limit Exceeded)

When your application consumes all available tokens, the API responds with 429 Too Many Requests:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1771596780
Retry-After: 1

{
  "error": "Rate limit exceeded"
}

Retry Best Practice

Read the Retry-After header and implement exponential backoff with jitter in your API client.

4. Messaging Error Codes

When sending a message via POST /v1/messages/send, if the message cannot be dispatched, the response returns "status": "failed" along with an error object describing the failure. The same error format is included in message.failed webhook events.

Error schema

Field Type Description
code Integer Normalized integer error code.
message String Message string providing more context on error that occurred.
{
  "code": 1011,
  "message": "Invalid Destination Mobile Number"
}

Note on DLRs: Asynchronous carrier delivery receipts (DLR) received after a message has been sent update the message status (e.g. to failed or expired), while the error object is reserved (null).

Error codes map

Code Description Suggestion
999 Unknown error occurred. Retry. Contact support if it persists.
1000 Unexpected internal system error. Retry. Contact support if it persists.
1001 Network connection error. Retry. Contact support if it persists.
1002 Insufficient account balance. Top-up your messaging balance.
1003 The recipient's country is not included in the allowed destinations. Contact support to include more target countries as needed in channel configuration.
1004 Upstream provider internal server error or timeout. Retry. Contact support if it persists.
1005 Invalid Service ID (deactivated or too recently added). Retry. Contact support if it persists.
1006 Billing or permissions error. Contact support if it persists.
1007 Invalid request data, missing parameters, or validation failure. Review documentation and sent payloads. Contact support if this still doesn't make sense.
1008 User has blocked messages. Viber only. Give up. Try reaching user on another channel.
1009 Recipient is not a Viber user. Viber only. Give up. Try reaching user on another channel.
1010 No suitable device for the requested message type. Viber only. Give up. Try reaching user on another channel.
1011 Invalid destination mobile number. Review phone number input and retry. Contact support if still rejected but doesn't make sense.
1012 Blocked by loop detection. Review phone number input and retry.