All error codes

validation_failed

HTTP 400Not retryable

Request body or query parameters failed validation. Inspect `details` for per-field errors.

How to resolve

  • Inspect the `details` array in the response for per-field errors.
  • Ensure all required fields are present and match their expected types.
  • Check string length limits and enum values against the API reference.

Example response

JSON

{
  "object": "error",
  "code": "validation_failed",
  "message": "Request body or query parameters failed validation. Inspect `details` for per-field errors.",
  "request_id": "req_example123",
  "docs_url": "https://docs.statxt.com/api/errors/validation_failed"
}

Example request (invalid)

JSON

{
  "to": "not-a-phone",
  "from_phone_number_id": "bad-uuid",
  "body": ""
}

SDK handling

TypeScript

import { StatxtClient, StatxtApiError } from "@statxt/sdk"

const client = new StatxtClient({ apiKey: process.env.STATXT_API_KEY! })

try {
  await client.messages.send({ ... })
} catch (err) {
  if (err instanceof StatxtApiError && err.code === "validation_failed") {
    // Request body or query parameters failed validation. Inspect `details` for per-field errors.
    console.error(err.requestId) // include in support tickets
  }
}

Public reference: /docs/errors/validation_failed