# Create a new form Source: https://docs.formbase.dev/api-reference/forms/create-a-new-form post /forms # Create multiple forms Source: https://docs.formbase.dev/api-reference/forms/create-multiple-forms post /forms/bulk # Delete a form Source: https://docs.formbase.dev/api-reference/forms/delete-a-form delete /forms/{formId} Permanently deletes a form and all its submissions. # Delete multiple forms Source: https://docs.formbase.dev/api-reference/forms/delete-multiple-forms delete /forms/bulk # Duplicate a form Source: https://docs.formbase.dev/api-reference/forms/duplicate-a-form post /forms/{formId}/duplicate Creates a copy of a form with its configuration. # Get a single form Source: https://docs.formbase.dev/api-reference/forms/get-a-single-form get /forms/{formId} # List all forms Source: https://docs.formbase.dev/api-reference/forms/list-all-forms get /forms Returns a paginated list of forms owned by the authenticated user. # Update a form Source: https://docs.formbase.dev/api-reference/forms/update-a-form patch /forms/{formId} # Update multiple forms Source: https://docs.formbase.dev/api-reference/forms/update-multiple-forms patch /forms/bulk # API Overview Source: https://docs.formbase.dev/api-reference/overview Access your forms and submissions programmatically with the Formbase REST API ## Introduction The Formbase API provides programmatic access to your forms and submissions. Use it to build custom integrations, automate workflows, or manage your forms from external applications. ## Base URL All API requests should be made to: ``` https://formbase.dev/api/v1 ``` ## Authentication The API uses Bearer token authentication with API keys. Include your API key in the `Authorization` header: ```bash theme={null} curl -X GET "https://formbase.dev/api/v1/forms" \ -H "Authorization: Bearer YOUR_API_KEY" ``` Keep your API keys secure. Don't share them in public repositories or expose them in client-side code. ### Creating API Keys 1. Go to your [Dashboard Settings](https://formbase.dev/dashboard/settings/api-keys) 2. Click "Create Key" 3. Give your key a descriptive name 4. Optionally set an expiration date 5. Copy the key immediately - it won't be shown again API keys management page Create API key dialog ## Rate Limits API requests are rate limited to **100 requests per minute** per API key. Rate limit information is included in the response headers: | Header | Description | | ----------------------- | -------------------------------------------------- | | `X-RateLimit-Remaining` | Number of requests remaining in the current window | | `X-RateLimit-Reset` | Unix timestamp when the rate limit resets | When you exceed the rate limit, the API returns a `429 Too Many Requests` response with a `Retry-After` header indicating how many seconds to wait. ## Error Responses All errors follow a consistent format: ```json theme={null} { "error": { "code": "NOT_FOUND", "message": "Form not found" } } ``` ### Common Error Codes | HTTP Status | Code | Description | | ----------- | ----------------------- | -------------------------- | | 400 | `BAD_REQUEST` | Invalid request parameters | | 401 | `UNAUTHORIZED` | Missing or invalid API key | | 404 | `NOT_FOUND` | Resource not found | | 429 | `TOO_MANY_REQUESTS` | Rate limit exceeded | | 500 | `INTERNAL_SERVER_ERROR` | Server error | ## Pagination List endpoints return paginated results with the following structure: ```json theme={null} { "forms": [...], "pagination": { "page": 1, "perPage": 20, "total": 45, "totalPages": 3 } } ``` ### Query Parameters | Parameter | Default | Max | Description | | --------- | ------- | --- | -------------- | | `page` | 1 | - | Page number | | `perPage` | 20 | 100 | Items per page | ## OpenAPI Specification The complete OpenAPI specification is available at: ``` https://formbase.dev/api/v1/openapi.json ``` You can use this specification with tools like Postman, Insomnia, or code generators. # Delete a submission Source: https://docs.formbase.dev/api-reference/submissions/delete-a-submission delete /forms/{formId}/submissions/{submissionId} # Delete multiple submissions Source: https://docs.formbase.dev/api-reference/submissions/delete-multiple-submissions delete /forms/{formId}/submissions/bulk # Get a single submission Source: https://docs.formbase.dev/api-reference/submissions/get-a-single-submission get /forms/{formId}/submissions/{submissionId} # List submissions for a form Source: https://docs.formbase.dev/api-reference/submissions/list-submissions-for-a-form get /forms/{formId}/submissions Returns a paginated list of submissions with optional date filtering. # Framer Source: https://docs.formbase.dev/cms/framer Send Framer form submissions to Formbase. Framer supports custom code and embeds, which makes Formbase easy to integrate. Use an HTML form inside an Embed component or a custom code component and point it at your Formbase endpoint. Create a new form in the Formbase dashboard and copy the endpoint URL. Drop an Embed component into your Framer page and paste your HTML form. ```html theme={null}
``` Publish the site and test a submission.
If you need custom success handling, submit with JavaScript and redirect manually after a successful response. # Squarespace Source: https://docs.formbase.dev/cms/squarespace Use Formbase with Squarespace forms. Squarespace does not allow direct control of the built-in form action, so the most reliable integration is to use a Code Block with your own HTML form. This gives you full control over field names and submission behavior. Create a new form in the Formbase dashboard and copy the endpoint URL. In Squarespace, add a Code Block to your page and paste an HTML form. ```html theme={null}
``` Publish the page and submit a test entry.
If you need a custom success experience, handle submission with JavaScript and redirect manually. # Webflow Source: https://docs.formbase.dev/cms/webflow Send Webflow form submissions to Formbase. Webflow forms can post to any endpoint, which makes Formbase a great fit. You keep your Webflow design and point the form action to your Formbase endpoint. This setup works without custom code and keeps the Webflow UX intact. Create a new form in the Formbase dashboard and copy the endpoint URL. In the Webflow designer, add a Form Block and configure your fields as usual. Open the form settings and set the action to your Formbase endpoint: ```text theme={null} https://formbase.dev/s/YOUR_FORM_ID ``` Make sure the field names match the keys you want in Formbase. Publish the page and submit a test entry. Confirm the submission appears in your Formbase dashboard. Formbase redirects browser submissions to a success page. If you want a custom Webflow success state, intercept the submission with custom code and redirect manually. # Wix Source: https://docs.formbase.dev/cms/wix Use Formbase with Wix and Velo. Wix forms are highly customizable, and with Velo you can send submissions to external endpoints like Formbase. This gives you full control over field names and success handling. Create a new form in the Formbase dashboard and copy the endpoint URL. Add input elements to your page and give them IDs (for example, `#nameInput`, `#emailInput`). ```js theme={null} $w.onReady(function () { $w('#submitButton').onClick(async () => { const payload = { name: $w('#nameInput').value, email: $w('#emailInput').value, }; const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload), redirect: 'manual', }); if (response.status === 303 || response.ok) { $w('#status').text = 'Submitted!'; } else { $w('#status').text = 'Submission failed.'; } }); }); ``` Create a text element with ID `#status` for feedback. For file uploads, use `FormData` and a file input element instead of JSON. # WordPress Source: https://docs.formbase.dev/cms/wordpress Send WordPress form submissions to Formbase. WordPress gives you full control over HTML forms, which makes Formbase straightforward to integrate. You can use a Custom HTML block or a form plugin that allows custom action URLs. The simplest approach is to embed a plain HTML form. Create a new form in the Formbase dashboard and copy the endpoint URL. In the block editor, add a Custom HTML block and paste your form markup. ```html theme={null}
``` Publish the page and submit a test entry.
If you use a form plugin, look for an option to set the form action or webhook URL. Point it to your Formbase endpoint. # Common Questions Source: https://docs.formbase.dev/faq/common-questions Answers to the most common Formbase questions. Below are answers to frequent questions about how Formbase works and how to troubleshoot issues. Every form has an endpoint at `/s/`. On the hosted service, this looks like `https://formbase.dev/s/YOUR_FORM_ID`. For self-hosting, replace the domain with your own. Submit from your server (API route, server action, or serverless function). Browser submissions return a `303` redirect and no JSON body. Yes. Use `multipart/form-data` and configure S3-compatible storage. Uploaded files appear as URLs under `file` or `image` in the submission data. Ensure SMTP or Resend is configured in your environment. Email delivery is required for account verification and submission notifications. Formbase does not include built-in spam filtering. Use CAPTCHA, honeypots, or edge rules in front of Formbase. ```bash theme={null} curl -X POST https://formbase.dev/s/YOUR_FORM_ID \ -H "Content-Type: application/json" \ -d '{"test":true}' ``` This returns JSON and is a fast way to confirm the endpoint is working. # Allowed File Types Source: https://docs.formbase.dev/file-uploads/allowed-file-types Restrict uploads by type with client-side checks. Formbase does not enforce file type restrictions on the server. If you want to limit uploads to certain file types, enforce it in your UI and (if needed) in your own backend before sending the file to Formbase. The simplest approach is to use the `accept` attribute on your file input. ```html theme={null}
``` Most browsers will only let users pick matching file types.
If you want extra control, inspect `file.type` or the filename before submitting and show a helpful error message.
For strict enforcement, validate on your own server or upload proxy before forwarding to Formbase. # Basic File Upload Source: https://docs.formbase.dev/file-uploads/basic-file-upload Accept a single file upload with Formbase. Formbase accepts file uploads through `multipart/form-data` and stores the file in your configured S3-compatible bucket. The submission data will include a URL under either `file` or `image` depending on the MIME type. If you are self-hosting, make sure storage credentials are configured before enabling file uploads. Set the `STORAGE_*` environment variables so Formbase can connect to your bucket. See [File storage](/self-hosting/file-storage) for examples. ```html theme={null}
``` The browser will submit the file as `multipart/form-data`.
In the dashboard, the uploaded file appears as a clickable URL under `file` or `image`. Submissions table with file URLs
## JavaScript submission If you need a custom UI, submit with fetch and `FormData`: ```js theme={null} const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', body: new FormData(formElement), redirect: 'manual', }); if (response.status === 303 || response.ok) { // success } ``` Formbase stores uploaded files as signed URLs. The original filename is not preserved. # Error Handling Source: https://docs.formbase.dev/file-uploads/error-handling Handle upload errors gracefully. File uploads can fail for the same reasons as any submission: invalid form ID, storage misconfiguration, or network issues. The Formbase submit endpoint responds with standard HTTP status codes so you can handle errors in your UI. Here is a simple client-side pattern you can reuse. ```js theme={null} const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', body: new FormData(formElement), redirect: 'manual', }); if (response.status === 303 || response.ok) { // Success } else if (response.status === 404) { // Form not found } else { // General failure (500 or other) } ``` ## Common error causes Formbase throws an error if storage credentials are missing when a file is uploaded. Ensure all `STORAGE_*` environment variables are set. A `404` response means the form ID does not exist or is not available in this Formbase instance. Handle timeouts or offline conditions by showing a retry button and preserving form state when possible. Browser submissions return a `303` redirect on success. Treat `303` as a successful upload. # Multiple Files Source: https://docs.formbase.dev/file-uploads/multiple-files Patterns for collecting multiple files with Formbase. Formbase stores a single `file` URL (and optionally a single `image` URL) per submission. If you need to collect multiple files, you have two good options: 1. Submit multiple times (one file per submission), or 2. Upload files to your own storage and send the resulting URLs to Formbase as JSON. The second option gives you full control and keeps the Formbase submission clean and structured. Use a dedicated upload endpoint or direct-to-storage upload flow. Collect the URLs in your client or server. ```ts theme={null} const payload = { name: 'Ada Lovelace', attachments: [ 'https://cdn.example.com/uploads/resume.pdf', 'https://cdn.example.com/uploads/portfolio.pdf', ], }; await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload), }); ``` This keeps multiple files together as a single submission field. If you submit multiple file inputs in a single `multipart/form-data` request, Formbase keeps only one `file` and one `image` URL. # Security Considerations Source: https://docs.formbase.dev/file-uploads/security-considerations Keep file uploads safe and private. File uploads are powerful, but they also introduce security concerns. Formbase stores files in your S3-compatible bucket and returns a signed URL for access. Use the practices below to keep uploads secure. Store files in private buckets and rely on signed URLs for access instead of public objects. Enforce file size and type limits in your UI to prevent accidental or malicious uploads. If you process user uploads, run them through malware scanning or manual review before using them in downstream workflows. Formbase does not inspect file contents or enforce MIME types. If you need strict controls, validate before forwarding uploads. # Creating Your First Form Source: https://docs.formbase.dev/getting-started/creating-your-first-form Set up a form endpoint in the Formbase dashboard. Creating a form in Formbase gives you a unique endpoint you can post to from any site or application. The title and description are for your own organization and do not affect submissions. You can also define a return URL. After a browser submission, Formbase shows a success page with a button that sends users back to that URL. Sign in to Formbase and click "New Form" in your dashboard. Formbase dashboard with New Form button Add a title and optional description to make it easy to find later. These fields appear only in your dashboard. Create new form dialog If you want a button on the success page that sends visitors back to your site, add a return URL now or update it later in settings. After saving, Formbase shows your endpoint, for example: ```text theme={null} https://formbase.dev/s/your-form-id ``` Use this endpoint as the `action` in an HTML form or as the URL in your fetch request. Form endpoint URL display You can rename the form, update the return URL, and change email notification settings at any time from the form settings page. ## Next step Go to [Your form endpoint](/getting-started/your-form-endpoint) to learn how submissions are handled and how to use the endpoint in different environments. # Introduction Source: https://docs.formbase.dev/getting-started/introduction What Formbase is and how to get your first submission. Formbase is an open-source backend for form submissions. You build the form UI in your app or site, then send the data to a Formbase endpoint. Formbase stores each submission, shows it in the dashboard, and can email you when new data arrives. The workflow is simple: create a form in the dashboard, post to its endpoint, and review submissions. Browser posts redirect to a built-in success page, while server requests receive JSON. ## How Formbase works Forms live in the dashboard. Each form gets a unique endpoint like `https://formbase.dev/s/your-form-id`. Any HTTP client can submit. For static sites, use a normal HTML form. For apps, use fetch or a server action. Submissions appear in the dashboard. Enable email notifications if you want alerts for new entries. Submissions in the dashboard Formbase does not enforce a field schema. The `name` attributes you send become keys in your submission data. ## Quick start examples ```html index.html theme={null}
``` The browser handles the redirect after submission.
```ts server.ts theme={null} const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Ada', email: 'ada@example.com' }), }); const result = await response.json(); console.log(result.message, result.data); ``` Server requests receive JSON with the data you submitted.
## Next steps Set up a form in the dashboard and grab its endpoint. Learn how endpoints work for hosted and self-hosted setups. # Receiving Your First Submission Source: https://docs.formbase.dev/getting-started/receiving-your-first-submission Submit a test payload, confirm it appears in the dashboard, and verify notifications. Once you have an endpoint, send a test submission to confirm everything is wired correctly. This also verifies your email notification setup if it is enabled. Use the method that best matches how you plan to collect submissions in production. Pick one of the options below and submit a test payload. Open your website, fill in the form, and submit. This confirms the end-to-end flow works in a real browser. ```js theme={null} const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', body: new FormData(document.querySelector('form')), redirect: 'manual', }); if (response.status === 303 || response.ok) { console.log('Submitted'); } ``` Browser requests receive a `303` redirect. Treat that as success. ```bash theme={null} curl -X POST https://formbase.dev/s/YOUR_FORM_ID \ -H "Content-Type: application/json" \ -d '{"name":"Ada","email":"ada@example.com"}' ``` Server submissions return JSON with the data you sent. Open your form in the dashboard and confirm the submission appears in the table. New field names will show up as columns automatically. Submissions table showing test entry If email notifications are enabled, you should receive a message with the submission data. Make sure your SMTP or Resend configuration is set up if you are self-hosting. If you are not receiving emails in a self-hosted environment, review the [Email setup](/self-hosting/email-setup) guide. # Your Form Endpoint Source: https://docs.formbase.dev/getting-started/your-form-endpoint Where to find your endpoint and how to submit to it. Every Formbase form is identified by a unique ID. Your submit endpoint is always the base URL of your Formbase instance plus `/s/`. For the hosted service: ``` https://formbase.dev/s/YOUR_FORM_ID ``` For self-hosting: ``` https://your-domain.com/s/YOUR_FORM_ID ``` ## What the endpoint accepts Formbase accepts the formats that browsers and APIs commonly send: * `multipart/form-data` (for file uploads) * `application/x-www-form-urlencoded` (standard HTML forms) * `application/json` (server submissions and API-style posts) The same `/s/` path is used for both POST submissions and the built-in success page. Browser posts return a `303` redirect to that page. ## Example submissions ```html index.html theme={null}
``` Use `enctype="multipart/form-data"` when uploading files.
```ts theme={null} const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ plan: 'pro', userId: '123' }), }); const result = await response.json(); console.log(result.data); ``` This is the best approach when you need a JSON response.
## CORS and preflight Formbase responds to `OPTIONS` preflight requests on `/s/` and allows cross-origin POSTs by default. This makes it easy to post from any frontend. # HTML Field Types Source: https://docs.formbase.dev/integrations/html-field-types Understand how different HTML inputs map to Formbase submission data. Formbase stores submissions as a JSON object where each key is the `name` attribute of a field. Most HTML inputs work exactly as you expect, but some types (checkbox groups and multiple inputs) have special considerations. Use this reference to pick field names and understand what shows up in your submission data. ```html theme={null} ``` Each field becomes a string value in the submission data. ```html theme={null} ``` Only the selected value is submitted. The key is `plan` and the value is the chosen option. ```html theme={null} ``` If checked, the value is sent. If unchecked, the key is omitted entirely. ```html theme={null} ``` The selected option value is stored under `country`. ```html theme={null} ``` Files are uploaded and stored as URLs. Formbase sets either the `file` or `image` key based on the MIME type. ## Multiple values with the same name When using `multipart/form-data`, repeated keys collapse to the last value. If you need arrays (for example, multi-select or checkbox groups), submit as JSON instead. ```js theme={null} await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tags: ['design', 'growth', 'product'] }), }); ``` JSON submissions are best when you need structured data or arrays. Browser form posts are best for simple, classic form flows. # HTML Forms Source: https://docs.formbase.dev/integrations/html-forms Submit HTML forms directly to Formbase with no client-side code. The simplest Formbase integration is a standard HTML form. This works anywhere you can write HTML: static sites, templates, server-rendered apps, and CMS embeds. When the browser submits the form, Formbase stores the data and redirects the user to a built-in success page. If you set a return URL in the dashboard, that page includes a button back to your site. Copy the endpoint from your Formbase dashboard. It looks like `https://formbase.dev/s/YOUR_FORM_ID`. ```html theme={null}
``` The `name` attribute of each field becomes a key in your submission data.
Submit the form and confirm the data appears in your Formbase dashboard.
## File uploads with HTML To upload files, add a file input and set `enctype="multipart/form-data"`: ```html theme={null}
``` Formbase stores uploaded files as URLs under either `file` or `image` in the submission data. If you need a custom thank-you page, handle submission with JavaScript and redirect manually. See [Redirects](/redirects/basic-redirect-setup). # JavaScript + AJAX Source: https://docs.formbase.dev/integrations/javascript-ajax Submit to Formbase with fetch, XHR, or jQuery for full UI control. Use JavaScript submissions when you need loading states, inline errors, or single-page app behavior. Formbase accepts `FormData` and JSON payloads, so you can post directly from the browser. Browser requests receive a `303` redirect instead of JSON. When submitting with JavaScript, treat a `303` status as success or send the request from your server for a JSON response. Create a normal HTML form with `name` attributes. JavaScript will serialize it. ```html theme={null}

``` `redirect: 'manual'` prevents the browser from following the redirect and running into CORS issues.
```html theme={null}

``` XHR gives you full control over success and error states.
```html theme={null}

``` jQuery works as long as you send `FormData` and disable automatic processing.
If you need a JSON response, submit from your server (for example, an API route or server action) instead of the browser. # Next.js App Router Source: https://docs.formbase.dev/integrations/nextjs-app-router Submit to Formbase from Next.js App Router pages. Next.js App Router is a great fit for Formbase because server actions can submit on the server and return a clean JSON response. This avoids browser redirects and gives you full control over the UI. You can still submit from the client if you want, but server actions are the most reliable pattern. Submit the form data from the server so Formbase returns JSON instead of a redirect. ```ts theme={null} // app/actions/submit-to-formbase.ts 'use server'; export async function submitToFormbase( _prevState: { ok: boolean; message: string }, formData: FormData, ) { const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', { method: 'POST', body: formData, }); if (!response.ok) { return { ok: false, message: 'Submission failed.' }; } return { ok: true, message: 'Submitted!' }; } ``` This works for both text fields and file uploads. ```tsx theme={null} 'use client'; import { useFormState } from 'react-dom'; import { submitToFormbase } from '../actions/submit-to-formbase'; const initialState = { ok: false, message: '' }; export default function ContactForm() { const [state, formAction] = useFormState(submitToFormbase, initialState); return (
{#if status}

{status}

{/if}
``` Svelte passes the form element via `event.currentTarget`. ```svelte theme={null}
{#if status}

{status}

{/if}
``` Add `enctype="multipart/form-data"` when files are present.
For a JSON response, forward submissions from a server endpoint or server action. # Vue + FormKit Source: https://docs.formbase.dev/integrations/vue-formkit Submit FormKit forms to Formbase. FormKit handles form state and validation in Vue. You can send the submitted values directly to Formbase as JSON, or switch to `FormData` when you need file uploads. Because Formbase returns a `303` redirect to browser requests, treat that status as success in your client-side handler. Use FormKit's `@submit` hook to send data to Formbase. ```vue theme={null} ``` JSON is ideal when you do not need file uploads. ```vue theme={null} ``` This approach forwards the underlying form element as `FormData`. Use a server-side submit if you need a JSON response from Formbase. # Vue (Vanilla) Source: https://docs.formbase.dev/integrations/vue-vanilla Submit to Formbase from a Vue component. Vue works well with Formbase whether you use a standard `
` or handle submission programmatically. This guide shows a programmatic submission so you can control loading and error state. Because browser requests receive a `303` redirect, treat that as success in your UI. Create the form fields and bind them to Vue state. ```vue theme={null}