Arke
Reference

Error Codes

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

Error Response Format

All errors return a JSON body:

{
  "error": "Error description",
  "status": 409,
  "code": "CAS_ERROR"
}

Error Types

ErrorStatusCodeWhen
CASError409CAS_ERRORexpected_cid 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.
ForbiddenError403FORBIDDENValid authentication but insufficient permissions for the requested action.
UnauthorizedError401UNAUTHORIZEDMissing or invalid authentication token/key.
StorageError503STORAGE_ERRORR2 or D1 backend is temporarily unavailable.

Handling CAS Conflicts

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

{
  "error": "CAS conflict",
  "expected": "bafyreig...",
  "actual": "bafyreih...",
  "status": 409
}

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 expected_cid

Validation Errors

Validation errors include details about which fields failed:

{
  "error": "Validation failed",
  "status": 400,
  "details": [
    { "path": "properties.name", "message": "Required" }
  ]
}

On this page