Skip to main content

Errors and API limits

The API reports a failure in one of two places. A request Owlie cannot accept at all, because the credential is bad or the body is too large, answers with an HTTP error status. A request Owlie accepts and then refuses, because of a missing permission or invalid input, answers status 200 with an errors array. A client has to check both.

Failures before the operation runs​

StatusBodyCause
401{ "message": "Not Authorized" }No API key, an unknown, revoked or expired key, a key from another organization, or a disabled service account.
413{ "errors": [{ "message": "...", "extensions": { "code": "PAYLOAD_TOO_LARGE", "status": 413 } }] }The request body is larger than 6 MB.

Neither is worth retrying unchanged. For a 401, check the key and the host name: How to use the API lists what Owlie checks.

Errors in the response​

A refused operation adds an entry to errors:

{
"errors": [
{
"message": "Not authorized for identity.read",
"extensions": { "code": "OwlieError", "status": 403 }
}
],
"data": null
}
FieldHolds
messageWhat failed, written for the caller. Show or log it, but don't match on its text.
extensions.statusThe HTTP status the failure stands for. Branch on this first.
extensions.codeThe kind of error. Specific failures have their own code, and the rest carry a general one.
extensions.retryablePresent on some errors: true when sending the same operation again can succeed.
extensions.contextPresent on some errors: details a client can act on, such as the list of validation issues.

Owlie never puts internal details in an error. A failure it did not expect answers "message": "Internal Error" with "code": "INTERNAL_SERVER_ERROR" and "status": 500.

Common errors​

statuscodeMeaningWhat to do
400ValidationErrorAn argument or input is invalid. extensions.context.issues lists each problem with code, message and path when there are several.Fix the input. Sending it again unchanged fails again.
400OPERATION_TOO_COMPLEXThe document exceeds a shape limit. extensions.measure, limit and actual say which one.Select fewer fields or a smaller page (limits).
403OwlieErrorThe service account lacks a permission. The message names it: Not authorized for resource.read.Assign a role that grants it, or stop calling the field.
404NotFoundErrorThe object an operation acts on does not exist in this organization.Check the identifier.
409LimitExceededErrorThe change would pass a usage limit. extensions.context holds the limit's key, the current usage and the limit.See usage and limits.
409AMBIGUOUS_IDENTITY_EMAILAn identity lookup by email matched more than one identity.Look the identity up by id.
409CANCELLATION_TOO_LATEA provisioning operation had already started when you tried to cancel it.Read the operation to see its outcome.
429variesThe operation limits how often it can run, and you passed that rate.Wait, then retry.
500INTERNAL_SERVER_ERROROwlie failed while running the operation.Retry a query. For a mutation, read the object first to see whether the change was made.

Some operations are reserved for a signed-in person, billing among them. An API key gets a 403 for those whatever roles its service account has.

A lookup of one object that does not exist, or that the caller may not see, often answers null with no error: identity(id: ...) returns null for an unknown id. Check for null before reading the result.

Errors from GraphQL itself​

A document that does not parse, selects a field that does not exist, or passes a variable of the wrong type fails before any field runs. Those errors carry the GraphQL message, the position in the document and a GraphQL code (GRAPHQL_PARSE_FAILED or GRAPHQL_VALIDATION_FAILED), and no extensions.status. Sending query { myProfile { displayName } } answers:

{
"errors": [
{
"message": "Cannot query field \"displayName\" on type \"Identity\". Did you mean \"display_name\" or \"middle_name\"?",
"locations": [{ "line": 1, "column": 21 }],
"extensions": { "code": "GRAPHQL_VALIDATION_FAILED" }
}
]
}

Depending on the Accept header you send, the HTTP status for these is 200 or 400. The body is the same either way, so read errors.

Partial results​

GraphQL can return data and errors together: a field that fails becomes null, and the fields around it still return. When a field the schema marks as required fails, the null moves up to the nearest field that may be empty, which can be data itself. Use each error's path to see which field it belongs to.

What to retry​

  • Retry when extensions.retryable is true, or when extensions.status is 429 or 500 and above. Wait between attempts, and longer each time.
  • Retry a network failure or a timeout for a query. For a mutation, you don't know whether Owlie applied it: read the object before sending the mutation again.
  • Don't retry 400, 401, 403 or 404. The same request gets the same answer.
  • A 409 means the object's state does not allow the operation. Read it again and decide. Don't loop.

Submitting work is different from the work finishing. createRequest returning a request number means the request exists, and createBulkJob returning a job means the job is queued. Read the request or the job to learn what happened.

Page-size limits​

LimitValue
Default page, when you send neither first nor last50 items
Largest first or last500. A larger value is refused with a ValidationError.
resourceAssignments, requestableCatalogAt most 100 items a page. A larger first returns 100.
first together with last, or after with beforeRefused.

A connection never reports a total. Count without paging names the fields that count.

Document limits​

Owlie measures each operation before running it and refuses one that exceeds a limit with OPERATION_TOO_COMPLEX:

MeasureLimitCounts
depth12How deep the selection nests. A root field is depth 1.
aliases32Aliased fields.
selections2,000Fields and fragment spreads, with every fragment expanded where it is used.
cost500,000Each field costs 1, multiplied by the page sizes of the lists it sits inside.

For cost, a list with a page-size argument multiplies everything under it by that size (50 when you send none), and a list without one multiplies by 2. So this document costs 501: identities is 1, data and id are 100 each, and groups and its id are 100 and 200.

query {
identities(first: 100) {
data {
id
groups {
id
}
}
}
}

Nesting one page inside another multiplies quickly: two nested pages of 500 already cost 250,000 a field. Ask for nested lists in separate requests, or with smaller pages.

Other limits​

LimitValue
Request body6 MB
Identities in one bulk job run25,000 (bulk updates)
Form data on one requested resource128 KB

Plan limits on the number of identities, API keys and other objects are separate from these: usage and limits describes them.

In the TypeScript SDK​

The TypeScript SDK turns every failure into one OwlieSDKError, so you branch on error.code instead of reading the response:

codeRaised for
AUTHENTICATION_ERRORStatus 401
AUTHORIZATION_ERRORStatus 403
VALIDATION_ERRORStatus 400 or 422
NOT_FOUND_ERRORStatus 404
RATE_LIMIT_ERRORStatus 429
LIMIT_EXCEEDEDAn error whose code is LimitExceededError
CANCELLATION_TOO_LATEThe error of the same code
AMBIGUOUS_IDENTITY_EMAILThe error of the same code
NETWORK_ERRORThe request did not complete. retryable is true.
GRAPHQL_ERRORA GraphQL error with no status, such as a document that does not validate
UNKNOWN_ERRORAnything else, including a 500

The SDK reads the status from extensions.status, so a refusal that arrives with HTTP 200 still becomes AUTHORIZATION_ERROR. The error also carries status, operation, requestId, retryable and raw (the original errors). retryable follows extensions.retryable when Owlie sends it, and otherwise is true for statuses 408, 409, 425, 429 and 500 and above. The SDK does not retry for you.

SDK paging has its own limits, separate from the API's:

  • page_size defaults to 100.
  • A value above 500 is lowered to 500.
  • A value that is not a positive whole number throws before any request.