HTTP Status Codes The API uses conventional HTTP status codes to indicate success or failure.
| Status | Meaning | What to do |
200 OK | The request succeeded | Parse the response body |
400 Bad Request | Invalid request parameters | Check your query parameters for typos |
404 Not Found | The dataset or endpoint doesn't exist | Verify the category and config name in the URL |
422 Unprocessable Entity | Request validation failed | Fix the parameter values and retry |
500 Internal Server Error | Something went wrong on our end | Wait a moment and retry; report if it persists |
502 Bad Gateway | Data source temporarily unavailable | Wait and retry with exponential backoff |
504 Gateway Timeout | Data source took too long to respond | Wait and retry with exponential backoff |
Error Response Format When an error occurs, the API returns a JSON body with details:
{
"error": {
"code": "not_found",
"message": "Dataset 'tea' not found for source 'unknown'",
"link": "https://plus254.co.ke/api-docs/errors#not_found"
}
}
Error fields
| Field | Type | Description |
error.code | string | Machine-readable error identifier |
error.message | string | Human-readable description of what went wrong |
error.link | string | URL to detailed documentation for this error code |
Error Codes | Code | HTTP Status | Meaning |
not_found | 404 | The requested dataset or source doesn't exist |
invalid_parameter | 400, 422 | A query parameter has an invalid value |
upstream_error | 502, 504 | The data source could not be reached or responded with an error |
internal_error | 500 | An unexpected error occurred on the server |
Back to Quickstart