# REST API Reference Fetch a form's submissions with the Formbold REST API. Available on every plan, including Free. ## What can I do with the Formbold REST API? Right now it does one job: fetch the submissions for any of your forms. That's enough to copy new leads into a CRM or keep a backup in your own database. | Item | Value | | --- | --- | | Base URL | https://api.formbold.com/api | | Format | JSON responses | | Protocol | HTTPS only | | Plans | Every plan, including Free | ## How do I authenticate? Every request needs an API token in the `Authorization` header. Create one in **API & MCP > API Tokens**. See [API Tokens](/docs/api-tokens). ```bash Authorization: Bearer YOUR_API_TOKEN ``` ## Which endpoints are available? | Method | Endpoint | What it does | | --- | --- | --- | | GET | /api/forms/:formId/submissions | Lists a form's submissions | ## How do I fetch a form's submissions? `GET https://api.formbold.com/api/forms/:formId/submissions` returns the submissions for one form. Replace `:formId` with your form's ID, the last part of its endpoint. If your endpoint is `https://formbold.com/s/3Vy25`, the ID is `3Vy25`. First, turn on **HTTP API** for that form. Open the form, go to **Settings**, and switch on **HTTP API** in the **Email Configuration** card ("Allow programmatic access to this form's submissions"). Without it, the request fails with a `400`. ### Parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | formId (path) | string | Yes | Your form's ID, the last part of its endpoint (for example 3Vy25) | ### Request examples cURL: ```bash curl -X GET "https://api.formbold.com/api/forms/3Vy25/submissions" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Accept: application/json" ``` JavaScript or Node.js: ```javascript const formId = "3Vy25"; const response = await fetch( `https://api.formbold.com/api/forms/${formId}/submissions`, { headers: { Authorization: `Bearer ${process.env.FORMBOLD_API_TOKEN}`, Accept: "application/json", }, } ); if (!response.ok) { throw new Error(`Formbold API error: ${response.status}`); } const data = await response.json(); console.log(data); ``` Python: ```python import os import requests form_id = "3Vy25" url = f"https://api.formbold.com/api/forms/{form_id}/submissions" headers = { "Authorization": f"Bearer {os.environ['FORMBOLD_API_TOKEN']}", "Accept": "application/json", } response = requests.get(url, headers=headers) response.raise_for_status() print(response.json()) ``` Run these on a server. A token in front-end code is a token anyone can copy. ### Success response (200 OK) A successful call returns 200 OK with the form's submissions. Each submission is an object like the one below, shown here in a list with a single entry: ```json [ { "country": null, "created_at": "2025-06-16T04:42:51", "domain": null, "fields": { "name": "John Doe", "email": "john.doe@example.com", "message": "This is a test message." }, "files": null, "form_id": "12891", "id": "525393", "is_read": true, "is_spam": false, "is_starred": false, "updated_at": "2025-06-16T04:42:51" } ] ``` The list may sit inside a wrapper object with other top-level keys. Log the raw JSON from your first call and check its shape before you write the parsing code. ### What's in a submission object? | Field | Type | Description | | --- | --- | --- | | id | string | The submission's unique ID. | | form_id | string | Internal ID of the form that received the submission. It's not the ID in your endpoint URL. | | fields | object | What the visitor entered, keyed by your form's input names, for example name, email and message. | | files | null or file data | Files uploaded with the submission. null when there are none. | | country | string or null | The visitor's country, when it's known. Otherwise null. | | domain | string or null | The site the form was submitted from, when it's known. Otherwise null. | | is_read | boolean | Whether the submission is marked as read. | | is_spam | boolean | Whether the submission was flagged as spam. | | is_starred | boolean | Whether the submission is starred. | | created_at | string (ISO 8601) | When the submission arrived, for example 2025-06-16T04:42:51. There's no timezone suffix. | | updated_at | string (ISO 8601) | When the submission was last updated. Same format as created_at. | ## What do the error codes mean? | HTTP code | Status | What to check | | --- | --- | --- | | 400 | Bad Request | The form ID isn't valid, or HTTP API is turned off for this form. Check the ID, then switch HTTP API on in Settings > Email Configuration. | | 401 | Unauthorized | The token is missing or revoked, or the header doesn't start with "Bearer ". | Errors come back as JSON with a message. A request without a valid token gets this: ```json { "success": false, "data": null, "message": "Unauthorized" } ``` ## Can AI assistants use the API? Yes, through the [Formbold MCP server](/docs/mcp-server). It has its own URL and takes the same API token: | Item | Value | | --- | --- | | MCP URL | https://api.formbold.com/mcp | | Authentication | Authorization: Bearer YOUR_API_TOKEN | | Tools | list_workspaces, create_form, update_form, get_form, list_forms, test_submission, get_submissions | With it, Cursor, VS Code, Claude Code, Claude Desktop or Codex can create forms, change form settings, send test submissions and check form stats from a chat. Setup for each client, the arguments for each tool and example prompts are in [MCP Server](/docs/mcp-server). ### What does the MCP server return without a valid token? HTTP 401, with a message that tells you which problem it is, repeated in a details object. No token: ```json { "success": false, "data": null, "message": "Authentication token is required for Formbold MCP access.", "details": { "message": "Authentication token is required for Formbold MCP access.", "error": "Unauthorized", "statusCode": 401 } } ``` An invalid or expired token: ```json { "success": false, "data": null, "message": "Invalid or expired Formbold MCP API token.", "details": { "message": "Invalid or expired Formbold MCP API token.", "error": "Unauthorized", "statusCode": 401 } } ```