The error body

Every error is JSON with a message and a code. Validation errors (422) add errors, every problem at once:
  • code is for your program: one per situation, and it does not change. Branch on it, never on the wording of message.
  • message is for people: show or log it. It is a string or, on some statuses, an array of one string: read it as Array.isArray(m) ? m[0] : m.
  • errors maps a field to its messages. Outside config the key is the field name (name, status, parts.0.etag). Inside config it is a JSON pointer into your request: /config/translations/0/language is the language of the first translation.
Send Accept: application/json to be sure an error comes back as JSON.

Error codes

New codes may be added; treat an unknown one by its status.

Config validation

Two kinds of message come back under /config/…: the schema’s, about shape, and the API’s, about meaning.

Schema messages

Rule messages

These are checked once the config matches the schema, so fixing schema errors may bring up rule errors on the next attempt.

Upload errors

Retrying safely

Repeating a create

Send an Idempotency-Key header with POST /projects: any string of 1 to 255 visible ASCII characters, unique per project you mean to create. A UUID is a good one. If the call times out or the connection drops, repeat it with the same key and the same body:
What is stored is an answer that created a project: the 201, and a 422 with code: "service_start_failed" (the project exists; start it with POST /projects/{id}/start). A call refused before anything was created (validation_failed, build_has_no_schema, …) and a 5xx leave the key unused, so you can correct the body and send it with the same key. Keys belong to your account, and are kept for 24 hours from their first use. The body is compared by content: the same project sent as JSON or YAML, or with its fields in another order, is the same request.

Finding a project by name

An Idempotency-Key protects one create. To keep one project per configuration across runs, days apart, look the name up before creating it: