Skip to main content

Error Codes Reference

This page is a comprehensive reference for the error codes returned by the Lumar GraphQL API. Use the extensions.code field in error responses to identify errors programmatically and determine the correct handling strategy.

Error response structure

GraphQL errors appear in the errors array of the response, alongside any partial data that was successfully resolved. Each error object contains:

  • message — a human-readable description of the error
  • extensions.code — a machine-readable error code to use for programmatic handling
  • path — which part of the query the error relates to

Additional properties may appear in extensions depending on the error type.

{
"data": { "getProject": null },
"errors": [
{
"message": "Entity not found",
"extensions": {
"code": "ENTITY_NOT_FOUND"
},
"path": ["getProject"]
}
]
}
note

Always inspect both data and errors in every response. GraphQL can return partial data — some fields may resolve successfully while others produce errors. A non-null data object does not mean the request fully succeeded.

Authentication and authorization errors

These errors indicate a problem with the credentials or permissions used to make the request.

CodeWhen it occursHow to handle
UNAUTHENTICATEDNo auth token provided, token has expired, or token is invalidRe-authenticate using createSessionUsingUserKey; redirect to login if in a UI context
UNAUTHORIZEDThe authenticated user does not have the required role or permission for this operationCheck your account role and permissions with your account administrator
INSUFFICIENT_PERMISSIONSThe user's role does not grant access to the requested resource or operationCheck your role and permissions with your account administrator
FORBIDDENThe action is explicitly forbidden for this account or roleCheck whether the resource or operation requires elevated permissions
INCORRECT_USER_KEY_ID_OR_SECRETThe user key ID or secret provided for authentication is incorrectVerify your key credentials; generate a new user key if needed
tip

Use UNAUTHENTICATED to trigger a re-authentication flow and UNAUTHORIZED or FORBIDDEN to show a permissions error to the user — these are distinct situations that warrant different responses in your application.

Resource errors

These errors relate to the resources being queried or mutated.

CodeWhen it occursHow to handle
ENTITY_NOT_FOUNDThe resource with the given ID does not exist or is not accessible to this accountVerify the ID is correct; check whether the resource has been deleted
CONFLICTA duplicate resource would be created (e.g. a project name that is already taken in this account)Use a different name or value; query existing resources first if needed

Validation errors

These errors indicate the request inputs did not pass validation.

CodeWhen it occursHow to handle
BAD_USER_INPUTInput fails schema validation — wrong type, missing required field, or malformed valueRead the message field for details about which input failed; compare against the schema
ARGUMENT_VALIDATION_ERRORA resolver argument failed type-graphql validation rulesRead the message field for specific details about the validation failure
tip

When you receive BAD_USER_INPUT or ARGUMENT_VALIDATION_ERROR, read the message field carefully. It explains the constraint that was violated and which input is at fault.

Rate limit and quota errors

These errors indicate the request was rejected due to usage limits.

CodeWhen it occursHow to handle
TOO_MANY_REQUESTSToo many requests have been made within the current time windowBack off and retry using exponential backoff; see Rate Limits
ACCOUNT_CREDITS_DEPLETEDThe account has run out of crawl creditsUpgrade your plan or contact support to increase limits

Pagination errors

CodeWhen it occursHow to handle
EXCESSIVE_PAGINATIONThe pagination depth or page size exceeds the allowed limitReduce the first or last value; use cursor-based pagination with smaller pages

Server errors

These errors indicate an unexpected failure on the server side.

CodeWhen it occursHow to handle
SOMETHING_WENT_WRONGAn unexpected server-side error occurredRetry with exponential backoff; if the error persists, contact support and include the operation name

Handling multiple errors

A single GraphQL request can return multiple errors — one for each field or input that failed. Inspect the full errors array rather than stopping at the first entry.

if (response.errors?.length) {
const messages = [...new Set(response.errors.map(e => e.message))].join(", ");
const codes = response.errors.map(e => e.extensions?.code);

if (codes.includes("UNAUTHENTICATED")) {
// Redirect to login or trigger token refresh
} else {
// Surface the error message to the user
showError(messages);
}
}
note

Using a Set when collecting messages deduplicates repeated errors, which is common when the same validation rule fails across multiple fields.

Network errors vs GraphQL errors

Not all failures produce a GraphQL error response. It is important to distinguish between the two:

  • Network error — the request failed at the transport level (connection refused, DNS failure, timeout). No response body is available.
  • HTTP error — some errors return a non-200 status code (e.g. HTTP 400 for malformed requests, HTTP 401 for invalid credentials). The response body may or may not contain an errors array. Always attempt to parse the response body even for non-200 responses.
  • GraphQL error — the HTTP response is 200 OK but the errors array is present. The operation failed at the field level. The data object may still contain partial results for fields that did resolve successfully.

Always check both response.ok (or the HTTP status code) and response.errors in your client code.

tip

Treat a 200 OK response with a non-empty errors array as a partial failure. Do not assume success just because the HTTP status was 200.

Retrying safely

Not all errors are safe to retry. Retrying a request that will always fail wastes quota and delays your application.

CodeSafe to retry?Notes
SOMETHING_WENT_WRONGYesUse exponential backoff with a cap
TOO_MANY_REQUESTSYesWait for the rate limit window to reset before retrying
UNAUTHENTICATEDYes, after token refreshRefresh or re-obtain the session token first
ENTITY_NOT_FOUNDNoFix the resource ID before retrying
UNAUTHORIZEDNoCheck permissions or token validity
INSUFFICIENT_PERMISSIONSNoA permissions change is required before retrying
FORBIDDENNoA permissions change is required before retrying
BAD_USER_INPUTNoFix the input validation error before retrying
ARGUMENT_VALIDATION_ERRORNoFix the argument that failed validation before retrying
EXCESSIVE_PAGINATIONNoReduce page size before retrying
ACCOUNT_CREDITS_DEPLETEDNoA plan upgrade or credit top-up is required
warning

Blindly retrying non-retryable errors can consume your rate limit budget and result in TOO_MANY_REQUESTS errors on top of the original failure.