Every Starship API error is returned in a consistent envelope so your integration can route, log, and retry programmatically — without string-matching on messages.
{ "error": { "name": "ValidationException", "code": "E_VALIDATION_FAILURE", "message": "Input validation failed.", "messages": { "amount": [ { "rule": "required", "field": "amount", "message": "The amount field is required." } ] } }}
Field
Type
Description
error.name
string
Stable machine identifier for the error class (e.g., ValidationException, NotFoundError). Safe to branch on.
error.code
string
Short, UPPER_SNAKE_CASE code. The recommended primary field to branch on — see code table below.
error.message
string
Human-readable summary. Suitable for logs; not guaranteed to be stable. Do not branch on this.
error.messages
object(optional)
Present only on validation failures. Maps field name → array of { rule, field, message }.
Never match on error.message. Messages are subject to wording changes. Always branch on error.code (or error.name). The API guarantees codes are stable; messages are not.
Error codes grouped by HTTP status. Your integration should handle every code in a status class consistently (e.g., all 4xx are non-retriable; all 5xx may be retried with backoff).
Referenced product or denomination doesn't exist. (Yes, 400 on these is historical — see note below.)
BAD_REQUEST
BadRequestError
Generic malformed request.
SYNTAX_ERROR
SyntaxError
Request body is not valid JSON.
IDEMPOTENCY_KEY_REQUIRED
(see note)
Idempotency-Key header missing on a write endpoint that requires it.
IDEMPOTENCY_KEY_TOO_SHORT
(see note)
Idempotency-Key shorter than 8 characters.
IDEMPOTENCY_KEY_TOO_LONG
(see note)
Idempotency-Key longer than 256 characters.
Idempotency errors use a slightly different envelope. The three IDEMPOTENCY_KEY_* errors currently return { error: { code, message, details } } (no name, no messages). Branch on error.code — it is stable across both envelope shapes. A future release will unify these on the standard envelope.
Exponential backoff, start at 2 s, max 5 attempts.
429 Too Many Requests
Yes
Honor Retry-After header; if absent, exponential backoff from 1 s.
500 / 503
Yes
Exponential backoff starting at 1 s, max 3 attempts. Writes must carry the same Idempotency-Key.
Network timeout / connection reset
Yes
Same as 5xx. Treat as "request possibly succeeded" for writes — use idempotency.
Idempotency is your friend. For any POST/PUT/PATCH retry, reuse the original Idempotency-Key. The server will return the cached response instead of processing the request twice. See the Idempotency guide.
Starship sanitizes error messages before returning them to clients — SQL errors, stack traces, credential fragments, and internal connection details are never leaked. If you ever see one, report it to hello@rocketincentive.com immediately.