Error Codes

All Priostack API errors return a JSON body with a single error field containing a human-readable message. HTTP status codes follow standard conventions.

Error Response Format

{
  "error": "insufficient credits: balance is 0, required 1"
}

Some endpoints return structured error detail for validation failures:

{
  "error": "invalid request body",
  "details": [
    { "field": "bpmnProcessId", "message": "required field missing" },
    { "field": "variables.amount", "message": "must be a number" }
  ]
}

HTTP Status Codes

StatusMeaningCommon Cause
400 Bad Request Malformed JSON, missing required fields, invalid BPMN/DMN syntax, invalid variable types.
401 Unauthorized Missing or invalid API key. The X-API-Key header is absent or the key does not exist.
402 Payment Required Credit balance is zero. Purchase more credits at Console → Billing.
403 Forbidden Your API key does not have permission for this operation (e.g., non-admin key accessing admin endpoints).
404 Not Found The requested resource (process definition, instance, job) does not exist.
409 Conflict Attempting to deploy a process definition with the same ID and version, or complete an already-completed job.
422 Unprocessable Entity The request is syntactically valid but semantically incorrect (e.g., starting a process with an unknown bpmnProcessId).
429 Too Many Requests Rate limit exceeded (300 req/min per API key). See Rate Limits.
500 Internal Server Error Unexpected server-side error. If this persists, contact support with the X-Request-ID from the response headers.
503 Service Unavailable The server is temporarily overloaded or undergoing maintenance. Retry with exponential backoff.

Common Error Messages

Error MessageCauseFix
missing or invalid API key No X-API-Key header, or the key has been deleted/rotated. Check your key in Console → Settings → API Keys.
insufficient credits Your account credit balance reached zero. Free credits refresh every month; the balance is shown in Console → Billing.
process definition not found: order-processing No deployed process with that bpmnProcessId. Deploy the BPMN first via POST /api/v1/process-definitions.
invalid BPMN: missing start event The BPMN XML has no <startEvent> element. Add a start event to your process definition.
job not found: key=12345 The job key doesn't exist, or was already completed/failed. Check the job key from the activate response. Ensure you're not calling complete twice.
job already completed You called /jobs/{key}/complete on an already-completed job. Check idempotency — store job keys you've completed and skip duplicates.
FEEL evaluation error: variable 'amount' not found A gateway condition references a variable that wasn't set on the instance. Ensure the variable is set before the gateway, either in the start variables or via a preceding task.
DMN decision not found: discount A Business Rule Task references a DMN decision ID that isn't deployed. Deploy the DMN file alongside the BPMN definition.
rate limit exceeded More than 300 requests in the last 60 seconds from this API key. Implement retry with backoff. Check the X-RateLimit-Reset header.
request body too large The uploaded BPMN file or variable payload exceeds the 10 MB limit. Split large payloads. Store large data externally and pass a reference as a variable.

Error Handling Example

// Go: handle specific error codes
resp, err := client.Do(req)
if err != nil {
    return fmt.Errorf("network error: %w", err)
}
defer resp.Body.Close()

switch resp.StatusCode {
case http.StatusOK, http.StatusCreated:
    // success
case http.StatusUnauthorized:
    return errors.New("invalid API key — check PRIOSTACK_API_KEY")
case http.StatusPaymentRequired:
    return errors.New("out of credits — free credits refresh monthly")
case http.StatusTooManyRequests:
    reset := resp.Header.Get("X-RateLimit-Reset")
    return fmt.Errorf("rate limited — retry after %s", reset)
case http.StatusInternalServerError:
    requestID := resp.Header.Get("X-Request-ID")
    return fmt.Errorf("server error (request-id: %s) — contact support", requestID)
default:
    var errBody struct{ Error string `json:"error"` }
    json.NewDecoder(resp.Body).Decode(&errBody)
    return fmt.Errorf("API error %d: %s", resp.StatusCode, errBody.Error)
}
Include X-Request-ID in bug reports: Every response includes an X-Request-ID header with a unique identifier. When contacting support about a 5xx error, include this ID so the team can locate the relevant server logs.