Validation Failed

validation-error · 400

The request failed validation before anything ran, so nothing was written.

errors[] holds one entry for each field that failed, all of them at once. When the body's own checks refuse it, detail is always the same sentence and the specifics are in errors[]. A custom log range that isn't a range answers with this type too, with the fix in detail and no errors[].

Besides the members every error carries, this type adds errors.

Common causes

  • A field holds a value of the wrong type, such as text where a number or an object is expected.
  • A value is outside a closed set, such as a service type other than git, database, cache, postgres, mysql or redis.
  • A required field is missing, or the body carries a field the API doesn't know. An unknown field is refused, not ignored, so a misspelled name fails here.
  • An IP allowlist has addresses that can't be used. Each one gets its own entry, such as ip_allowlist[2], and nothing is staged.

How to fix the call

  • Read errors[] rather than detail. Each entry has field, a dot path into the body (entries.0.kind is the kind of the first item in entries), with message and the value you sent.
  • When a field takes a closed set, its entry carries allowedValues. Send one of them exactly as written.
  • Correct every entry before you retry. A second attempt that fixes only the first entry fails again on the rest.
  • When there is no errors[], detail says what to change.
  • Don't resend the same body: nothing about it will pass later.

Example response

json
{
  "type": "validation-error",
  "title": "Validation Failed",
  "status": 400,
  "detail": "One or more validation errors occurred",
  "errors": [
    {
      "field": "type",
      "message": "type must be one of the following values: git, database, cache, postgres, mysql, redis",
      "value": "worker",
      "constraints": [
        "isIn"
      ],
      "allowedValues": [
        "git",
        "database",
        "cache",
        "postgres",
        "mysql",
        "redis"
      ]
    },
    {
      "field": "name",
      "message": "name must be lowercase letters, digits, and single hyphens",
      "value": "My App",
      "constraints": [
        "matches"
      ]
    }
  ],
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
  "method": "POST",
  "instance": "POST /v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
  "docs": "https://ghaym.me/docs/errors/validation-error"
}