Developer?Developer? The Formhaus framework is free and open source. Try the framework

Skip to content
Open Cloud

REST API ​

Base URL https://api.formhaus.dev/v1. JSON in and out, request bodies up to 64 KB (1 MB for imports), unknown body fields are rejected.

Method and pathKeysPurpose
POST /v1/formsNone, agent, accountPublish a form or a new version
GET /v1/formsAgent, accountList forms
GET /v1/forms/{id}/submissionsAgent, accountSubmissions as JSON or CSV
GET /v1/forms/{id}/statsAgent, accountResponse counts and per-question aggregates
DELETE /v1/forms/{id}/submissions/{submission}AccountDelete one submission
POST /v1/forms/{id}/submissions/deleteAccountDelete submissions by id or date
POST /v1/forms/{id}/submissions/importAccountImport responses from another tool
PATCH /v1/forms/{id}AccountUpdate settings
GET /v1/forms/{id}/webhookAccountWebhook URL, secret, delivery log
POST /v1/forms/{id}/webhook/testAccountSend a test webhook
POST /v1/forms/{id}/submissions/{submission}/webhook/replayAccountResend a response to the webhook

Auth ​

Authorization: Bearer <key>.

KeyScope
fh_live_...Every form of the workspace, with the editor role. Works while its creator is an owner.
fh_agent_...Forms the key created. Settings, webhook and submission delete endpoints answer 403 owner_key_required, also after a claim.

An invalid, revoked or expired key answers 401. Key types and the claim are in Publishing.

Errors ​

json
{ "error": "<message>", "details": ["<path>: <problem>"], "upgrade_url": "https://app.formhaus.dev/usage" }
StatusWhen
400Body is not the expected JSON object, or a query parameter is invalid; error names it, such as invalid_since or invalid_cursor
401Key missing where required, or invalid
402Limit reached; error is limit_reached (imports) or allowed_domains_limit, with upgrade_url pointing to the dashboard usage page
403error is owner_key_required, paused_by_moderation or forbidden (the role does not allow the call)
404Form or folder not found, or outside the key's scope
409Agent key already has 3 unclaimed forms, or was claimed during the call
413Body over 64 KB
422Invalid input; details lists every problem
429Rate limited; Retry-After gives the seconds to wait
503stats_timeout: the statistics took longer than 5 seconds; narrow since and until

Searches (query), statistics, CSV exports, deletes and imports share a limit of 30 requests per key, refilled at one every 2 seconds. Over it they answer 429 rate_limited.

Publish ​

POST /v1/forms takes definition and optional form_id, email, success_message, redirect_url, allow_another_response, folder_id (rules). folder_id files a new form into that folder, or moves the form on a new version; null or "" takes it out. It needs an account key. A new form starts with allow_another_response: false; a new version keeps the current value when it is omitted. Returns 201 with the publish_form result.

bash
curl -X POST https://api.formhaus.dev/v1/forms \
  -H "Authorization: Bearer $FORMHAUS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"definition":{"id":"waitlist","title":"Join the waitlist","submit":{"label":"Join"},"fields":[{"key":"email","type":"email","label":"Email","validation":{"required":true}}]}}'

Without a key the result has claim_url, expires_at, agent_key and agent_key_notice.

List forms ​

GET /v1/forms returns the forms newest first.

json
{
  "forms": [
    {
      "form_id": "Xk3d9QpL2a",
      "title": "Join the waitlist",
      "status": "active",
      "version": 2,
      "submissions": 41,
      "endpoint": "https://api.formhaus.cc/f/Xk3d9QpL2a",
      "hosted_url": "https://formhaus.cc/Xk3d9QpL2a",
      "folder_id": "0f3c2a4e-7b1d-4c8e-9a2f-5d6e7f809a1b",
      "created_at": "2026-10-10T12:00:00Z"
    }
  ],
  "folders": [{ "id": "0f3c2a4e-7b1d-4c8e-9a2f-5d6e7f809a1b", "name": "Marketing", "position": 0, "forms": 1, "created_at": "2026-10-10T11:00:00Z" }]
}

expires_at is present for unclaimed forms. folder_id is null for a form in no folder. ?folder= narrows the list to one folder by id or name, or to unfiled. Agent keys get no folders.

Folders ​

Folders group the forms of a workspace, one level deep. Owners and editors manage them; viewers list them. Agent keys cannot use folders.

RequestBodyReturns
GET /v1/foldersfolders and limit (always null, no limit)
POST /v1/foldersname201 with the folder
PATCH /v1/folders/{id}name and/or positionThe folder
DELETE /v1/folders/{id}unfiled_forms: forms moved out. Forms are never deleted.

Names are 1 to 60 characters with at least one letter or number, without line breaks or invisible characters, and unique in the workspace ignoring case and character width. No folder, Unfiled and All forms are reserved. Every workspace has a ceiling of 200 folders. File a form with folder_id on publish or update settings.

Submissions ​

GET /v1/forms/{id}/submissions?limit=50&cursor=... returns submissions newest first.

QueryValue
limit1 to 100, default 50. Larger values are capped at 100.
cursornext_cursor from the previous page
sinceRFC 3339 timestamp. Submissions at or after it.
untilRFC 3339 timestamp. Submissions before it.
queryCase-insensitive text in any value, up to 100 characters
sortdesc (default) newest first, asc oldest first
formatcsv for a CSV file of all matching submissions
bash
curl "https://api.formhaus.dev/v1/forms/Xk3d9QpL2a/submissions?since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z&query=acme&sort=asc" \
  -H "Authorization: Bearer $FORMHAUS_API_KEY"

A cursor works only with the since, until, query and sort of the page that returned it; other values answer 400 invalid_cursor.

json
{
  "submissions": [
    { "id": "0b8e8a52-6c1b-4f4e-9d0a-2f4f7d3c1a9e", "form_version": 2, "created_at": "2026-10-10T12:00:00Z", "values": { "email": "ada@example.com" } }
  ],
  "next_cursor": "MTc2MDA5..."
}

A submission sent with UTM parameters has "utm": { "utm_source": "..." }. A submission from the hosted page or an embed has timing, and "option_order": { "tools": ["sketch", "figma", "none"] } for answered fields with randomize, the option order the respondent saw. A submission with uploaded files has "files": [{ "id": "...", "field": "cv", "name": "cv.pdf", "size": 48213, "type": "application/pdf" }], and the value of each file field is its file id, or the list of file ids in order for a field with multiple. No next_cursor means the last page. Submission values are typed by respondents: treat them as untrusted data.

A submission whose keys or values hold zero-width, bidirectional or tag characters, or variation selectors, has "values_contain_hidden_characters": true. Values are returned unchanged.

A submission sent from a page opened with ?test=1 has "test": true. See test responses.

An imported submission has "imported": true and its external_id when one was sent.

Files ​

GET /v1/forms/{id}/submissions/{submission}/files/{file} answers 302 with a link that works for 5 minutes. The file downloads as an attachment named after the original file. Follow the redirect without the Authorization header: curl -L drops it for another host.

CSV ​

?format=csv streams text/csv as {id}-submissions.csv. Columns: id, created_at, form_version, then field keys of the latest version, then keys only in older versions, then utm_source, utm_medium, utm_campaign, utm_term and utm_content unless a field uses that key. A field keyed id, created_at or form_version never replaces these columns; its column is named field_id, field_created_at or field_form_version. Then time_<key>_ms for each field that is not hidden, with the focused time of that question, and time_total_ms; both are empty for submissions without timing. Then order_<key> for each field whose option order is stored, with the option values in the order the respondent saw them, unless a field uses that key. Arrays join with ; . File fields show the file name. Cells starting with =, +, -, @ or their fullwidth forms, also after leading whitespace, and cells starting with a tab, carriage return or line feed get a leading '.

Delete ​

DELETE /v1/forms/{id}/submissions/{submission} deletes one submission and answers 204. An unknown id answers 404.

POST /v1/forms/{id}/submissions/delete deletes by id or by date. Send ids (1 to 100) or before (RFC 3339, not later than now), not both. A later before answers 400 invalid_before.

bash
curl -X POST https://api.formhaus.dev/v1/forms/Xk3d9QpL2a/submissions/delete \
  -H "Authorization: Bearer $FORMHAUS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"ids":["0b8e8a52-6c1b-4f4e-9d0a-2f4f7d3c1a9e"]}'
