Error Codes

The Deliverty Hub API uses standard HTTP status codes combined with structured error responses to communicate problems.

Error Response Format

All error responses follow this JSON structure:

{
  "statusCode": 400,
  "message": "Validation failed",
  "error": "Bad Request",
  "details": [
    {
      "field": "email",
      "message": "email must be a valid email address"
    }
  ]
}

HTTP Status Codes

CodeMeaningWhen It Happens
200OKRequest succeeded.
201CreatedResource created successfully.
400Bad RequestValidation error, missing fields, or malformed body.
401UnauthorizedMissing or invalid x-api-key header.
403ForbiddenValid key but insufficient permissions for the action.
404Not FoundResource doesn't exist or is not in your organization.
409ConflictDuplicate resource or invalid state transition (e.g., completing a cancelled task).
422Unprocessable EntitySemantic error — data is valid JSON but doesn't make business sense.
429Too Many RequestsRate limit exceeded. See Rate Limits.
500Internal Server ErrorUnexpected server error. Contact support if persistent.

Common Error Scenarios

Authentication Errors

ScenarioStatusMessage
Missing API key header401API key is required
Invalid API key401Invalid API key
Channel is suspended403Channel is suspended
Channel is inactive403Channel is inactive

Task Errors

ScenarioStatusMessage
Task not found404Task not found
Invalid status transition409Cannot transition from {current} to {target}
Missing required fields400Validation failed with field details
Invalid task type400taskType must be one of: job, pickup, delivery, cash_collection, cash_drop

Webhook Errors

ScenarioStatusMessage
Invalid URL format400url must be a valid URL
No events specified400At least one event is required
Subscription not found404Webhook subscription not found
Handling Errors

Always check the details array in validation errors (400) — it tells you exactly which fields failed and why. For 5xx errors, retry with exponential backoff.