Errors

The ToHuman API uses conventional HTTP response codes to indicate the success or failure of a request. Codes in the 2xx range indicate success, codes in the 4xx range indicate a client error, and codes in the 5xx range indicate a server error.

Error codes

Status Description
200 Request succeeded.
201 Resource created successfully.
401 Unauthorized — missing or invalid API token.
403 Forbidden — your token doesn't have permission for this action.
404 Not found — the requested resource doesn't exist.
422 Unprocessable content — the request body is invalid or missing required fields.
429 Too many requests — you've exceeded the rate limit.
500 Internal server error — something went wrong on our end.

Error response format

When an error occurs, the API returns a JSON response with an error field describing the issue:

422 Unprocessable Content
{
  "error": "Content is required."
}
401 Unauthorized
{
  "error": "Unauthorized"
}

Validation errors for specific fields may include multiple messages:

422 Validation error
{
  "error": "Content must be at least 50 characters."
}