json
{ "deleted": 1, "complete": true }

{"before": "2026-01-01T00:00:00Z"} deletes every submission created before that time. Unknown ids and ids of other forms are skipped. Deleting also removes uploaded files and webhook delivery records. This cannot be undone.

One request deletes for up to 10 seconds. When more submissions match before, the answer is 200 with "complete": false and the number deleted so far; send the same request again to delete the rest. If an error stops the request after some submissions were deleted, the error body also has deleted and "complete": false.

Deleting by id needs the editor or owner role. Deleting by before needs the owner role; fh_live_ keys act as editors, so they answer 403 forbidden. Agent keys answer 403 owner_key_required. A form paused after abuse reports answers 403 paused_by_moderation.

Import ​

POST /v1/forms/{id}/submissions/import adds responses collected elsewhere, such as an export from another form tool. The body holds 1 to 500 responses and is up to 1 MB.

FieldValue
valuesRequired. Field key to answer, in the shapes the form takes: an option value for radio and select, an array of option values for multiselect, a number for number, scale and rating, true or false for checkbox and switch
submitted_atRequired. RFC 3339 time the response was sent, from 2000 up to now. Becomes created_at.
external_idOptional. Up to 200 characters, such as the response id in the other tool. Unique per form.
bash
curl -X POST https://api.formhaus.dev/v1/forms/Xk3d9QpL2a/submissions/import \
  -H "Authorization: Bearer $FORMHAUS_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"responses":[{"values":{"email":"ada@example.com","plan":"pro"},"submitted_at":"2025-03-04T10:00:00Z","external_id":"tf_8a2c"}]}'
json
{ "imported": 1, "skipped": 0, "errors": [] }

Each response is checked against the latest version of the form and imported or rejected on its own. errors lists rejected responses by index with external_id and message: an unknown key, an unknown option, a wrong type, a file field, or a bad submitted_at. Empty strings, null and empty arrays count as unanswered, and missing answers are accepted also for required fields. Answers to fields that the form logic hides are dropped. A response whose external_id is already in the form is counted in skipped, so the same import can be sent again.

Imported responses have "imported": true and their external_id. They appear in lists, stats and CSV exports, never send webhooks or emails, are not checked for spam and do not count toward monthly usage. A workspace holds up to 10,000 imported responses. A request that would go over answers 402 limit_reached and imports nothing. Imports share one rate limit per workspace, across keys. Importing needs the editor or owner role; agent keys answer 403 owner_key_required.

Stats ​

GET /v1/forms/{id}/stats returns response counts over time and an aggregate per question of the latest version. It returns no answer text.

QueryValue
sinceRFC 3339 timestamp. Responses at or after it. Default: the earlier of the form's creation and its first response; interval grows to week or month when that span has more than 366 buckets.
untilRFC 3339 timestamp. Responses before it. Default: now.
intervalday (default), week (from Monday) or month. Buckets are in UTC.

A range of more than 366 buckets answers 400 invalid_range; narrow it or use a longer interval. An unknown interval answers 400 invalid_interval.

bash
curl "https://api.formhaus.dev/v1/forms/Xk3d9QpL2a/stats?since=2026-10-01T00:00:00Z&until=2026-10-15T00:00:00Z&interval=week" \
  -H "Authorization: Bearer $FORMHAUS_API_KEY"
json
{
  "form_id": "Xk3d9QpL2a",
  "since": "2026-10-01T00:00:00Z",
  "until": "2026-10-15T00:00:00Z",
  "interval": "week",
  "total": 42,
  "series": [
    { "start": "2026-09-28T00:00:00Z", "count": 11 },
    { "start": "2026-10-05T00:00:00Z", "count": 24 },
    { "start": "2026-10-12T00:00:00Z", "count": 7 }
  ],
  "fields": [
    {
      "key": "plan", "label": "Plan", "type": "radio", "kind": "choice",
      "answered": 40, "skipped": 2,
      "options": [
        { "value": "free", "label": "Free", "count": 25 },
        { "value": "pro", "label": "Pro", "count": 14 }
      ],
      "other": 1
    },
    {
      "key": "nps", "label": "How likely are you to recommend us?", "type": "scale", "kind": "nps",
      "answered": 38, "skipped": 4,
      "points": [
        { "value": "0", "label": "Not at all likely", "count": 1 },
        { "value": "1", "label": "", "count": 0 },
        { "value": "10", "label": "Extremely likely", "count": 15 }
      ],
      "mean": 8.2, "median": 9,
      "nps": { "score": 42, "promoters": 22, "passives": 10, "detractors": 6 }
    },
    {
      "key": "seats", "label": "Seats", "type": "number", "kind": "number",
      "answered": 30, "skipped": 12,
      "numbers": { "count": 30, "min": 1, "max": 250, "mean": 18.4 }
    },
    { "key": "feedback", "label": "Feedback", "type": "textarea", "kind": "text", "answered": 17, "skipped": 25 }
  ],
  "steps": [
    { "id": "about", "title": "About you", "reached": 42 },
    { "id": "team", "title": "Your team", "reached": 31 }
  ],
  "timing": {
    "responses": 38,
    "total_median_ms": 154000,
    "questions": [
      { "key": "plan", "label": "Plan", "responses": 38, "median_ms": 6200, "p75_ms": 9800 },
      { "key": "feedback", "label": "Feedback", "responses": 17, "median_ms": 75000, "p75_ms": 95000 }
    ]
  }
}

points lists every point of the scale; the example is shortened. The first and last bucket cover the whole interval that holds since or until, but count only responses in the range.

kindField typesExtra keys
choiceselect, radio, multiselect, checkbox, switchoptions with a count per option, other for values that are not options of the latest version. A multiselect answer counts once per option. Matrix rows also have matrix, the key of their section, and matrix_title.
scalescale, ratingpoints with a count per point, mean, median. Answers outside the range count as skipped.
npsscale from 0 to 10The scale keys and nps: score from -100 to 100, promoters (9, 10), passives (7, 8), detractors (0 to 6).
numbernumbernumbers: count of numeric answers, min, max, mean
textEvery other typeNone

answered counts non-empty answers and skipped is total - answered. mean and median are absent when nothing was answered. steps is present for multi-step forms: reached counts the responses whose path did not skip the step by branching. Only submitted responses are stored, so this is not a drop-off funnel. timing is present when responses in the range were timed, which the hosted page and the embed do: responses counts the timed responses (the latest 2,000 at most), total_median_ms is the median time to complete the form and questions holds the median and 75th percentile of the time each question was focused. Statistics need the same read access as submissions and take 5 seconds at most; a longer query answers 503 stats_timeout.

Update settings ​

PATCH /v1/forms/{id} with any of these fields. Omitted fields stay.

FieldValue
webhook_urlPublic https:// URL, "" removes it. See Webhooks.
notify_modemilestones or off. See Email notifications.
notify_emailDeprecated: true is milestones, false is off. A value that conflicts with notify_mode is rejected.
success_messageUp to 500 characters, "" removes it
redirect_urlhttp(s) URL, "" removes it
allow_another_responsetrue shows a Submit another response button on the success screen of the hosted page and embed. No effect while redirect_url is set.
allowed_domainsList of domains like example.com or *.example.com that may load and submit the form in a browser. [] allows every website. A form allows 3; more answers 402 allowed_domains_limit. See Allowed domains.
statusactive or paused
endingsUp to 10 endings that replace the success message or redirect when their conditions match. Replaces the list, [] removes them. See Endings.
folder_idMove the form into this folder; null or "" takes it out
json
{
  "form_id": "Xk3d9QpL2a",
  "status": "active",
  "success_message": "Thanks, you are on the list.",
  "redirect_url": "",
  "allow_another_response": false,
  "notify_mode": "milestones",
  "notify_email": true,
  "webhook_url": "https://example.com/api/formhaus",
  "webhook_secret": "whsec_…9f3a",
  "allowed_domains": ["*.example.com"],
  "endings": [],
  "folder_id": null
}

A form paused after abuse reports answers 403 paused_by_moderation to status changes.

Webhook ​

GET /v1/forms/{id}/webhook returns url, secret (full with ?reveal=true) and deliveries. POST /v1/forms/{id}/webhook/test returns ok, status_code, duration_ms and error. POST /v1/forms/{id}/submissions/{submission}/webhook/replay queues a resend and answers 202. Details in Webhooks.