API Error Codes
A failed request to the Routebase public API returns a problem details body as RFC 9457 defines it, with the content type application/problem+json. Handle errors by the code field, because the wording of detail can change.
The SCIM endpoints are the exception. They answer with the SCIM error envelope and the content type application/scim+json, as RFC 7644 defines it.
The error body
{
"type": "https://httpstatuses.io/403",
"title": "Forbidden",
"status": 403,
"detail": "API key does not have the required scope: tests:execute",
"instance": "/api/cli/run",
"traceId": "0HNQ3BGCDO85I:00000021",
"code": "API_KEY_SCOPE_DENIED"
}
| Field | Content |
|---|---|
type |
A URI for the HTTP status |
title |
A short summary of the HTTP status |
status |
The HTTP status code |
detail |
A message for people, which can be reworded |
instance |
The path of the request |
traceId |
The identifier of the request, which support needs to find it |
code |
The stable, machine readable error code |
Some codes add fields of their own, and the tables below name them. A response without code is one of the cases that the last table on this page lists.
Codes on every operation
These codes can come from any operation, because the API checks the request before the operation runs.
| Status | Code | Cause | What to do |
|---|---|---|---|
| 400 | VALIDATION_FAILED |
One or more fields failed validation. The errors field maps each field to its messages. |
Fix the listed fields and send the request again. |
| 400 | INVALID_ENUM_VALUE |
A field holds a value outside its allowed set. The field and allowedValues fields name both. |
Send one of the allowed values. |
| 400 | INVALID_ARGUMENT |
A value in the request is invalid or missing. | Compare the request with the operation in the reference. |
| 403 | API_KEY_SCOPE_DENIED |
The key lacks the permission for this operation, or the operation is organization level and the key is scoped. | Add the permission to the key, or use a key that has it. |
| 403 | API_KEY_PROJECT_SCOPE_DENIED |
The key is restricted to another project. | Extend the restriction to this project, or use another key. |
| 403 | INSUFFICIENT_PERMISSIONS |
The role of the user behind the key lacks the permission. | Give that user a role with the permission. |
| 403 | NOT_A_MEMBER |
The user behind the key isn't a member of the organization. | Create a key as a current member. |
| 403 | PROJECT_ACCESS_DENIED |
The project ID doesn't exist in your organization, or the user behind the key has no team access to it. | Check the project ID and the team access of that user. |
| 403 | PROJECT_LOCKED |
The project is read-only because the plan of your organization no longer covers it. Reads keep working. | Upgrade the plan to resume writing. |
| 404 | NOT_FOUND or a code ending in _NOT_FOUND |
The resource doesn't exist, or it belongs to another organization or project. Both cases answer the same way, so foreign identifiers can't be probed. | Check the identifier, for example SPEC_NOT_FOUND points at the spec ID. |
| 409 | CONCURRENCY_CONFLICT |
The resource changed since you read it. | Read it again, reapply your change and send the new rowVersion. |
Codes of single operations
| Operation | Status | Code | Cause | What to do |
|---|---|---|---|---|
promoteSpecVersion |
409 | VERSION_DEPRECATED |
The version is deprecated. | Promote a version that isn't deprecated. |
promoteSpecVersion |
409 | VERSION_NOT_PUBLISHABLE |
The target environment freezes versions, and the version is neither a draft nor in review. | Promote a draft or a version in review. |
promoteSpecVersion |
409 | STYLE_GUIDE_ERRORS |
The spec violates error level rules of the style guide, and the style guide is enforced on publish. detail lists up to ten violations. |
Fix the violations and promote again. |
promoteSpecVersion |
409 | IMPACT_NOT_ACKNOWLEDGED |
Other services depend on this spec, and the organization requires an acknowledged impact. | Send impactAcknowledged set to true. |
cliDownloadReport |
409 | TEST_RUN_IN_PROGRESS |
The run is still pending or running. | Poll the run status and download the report once the run has finished. |
enqueueScanRun |
402 | FEATURE_NOT_AVAILABLE |
The plan of your organization doesn't include security scanning. The featureFlag and requiredTier fields name the feature and the plan it needs. |
Upgrade to the plan in requiredTier. |
createDocPage |
402 | LIMIT_EXCEEDED |
The organization has reached the custom page limit of its plan. The limitType, currentUsage, maxAllowed and requiredTier fields describe the limit. |
Remove a custom page or upgrade to the plan in requiredTier. |
The eight operations that accept an Idempotency-Key add the codes IDEMPOTENCY_KEY_INVALID, IDEMPOTENCY_KEY_IN_PROGRESS, IDEMPOTENCY_KEY_REUSED and IDEMPOTENCY_RESPONSE_NOT_STORED. Idempotency Keys explains each of them.
Responses without a code
| Status | Cause | What to do |
|---|---|---|
| 400 | The request body is not valid JSON, or a value has the wrong type. | Check the body against the schema in the reference. |
| 401 | The key is missing, unknown, revoked or expired, or a US organization sent the request without X-RB-Region: us. |
Follow API Authentication. |
| 429 | The rate limit was exceeded. The retryAfter field and the Retry-After header hold the seconds to wait. |
Wait that long before you retry, as Rate Limits describes. |
| 500 | An unexpected error occurred on the server. | Retry later, and send the traceId to support if the error persists. |
Related
- API Authentication explains the 401 and 403 responses in detail.
- Rate Limits explains the 429 response and the retry rule.
- Idempotency Keys explains the codes of a repeated write.
- API Reference lists the responses of each operation.