API Error Codes
Overview
When using the Mosco API, you may encounter these standard HTTP error codes.
Error codes
- 400 Bad Request: Invalid request body. Check required fields and data types.
- 401 Unauthorized: Missing or invalid API key. Check your Authorization header.
- 403 Forbidden: Your API key doesn't have the required scope (read vs read+write).
- 404 Not Found: The resource doesn't exist. Check the ID in your URL.
- 429 Too Many Requests: Rate limit exceeded (600 requests per minute per key). Implement backoff.
- 500 Internal Server Error: Something went wrong on our end. Retry with exponential backoff.
Error response format
All errors return the same JSON structure:
{
"error": {
"code": "invalid_request",
"message": "phone must be in E.164 format",
"field": "phone"
}
}
The 'field' property is included when the error relates to a specific input field.