Skip to main content

Error Responses

All API errors return a consistent JSON envelope so your code can handle them uniformly regardless of which endpoint produced the error.

Error Shape

Every error response uses the same structure:

{
"error": {
"code": "error_code_here",
"message": "Human-readable description of what went wrong.",
"request_id": "01JAXBKM3N4P5Q6R7S8T9UVWXY"
}
}
FieldTypeDescription
codestringMachine-readable error code (see table below)
messagestringHuman-readable description, suitable for logging but not for end users
request_idstringUnique ULID for tracing this request

The request_id is generated by the authentication middleware for every /v1/* request. Include it when contacting support.

Error Code Reference

HTTP StatusCodeDescriptionEndpoint(s)
400invalid_requestRequest validation failed — missing required fields or out-of-range valuesPOST /v1/jobs, POST /v1/workers/ack
400invalid_cron_expressionCron expression could not be parsed by the Cronos libraryPUT /v1/recurring/{id}
400invalid_timezoneThe timezone string is not a valid IANA timezone identifierPUT /v1/recurring/{id}
401unauthorizedMissing, malformed, or invalid API keyAll /v1/* endpoints
404job_not_foundJob ID does not exist or belongs to a different projectGET /v1/jobs/{id}, POST cancel, POST retry, POST ack, POST heartbeat
404recurring_job_not_foundRecurring job ID does not exist for this projectDELETE /v1/recurring/{id}
409idempotency_conflictA job with the same idempotency_key already existsPOST /v1/jobs
409invalid_stateThe operation is not valid for the job's current statePOST cancel, POST retry, POST ack, POST heartbeat
409worker_mismatchThe worker_id does not match the worker that claimed the jobPOST /v1/workers/ack, POST /v1/workers/heartbeat
409parent_terminalParent job is in a terminal state (cancelled or dead_letter)POST /v1/jobs (continuations)
409recurring_job_type_conflictA recurring job with the same job_type already exists under a different IDPUT /v1/recurring/{id}
422parent_not_foundThe parent_job_id does not reference an existing jobPOST /v1/jobs (continuations)
429rate_limit_exceededHourly request limit exhausted for this projectAll /v1/* endpoints
500internal_errorUnhandled server error — safe to retry with backoffAll endpoints

Validation Errors (400)

Validation is performed by FluentValidation before the request reaches the endpoint handler. When validation fails, the API returns a 400 with code: "invalid_request" and the message contains the first validation failure.

Create Job Validation

FieldRuleError message
job_typeRequired, non-empty"job_type is required."
job_typeMax 500 characters"job_type must not exceed 500 characters."
payloadRequired, non-null JSON"payload is required."
max_attempts1–100 (when provided)"max_attempts must be between 1 and 100."
timeout_seconds1–86,400 (when provided)"timeout_seconds must be between 1 and 86400."
queueMax 100 characters (when provided)"queue must not exceed 100 characters."
idempotency_keyMax 200 characters (when provided)"idempotency_key must not exceed 200 characters."
parent_job_idMax 36 characters (when provided)"parent_job_id must not exceed 36 characters."

Ack Request Validation

FieldRuleError message
job_idRequired, non-empty"job_id is required."
worker_idRequired, non-empty"worker_id is required."
statusMust be "succeeded" or "failed""status must be 'succeeded' or 'failed'."

Example validation error

{
"error": {
"code": "invalid_request",
"message": "job_type is required.",
"request_id": "01JAXBKM3N4P5Q6R7S8T9UVWXY"
}
}

Handling Errors in Code

When using the Zeridion.Flare SDK, API errors are mapped to typed exceptions:

try
{
await jobClient.EnqueueAsync<SendWelcomeEmail>(new { Email = "user@example.com" });
}
catch (FlareAuthenticationException)
{
// 401 — invalid or expired API key
}
catch (FlareRateLimitException ex)
{
// 429 — wait until rate limit resets
if (ex.ResetAt.HasValue)
{
var delay = ex.ResetAt.Value - DateTimeOffset.UtcNow;
if (delay > TimeSpan.Zero)
await Task.Delay(delay);
}
}
catch (FlareConflictException)
{
// 409 — idempotency conflict, state transition error, etc.
}
catch (FlareNotFoundException)
{
// 404 — job or recurring job not found
}
catch (FlareApiException ex)
{
// Base class for all API errors
Console.WriteLine($"Error {ex.StatusCode}: {ex.ErrorCode}{ex.Message}");
}

See the SDK Exceptions reference for the full exception hierarchy.