Arke
Reference

Error Codes

HTTP error codes and error types returned by the Arke API.

Error Response Format

All errors return a JSON body with the following structure:

{
  "error": "CAS_FAILURE",
  "message": "CAS failure: expected tip bafyreig..., got bafyreih..."
}

Errors may include additional context in a details field:

{
  "error": "NOT_FOUND",
  "message": "Entity not found: 01JEXAMPLE123456789012345",
  "details": {
    "resource": "Entity",
    "identifier": "01JEXAMPLE123456789012345"
  }
}

Error Types

ErrorStatusCodeWhen
CASError409CAS_FAILUREexpect_tip doesn't match the current tip. Another update occurred since you last read the entity.
NotFoundError404NOT_FOUNDEntity, collection, or resource doesn't exist.
ValidationError400VALIDATION_ERRORRequest body or parameters are invalid.
ConflictError409CONFLICTResource already exists (e.g., duplicate creation).
ForbiddenError403FORBIDDENValid authentication but insufficient permissions for the requested action.
UnauthorizedError401UNAUTHORIZEDMissing or invalid authentication token/key.
StorageError503STORAGE_ERRORR2 or D1 backend is temporarily unavailable.
DurableObjectError429DO_INFRASTRUCTURE_ERRORInfrastructure overloaded. Retry after the duration specified in the Retry-After header.
InternalError500INTERNAL_ERRORAn unexpected server error occurred.

Handling CAS Conflicts

The most common error you'll encounter is CASError (409). The response includes both CIDs in the details field:

{
  "error": "CAS_FAILURE",
  "message": "CAS failure: expected tip bafyreig..., got bafyreih...",
  "details": {
    "expect": "bafyreig...",
    "actual": "bafyreih..."
  }
}

Recovery:

  1. Fetch the entity again (the actual CID is now the tip)
  2. Reapply your changes to the new version
  3. Retry the update with the new expect_tip

Validation Errors

Validation errors include details about which fields failed:

{
  "error": "VALIDATION_ERROR",
  "message": "Validation failed",
  "details": {
    "path": "properties.name",
    "message": "Required"
  }
}

Infrastructure Errors

When the Durable Object infrastructure is overloaded, the API returns a 429 status with a Retry-After header:

{
  "error": "DO_INFRASTRUCTURE_ERROR",
  "message": "Infrastructure overloaded during update for entity 01JEXAMPLE...",
  "details": {
    "operation": "update",
    "entityId": "01JEXAMPLE123456789012345",
    "original_error": "Durable Object subrequest failed"
  }
}

Check the Retry-After header (default: 5 seconds) before retrying.

On this page