> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surveyowl.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Fix common endpoint URL, payload, CAPTCHA, upload, and response errors.

Start by submitting the smallest possible request, then add your fields and files back one at a time.

```bash theme={null}
curl https://api.surveyowl.co/v1/submit/YOUR_FORM_PUBLIC_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"test":"Hello"}'
```

After it succeeds, open **Submissions** and confirm that the test response arrived.

## Missing or invalid Public Key

Copy the current **Form endpoint URL** from the Endpoint form's **General** tab. The URL must end with that form's Public Key; do not put the Public Key in the request body or an Authorization header.

## A `403` with `domain_not_allowed`

Domain restriction is on and the request's `Origin` or `Referer` is not in the allowed list. Add the domain in the form's **Settings**, or turn on **Allow localhost** if you are testing locally. Calls from a server or `curl` carry no `Origin`, so they fail while the restriction is on; turn it off for that form or send the request from an allowed site.

## The request succeeds but fields are missing

* Give every HTML input, select, and textarea a `name`.
* Make names unique unless you intentionally want several values under one label.
* For JSON, send an object rather than an array or plain text.
* Check that your JavaScript creates the payload after the latest values have been entered.

## The page leaves your website

A normal HTML post opens the default confirmation page. Add a hidden `redirect` field with a complete `https://` URL, or submit with JavaScript and display your own success state.

## The browser shows an error page

If you submit with JavaScript, inspect the response status and message. Common causes include:

* malformed JSON;
* domain restriction rejecting the request's origin;
* a closed Endpoint form or scheduled close date;
* an exhausted monthly response allowance;
* an expired, missing, or rejected CAPTCHA token;
* an unsupported, oversized, or over-limit file upload.

## A JavaScript form always looks successful

`fetch()` does not throw automatically for responses such as 400, 402, or 403. Check `response.ok` before showing a success message.

```js theme={null}
const response = await fetch(url, options);
const result = await response.json();
const message = typeof result.error === 'string'
  ? result.error
  : result.error?.message;

if (!response.ok) {
  throw new Error(message || 'Submission failed.');
}
```

## The response arrived more than once

Disable the submit button while a request is in progress and restore it only after an error. A normal HTML submission uses a redirect-after-submit flow, so refreshing the confirmation page does not submit the form again.

If the issue continues, contact support from your account. Include the form name, the approximate time of a test, the request content type, and the returned status and message. Do not send account passwords or CAPTCHA secrets.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.