Skip to content
Thyme Docs

API Errors & Retries

Check the HTTP status and code field. Treat error text as an explanation for humans, not a value to match in client logic. Management responses carry an X-Request-Id header; error bodies may also include requestId.

{
  "error": "API key is bound to a different workspace",
  "code": "workspace_mismatch",
  "requestId": "request-id"
}

Common failures

StatusCodeRecovery
400bad_request, invalid_requestCorrect the request body, IDs, query parameters, or schema.
400workspace_required, invalid_workspaceSupply a valid workspace for an unbound key.
400 or 403workspace_mismatchAlign the header/query workspace with the credential's bound workspace.
401missing_api_key, invalid_api_keySupply a valid bearer key; log in again if revoked or expired.
403insufficient_scope, forbiddenCheck key scopes, active membership, and owner/admin role for mutations.
403quota_exceededCheck the workspace's active plan and usage limits.
402insufficient_balanceFund the applicable gas balance, then retry after checking execution state.
404not_foundCheck the deployment, workspace, resource ID, and route.
409conflictResolve the resource's current state or storage lock before retrying.
409permissions_not_coveredResolve the function's permission requirements against its profile.
409version_tag_conflictChoose another immutable release tag.
409idempotency_conflictUse a new key for a different intended operation.
409idempotency_in_progressWait for retryAfterMs, then retry with the same key and body.
400invalid_idempotency_keyUse a non-empty key of at most 128 characters.
413payload_too_largeKeep API storage reads and writes within 16 MiB.
500internal_errorSave the request ID, check resource state, and contact the deployment operator if it persists.

The upload endpoint also reports archive, checksum, schema, and manifest failures. Rebuild with the current CLI instead of editing the uploaded ZIP by hand.

Permission refusals

An executable binds a function release to concrete args and an execution profile. When the required permissions cannot be covered, binding mutations can fail with 409 permissions_not_covered. Additional message, status, missing, and reasons fields describe the specific failure.

Starting a real run queues work. The execution's later permission check can fail after the HTTP request has succeeded, so inspect the run record and logs too.

Review the manifest, args, and the profile's on-chain role. Extending a role requires its owner. Changing an API key's scopes does not change on-chain permissions.

Function replacement failures

Pause the executable before switching its function. A successful 202 response means the rebuild was accepted, not completed. Poll the executable for pendingFunctionSwitch and lastFunctionSwitchError. If replacement fails, the previous function and sandbox remain available. Resolve the recorded error before requesting a new switch. See release management.

Retry rules

  1. Generate one idempotency key per intended mutation and target resource; retain it across transport retries. Include the resource ID in the key: some action fingerprints use the route template without the target ID. A different resource or change needs a different key.
  2. For a timeout or connection loss, retry the same request with the same key. A replay returns Idempotency-Replayed: true.
  3. For idempotency_in_progress, wait for the response's retryAfterMs.
  4. Fix authentication, validation, permissions, and state errors before trying again. Blind retries will not fix them.
  5. After the 24-hour replay window, inspect the resource before repeating a mutation whose first outcome is unknown.

Idempotency protects management requests; it is not a blanket guarantee that every external effect is exactly once. Uploads deduplicate by immutable tag and archive checksum. Executable webhooks have their own credentials and semantics; see webhooks.