Skip to Content

Errors

The Formtorch API uses standard HTTP status codes and returns a consistent JSON error body.

Error format

{ "error": "No form with ID abc123 exists in your account.", "code": "not_found" }
FieldTypeDescription
errorstringHuman-readable description
codestringMachine-readable error identifier

HTTP status codes

StatusMeaning
200 OKRequest succeeded
400 Bad RequestInvalid request parameters
401 UnauthorizedMissing or invalid API key
403 ForbiddenPlan restriction or insufficient access
404 Not FoundResource does not exist
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorUnexpected server error

Error codes

CodeStatusDescription
unauthorized401API key missing or malformed
plan_required403API access requires Starter or Pro plan
forbidden403Valid key but insufficient permissions
not_found404Resource does not exist or does not belong to your account
bad_request400Invalid request (e.g. unrecognized parameter)
invalid_cursor400Pagination cursor is malformed or expired
invalid_limit400limit must be a positive integer
rate_limited429Too many requests. See Rate Limits.
method_not_allowed405HTTP method not supported on this endpoint
internal_error500Unexpected error on our end

Handling errors

const res = await fetch("https://api.formtorch.com/v1/forms/abc1234567", { headers: { Authorization: `Bearer ${process.env.FORMTORCH_API_KEY}` }, }); if (!res.ok) { const { error, code } = await res.json(); console.error(`[${code}] ${error}`); // handle by code }
Last updated on