Error handling
An overview of potential error responses from our API.
This guide outlines how the Onderwijsloket API reports errors, how to interpret them, and what to consider when troubleshooting API requests. Our API uses the standard Directus error format and error codes.
Global Error Codes
The table below lists the error codes you may encounter when interacting with the API.
|
Error Code |
Status |
Description |
|
|
400 |
Validation for the request or item failed. |
|
|
403 |
You are not allowed to perform the requested action. |
|
|
403 |
The provided token is invalid. |
|
|
401 |
The provided token is valid but has expired. |
|
|
401 |
Username/password or access token is incorrect. |
|
|
401 |
The request originates from an IP address not allow-listed. |
|
|
401 |
The provided one-time password is incorrect. |
|
|
400 |
The request body contains invalid data or structure. |
|
|
400 |
One or more query parameters are invalid or not supported. |
|
|
415 |
The payload format or |
|
|
429 |
The client has exceeded the allowed request rate. |
|
|
404 |
The requested endpoint does not exist. |
|
|
503 |
An external service required to process the request is unavailable. |
|
|
422 |
The request attempts an illegal or restricted operation. |
|
|
500 |
Something went wrong on our end. |
To avoid leaking information about which items exist, all actions on non-existing items return a FORBIDDEN error rather than NOT_FOUND.
Error Response Structure
All errors follow the standard Directus error response format:
{
"errors": [
{
"message": "Invalid query parameter.",
"extensions": {
"code": "INVALID_QUERY"
}
}
]
}
Each error object includes a human-readable message and a machine-readable code found under extensions.code.
Troubleshooting Guidelines
1. Check Authentication
Ensure that your API token is valid, not expired, and included in the Authorization header.
2. Validate Query Parameters
Errors such as INVALID_QUERY or INVALID_PAYLOAD often result from incorrect field names, unsupported operators, or malformed request bodies.
3. Inspect Permissions
A FORBIDDEN response typically indicates insufficient permissions. Verify that the authenticated role has the required access to the collection or item.
4. Monitor Rate Limits
Although individual users are not subject to per-user rate limits, the platform enforces global rate limits to protect system stability. If you receive a REQUESTS_EXCEEDED error, lower your request frequency or implement retry logic with exponential backoff.
5. Confirm Endpoint Availability
A ROUTE_NOT_FOUND error indicates a typo in the URL or the use of an endpoint not available in the current API version.
When to contact us for support
If you encounter errors in the 5xx range or errors that persist after verifying your token, permissions, query structure, and rate limits, contact the Onderwijsloket technical team. Include the full error response (excluding sensitive tokens) and the timestamp of the request to help us trace the issue in our monitoring tools.