Skip to content

FormsApiError

A non-2xx response from the Forms API. status and body are exposed so callers can branch on the specific failure rather than parsing a message: 401 (bad or revoked key), 402 (the organization’s subscription needs attention), 404 (no such form for this organization), 409 (the form has two fields sharing a submission key and must be fixed in the Forms editor), 429 (rate limited — a Retry-After header accompanies it).

requestId is the request’s reference: the X-Request-Id response header, else the body’s requestId (an unhandled 500 carries it there too), else null — as it is for a response a proxy generated, which never reached the API. Quote it to support; it is how that request is found in the logs.

  • Error

new FormsApiError(status, body, requestId?): FormsApiError

number

unknown

string | null

FormsApiError

Error.constructor

readonly body: unknown


optional cause?: unknown

Error.cause


message: string

Error.message


name: string

Error.name


readonly requestId: string | null


optional stack?: string

Error.stack


readonly status: number