Skip to main content
Errors are always returned as an array, regardless of how many occurred, so your error handling logic only needs one code path.

Error structure

{
  "errors": [
    {
      "type": "request",
      "code": "input_missing",
      "field": "name",
      "message": "`name` is required and cannot be empty."
    }
  ],
  "request_id": "req_a1b2c3d4..."
}
FieldDescription
typeError category. Determines the class of failure.
codeMachine-readable error code. Use this for programmatic handling.
fieldThe input field that caused the error, when applicable.
messageHuman-readable explanation. Do not rely on this for logic.
request_idUnique identifier for the request. Send this to Deck support when troubleshooting.

Handling errors

Use type and code for branching logic. The message field is for logging and display only. It may change.
if (error.type === "auth" && error.code === "auth_invalid") {
  promptUserToReAuthenticate();
}

if (error.type === "interaction" && error.code === "interaction_timeout") {
  promptUserForNewMfaCode();
}

if (error.type === "rate_limit") {
  retryWithBackoff();
}

Error types

Errors are grouped as Deck Errors, Request Errors, or Source Errors. Only Deck Errors count against a task’s success rate.
TypeWhen it occursGroup
apiDeck platform failureDeck Error
idempotencyIdempotency key errorRequest Error
sessionSession could not be establishedDeck Error
rate_limitToo many requestsRequest Error
sourceExternal source failure or unavailabilitySource Error
requestInvalid input, missing fields, or unsupported actionRequest Error
authCredential or authentication method failureRequest Error
interactionMFA or interaction timeoutRequest Error
taskTask execution failureDeck Error
storageFile storage or extraction failureDeck Error
organizationPlan, billing, or entitlement state blocks the request. Retrying will not help; the customer must upgrade, take billing action, or wait for the next billing cycle.Request Error

Success rate

Success rate is the share of task runs that completed successfully over a given time period. Only Deck Errors count against it.
  • Runs that succeed count as successes.
  • Runs that fail with a Deck Error count as failures.
  • Runs that fail with a Request Error or Source Error are excluded from the calculation, since it was impossible for Deck to complete the task.
success_rate = successes / (successes + deck_error_failures)

Error codes by type

api

CodeDescription
api_errorPlatform error
timeoutPlatform timed out
endpoint_deprecatedEndpoint is deprecated and pending removal

idempotency

CodeDescription
idempotency_errorSame key, different parameters
idempotency_key_errorIdempotency key must be at most 256 characters

session

CodeDescription
timeoutSession could not start in time

rate_limit

CodeDescription
rate_limit_exceededToo many requests
session_limit_exceededAgent sandbox limit exceeded

source

CodeDescription
source_errorExternal source failure
source_not_availableSource is down or unreachable
source_blockedSource is on a blocklist

request

These are the most common errors. They indicate a problem with your request.
CodeDescription
input_invalidValidation failed
input_type_invalidWrong type
input_format_invalidWrong format
input_missingRequired field missing
input_too_longExceeds max length
input_too_shortBelow min length
input_duplicateMust be unique
query_param_invalidUnsupported query parameter
cursor_invalidPagination cursor is invalid or expired
resource_not_foundResource does not exist
resource_not_readyResource is not in a usable state
api_key_invalidInvalid API key
token_invalidInvalid token
credential_not_foundCredential does not exist
source_not_foundSource does not exist
action_not_supportedNot supported for this source
task_not_foundTask does not exist
task_not_supportedTask not supported for this source
interaction_requiredBlocked until pending interaction is resolved
interaction_input_invalidSubmitted interaction data is invalid
interaction_not_requiredNo interaction was requested
interaction_not_foundInteraction does not exist
storage_not_foundStorage item does not exist
attachment_invalidInput file failed its security scan. Returned asynchronously on the task run.

auth

CodeDescription
auth_method_not_supportedAuth method not supported for this source
auth_not_supportedSource does not require authentication
auth_requiredAuthentication is required
auth_invalidCredentials are wrong
password_reset_requiredSource is forcing a password reset
account_lockedAccount is locked at the source

interaction

CodeDescription
interaction_timeoutInteraction window expired

task

CodeDescription
blockedBlocked by antibot
task_failedTask execution failed
task_result_unknownCompleted but result could not be determined
timeoutExecution timed out

storage

CodeDescription
timeoutStorage request timed out
extraction_failedDocument extraction failed
extraction_timeoutExtraction timed out

organization

CodeDescription
quota_exceededPlan quota exceeded
task_length_exceededTask exceeded the maximum length allowed by the plan
feature_not_availableFeature is not available on the current plan
plan_inactiveSubscription is past due or canceled

Errors on resource objects

When a task run fails, the errors array is populated on the run object itself. This is the same structure as API-level errors.
{
  "id": "trun_a1b2c3d4...",
  "object": "task_run",
  "status": "failed",
  "result": "failure",
  "task_id": "task_a1b2c3d4...",
  "credential_id": "cred_a1b2c3d4...",
  "session_id": "sess_x9y8z7...",
  "agent_id": "agt_a1b2c3d4...",
  "source_id": "src_a1b2c3d4...",
  "runtime_ms": 12453,
  "output": null,
  "errors": [
    {
      "type": "source",
      "code": "source_blocked",
      "message": "Source blocked the credential."
    }
  ],
  "interaction": null,
  "created_at": "2025-01-15T09:30:00Z",
  "updated_at": "2025-01-15T09:31:15Z",
  "request_id": "req_a1b2c3d4..."
}

Request IDs

Every response includes a request_id. When contacting Deck support, include this value to speed up troubleshooting.