Errors

ReferenceUpdated February 18, 2025

Errors

API errors return a JSON body with at least error (code) and message (human-readable). Some responses include an optional detail field.


HTTP status codes

StatusMeaning
200Success.
202Accepted (async job accepted; e.g. generate-batch).
400Bad Request – invalid body, missing or invalid fields.
401Unauthorized – missing or invalid API key.
402Payment Required – insufficient credits.
403Forbidden – resource exists but is not in this workspace.
404Not Found – resource not found or not in this workspace.
409Conflict – e.g. list not yet completed (NOT_READY; poll list status first).
429Too Many Requests – workspace concurrent job limit reached (generate-batch). Try again later.
500Internal Server Error – server-side failure.

Error body format

{
  "error": "ERROR_CODE",
  "message": "Human-readable description."
}

Optional: "detail": "Additional technical detail".


Common error codes

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key. Send Authorization: Bearer <key> or X-API-Key: <key>.
BAD_REQUEST400Invalid JSON, missing required field (e.g. lead, leads), or invalid value (e.g. lead missing email).
INSUFFICIENT_CREDITS402Not enough credits for this workspace. Upgrade or wait for reset.
FORBIDDEN403Campaign (or list) is not in the workspace tied to your API key.
NOT_FOUND404Campaign or list not found, or not in this workspace.
NOT_READY409List not yet completed (e.g. export called too early). Poll GET /lists/:id first.
WORKSPACE_LIMIT429Too many concurrent batch jobs in this workspace. Retry later.
INTERNAL_ERROR500Server error. Retry with backoff; contact support if it persists.

Example error response

{
  "error": "INSUFFICIENT_CREDITS",
  "message": "You have 0 credits remaining. Please upgrade your plan."
}

Client guidance

  • 401: Check that the API key is correct and sent in Authorization: Bearer <key> or X-API-Key.
  • 402: Check usage/credits in the MachFive app; upgrade or wait for quota reset.
  • 404: Verify the campaign or list ID and that it belongs to the workspace of the API key.
  • 500: Retry with exponential backoff; if repeated, contact support with request ID or timestamp if available.