Skip to main content
Use JavaScript when the visitor should stay on your page after submitting.

HTML

JavaScript

Replace YOUR_FORM_PUBLIC_KEY in the request URL with the Public Key from the Endpoint form’s General tab.
The important check is response.ok. fetch() does not throw automatically when the API returns a 400, 402, or 403 response.

Sending files

Keep the data as FormData when the form contains a file. Do not set a Content-Type header—the browser will add the multipart boundary. See Files and CAPTCHA.