# BlokForms — Complete Developer & AI Agent Reference
> Canonical URL: https://blokforms.com/llms-full.txt
> MCP Server: https://api.blokforms.com/mcp (Streamable HTTP, Authorization: Bearer bf_pat_...)
> OpenAPI 3.1: https://api.blokforms.com/api/v1/openapi.json
> Delivery CDN: https://cdn.blokforms.com
> Pricing: Free tier (with limits) + Pro (€19/mo) & Business (€49/mo) currently €0 in Early Access (EU-hosted on Cloudflare)
---
# BlokForms Quickstart
BlokForms is an EU-hosted form platform with conditional logic, EU payments (Mollie & Stripe), PDF generation, e-signatures (BlokForms Sign), multi-step approval workflows, appointment slot booking, native integrations, and a 32-tool MCP server for AI agents. A permanent Free tier (up to 5 forms, 250 submissions/month) is available, and all Pro (€19/month) and Business (€49/month) features are currently free during Early Access.
## Production Endpoints
| Service | Base URL | Purpose |
| --- | --- | --- |
| Website & Docs | `https://blokforms.com` | Marketing site, templates, docs, `/llms.txt`, `/skill/SKILL.md` |
| Admin Studio | `https://app.blokforms.com` | Visual form studio, submissions inbox, analytics, team settings |
| Management API & MCP | `https://api.blokforms.com` | REST API (`/api/v1/*`), OpenAPI 3.1 (`/api/v1/openapi.json`), MCP (`/mcp`) |
| Public Edge Delivery | `https://cdn.blokforms.com` | Hosted forms (`/f/:id`), `embed.js`, submissions, uploads, slots, approvals, signing |
## 1. Create a Workspace & Form
1. Sign in at `https://app.blokforms.com` with email OTP (no passwords to manage).
2. Create a **Project** (add your website origins under *Allowed origins*, e.g. `https://yoursite.eu`).
3. Click **New form** and choose one of **16 templates**, start from blank, or describe what you need in **Generate with AI** (EN, NL, DE, FR, or ES).
4. Click **Save** in Form Studio to publish instantly to the Cloudflare edge cache.
## 2. Embed or Share Your Form
### Option A: Zero-dependency script embed (any HTML site)
```html
```
### Option B: React & Next.js SDK
```bash
npm install @blokforms/react
```
```tsx
import { BlokForm } from "@blokforms/react";
export function ContactForm() {
return (
{
console.log("Recorded:", submissionId, message);
}}
/>
);
}
```
### Option C: Direct EU-Hosted Link
Share `https://cdn.blokforms.com/f/YOUR_ORG/YOUR_PROJECT/YOUR_FORM` or download an SVG/PNG QR code from the **Share** tab in Studio.
## 3. Connect an AI Agent (MCP)
Create a Personal Access Token (`bf_pat_...`) under **Workspace settings -> Developers & API**, then connect Claude Code, Cursor, Codex, or Antigravity:
```bash
claude mcp add --transport http blokforms https://api.blokforms.com/mcp \
--header "Authorization: Bearer bf_pat_YOUR_TOKEN"
```
See the [AI Agents & MCP Server](/docs/mcp) guide for all 32 tools and safe agent workflows.
---
# AI Agents & MCP Server
BlokForms ships with a stateless **Streamable HTTP Model Context Protocol (MCP)** server at `https://api.blokforms.com/mcp`. Every tool executes directly against the same EU domain services as the Management REST API with scoped RBAC permissions.
## Machine-Readable Discovery Files
Point any AI coding agent or autonomous workflow at these URLs:
- `https://blokforms.com/llms.txt` (concise directory of docs, API, SDK, and MCP endpoints)
- `https://blokforms.com/llms-full.txt` (complete self-contained Markdown reference in one fetch)
- `https://blokforms.com/skill/SKILL.md` (drop-in Agent Skill file for coding agents)
- `https://blokforms.com/docs/.md` or send `Accept: text/markdown` to any `/docs/*` route
- `https://api.blokforms.com/api/v1/openapi.json` (live OpenAPI 3.1 JSON schema)
## Authentication (Personal Access Token)
1. Open `https://app.blokforms.com/organization` and select **Developers & API**.
2. Create a **Personal Access Token** (`bf_pat_...`) with the scopes your agent needs:
- `forms:read`, `forms:manage`
- `submissions:read`, `submissions:manage`
- `webhooks:manage`, `tokens:manage`
3. Pass `Authorization: Bearer bf_pat_...` to `https://api.blokforms.com/mcp`.
> **Security note:** Interactive `org.manage` operations (rotating Mollie/Stripe API keys and mutating custom domains) require an authenticated browser session and intentionally reject PATs with HTTP `403`.
## Client Configuration Examples
### Claude Code CLI
```bash
claude mcp add --transport http blokforms https://api.blokforms.com/mcp \
--header "Authorization: Bearer bf_pat_YOUR_TOKEN"
```
### Cursor / Windsurf / Antigravity (`mcp.json`)
```json
{
"mcpServers": {
"blokforms": {
"url": "https://api.blokforms.com/mcp",
"headers": {
"Authorization": "Bearer bf_pat_YOUR_TOKEN"
}
}
}
}
```
### Raw JSON-RPC Call (curl)
```bash
curl -X POST https://api.blokforms.com/mcp \
-H "Authorization: Bearer bf_pat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "generate_form_with_ai",
"arguments": {
"prompt": "Dutch consultation booking form with 30-min slots and GDPR consent",
"locale": "nl"
}
}
}'
```
## Complete Catalog of 32 MCP Tools
### Discovery (5 tools)
| Tool | Required Args | Description |
| --- | --- | --- |
| `list_projects` | none | List all active projects in the organization |
| `get_project` | `projectId` | Get project settings, allowed origins, and defaults |
| `list_forms` | `projectId?` | List forms in the org or a single project |
| `get_form` | `formId` | Get full form schema, fields, settings, theme, and translations |
| `list_form_templates` | none | List all 16 built-in starter templates |
### Authoring & AI Generation (6 tools)
| Tool | Required Args | Description |
| --- | --- | --- |
| `create_project` | `name`, `siteUrl?`, `allowedOrigins?` | Create a new project workspace |
| `generate_form_with_ai` | `prompt`, `locale?` | Generate a validated form blueprint in `en`, `nl`, `de`, or `fr` |
| `create_form` | `projectId`, `name`, `templateId?`, `fields?`, `settings?` | Create a live form from a template or custom field array |
| `update_form` | `formId`, `fields?`, `settings?`, `theme?`, `i18n?`, `active?` | Update form fields, logic, workflow, security, or theme |
| `duplicate_form` | `formId`, `name?` | Clone an existing form inside the same project |
| `delete_form` | `formId` | Permanently delete a form, submissions, and R2 uploads |
### Embedding & Distribution (1 tool)
| Tool | Required Args | Description |
| --- | --- | --- |
| `get_embed_snippets` | `formId` | Generate tailored `
```
## 2. Popup Modal Trigger
Attach `data-blokform-popup` to any button or link:
```html
```
Add `data-auto-open-ms="5000"` to automatically open the modal after 5 seconds.
## 3. Floating Slide-Over Drawer
```html
```
## 4. Responsive Iframe
```html
```
The hosted `/embed/:id` page automatically posts `{ type: "blokforms:resize", formId, height }` via `window.postMessage` for auto-resizing iframes.
## 5. JavaScript Events & Programmatic API
```js
document.addEventListener("blokform:success", (event) => {
const { submissionId, message, booking, payment } = event.detail;
console.log("Submitted:", submissionId, booking?.icsUrl);
});
document.addEventListener("blokform:error", (event) => {
console.warn("Validation or submit error:", event.detail);
});
// Programmatic popup or drawer launch
window.BlokForms?.openPopup({
formId: "frm_YOUR_FORM_ID",
title: "Request a quote",
locale: "nl",
});
```
## 6. CSS Theme Tokens & URL Prefill
Override any custom property on the container element:
```css
[data-blokform="frm_YOUR_FORM_ID"] {
--bf-accent: #059669;
--bf-accent-hover: #047857;
--bf-radius: 0.5rem;
--bf-font: "Inter", system-ui, sans-serif;
}
```
Prefill any input field via query string when `allowPrefill` is enabled (default `true`):
```text
https://yoursite.eu/contact?full_name=Ada+Lovelace&email=ada@example.eu&utm_source=newsletter
```
---
# React & Headless SDK
BlokForms publishes three ESM + TypeScript npm packages under the `@blokforms` scope:
- `@blokforms/react` — `` component and `useBlokForm()` React hook (React 18 & 19)
- `@blokforms/client` — framework-agnostic headless controller (`createFormController`)
- `@blokforms/core` — shared types, validator, logic engine, VAT calculator, and appointment slot math
## Install
```bash
npm install @blokforms/react
# Or for Vue, Svelte, Angular, or vanilla TypeScript:
npm install @blokforms/client
```
## Quick Start with ``
```tsx
import { BlokForm } from "@blokforms/react";
export function LeadCaptureForm() {
return (
{
console.log("Submission ID:", payload.submissionId);
if (payload.booking?.icsUrl) {
console.log("Calendar invite:", payload.booking.icsUrl);
}
}}
onError={(error, fieldErrors) => {
console.error(error, fieldErrors);
}}
/>
);
}
```
## Custom UI Overrides (`components` prop)
Replace field wrappers, submit buttons, or success screens with your own Tailwind or design system components while keeping validation, uploads, appointments, and password gates handled automatically:
```tsx
(
{children}
{error ?
{error}
: null}
),
SubmitButton: ({ label, submitting }) => (
),
}}
/>
```
## Headless Hook (`useBlokForm`)
```tsx
import { useBlokForm } from "@blokforms/react";
export function CustomBookingForm() {
const { controller, state } = useBlokForm({
formId: "frm_YOUR_FORM_ID",
baseUrl: "https://cdn.blokforms.com",
});
if (state.isLocked) {
return (
);
}
return (
);
}
```
## Framework-Agnostic Controller (`@blokforms/client`)
```ts
import { createFormController } from "@blokforms/client";
const ctrl = createFormController({
formId: "frm_YOUR_FORM_ID",
baseUrl: "https://cdn.blokforms.com",
});
ctrl.subscribe(() => {
const s = ctrl.getState();
console.log(s.status, s.visibleFields.length, s.fieldErrors);
});
await ctrl.load();
await ctrl.fetchAppointmentSlots("appointment_slot", "2026-12-10");
ctrl.setValue("email", "ada@example.eu");
await ctrl.submit();
```
---
# Fields, Logic & Formulas
Both the REST API (`create_form` / `update_form`) and MCP tools accept a strongly validated `fields` array plus `settings.logicRules`.
## Supported Field Types
### Input Fields (20 types)
| `type` | Description & Key Properties |
| --- | --- |
| `text` | Single-line text; optional `format`: `"iban"`, `"vat_eu"`, `"postal_nl"`, `"postal_eu"`, `"phone_eu"`, `"kvk_nl"` |
| `email` | Validated email address (first email field populates `submitterEmail`) |
| `textarea` | Multi-line text (`rows`, `minLength`, `maxLength`) |
| `number` | Numeric value (`min`, `max`, `step`) |
| `tel` | Telephone number |
| `url` | HTTP/HTTPS URL |
| `date` | ISO `YYYY-MM-DD` date (`min`, `max` support `"today"`) |
| `time` | `HH:MM` time |
| `select` | Dropdown menu (`options: [{ value, label, calcValue? }]`) |
| `radio` | Single-choice radio buttons (`options`) |
| `checkboxes` | Multi-select checkboxes (`options`, `minSelected`, `maxSelected`) |
| `checkbox` | Boolean checkbox (`checkboxLabel`) |
| `consent` | Mandatory GDPR consent checkbox (`privacyUrl`, `privacyLabel`) |
| `file` | Two-step private EU R2 upload (`accept[]`, `maxSize`, `max`) |
| `hidden` | Hidden value populated from URL query param (`fromQuery`) |
| `signature` | HTML5 canvas signature pad uploaded as PNG to EU R2 (`height`, `penColor`) |
| `rating` | Star rating (`style: "stars"`, 1-5) or NPS scale (`style: "scale"`, 0-10) |
| `matrix` | Grid of `rows[]` x `columns[]` (`cellType: "radio" | "checkbox" | "text"`) |
| `address` | Structured EU address (`street`, `houseNumber`, `postalCode`, `city`, `country`) |
| `repeater` | Dynamic repeatable list of `subFields[]` (`minRows`, `maxRows`, `addLabel`) |
| `image_choice` | Visual choice cards with `imageUrl`, `columns`, `multiple` |
| `calculation` | Safe read-only math field (`formula`, `prefix`, `suffix`, `decimals`, `hidden`) |
| `product_list` | EU order catalog / donation / fixed amount with `vatRatePercent`, `pricesIncludeVat`, `coupons[]`, `stockLimit` |
| `appointment` | Live time-slot booking (`durationMinutes`, `bufferMinutes`, `maxBookingsPerSlot`, `timezone`, `availableDays`, `startTime`, `endTime`) |
### Layout Blocks (5 types)
`heading` (`level: 2|3|4`), `paragraph` (`content`), `divider` (`style: "solid"|"dashed"|"dotted"`), `image` (`src`, `alt`, `caption`), and `section` (starts a new multi-step page with `nextLabel` / `prevLabel`).
## Conditional Visibility (`showIf`)
Every field may define a single `ShowIfRule` or compound `ShowIfGroup` (`match: "all" | "any"`). Referenced fields **must appear earlier** in the `fields` array so visibility is strictly acyclic:
```json
{
"id": "fld_vat",
"type": "text",
"name": "vat_number",
"label": "EU VAT number",
"format": "vat_eu",
"showIf": {
"match": "all",
"rules": [
{ "field": "customer_type", "operator": "eq", "value": "business" },
{ "field": "country", "operator": "neq", "value": "non_eu" }
]
}
}
```
Supported operators: `eq`, `neq`, `in`, `not_in`, `contains`, `filled`, `empty`, `gt`, `gte`, `lt`, `lte`.
## Form-Level Logic Rules (`settings.logicRules`)
| Action `type` | Behavior |
| --- | --- |
| `skip_step` | Skip a `section` step (`targetStep`) when condition matches |
| `set_value` | Assign a literal or calculated value to `targetField` |
| `set_required` | Dynamically toggle `required: true | false` on `targetField` |
| `set_disabled` | Dynamically disable `targetField` |
| `thank_you` | Override confirmation `message` or safe `redirectUrl` on submit |
## Safe Calculations & Answer Piping
- Calculations use a sandboxed recursive-descent parser (zero `eval`): `{seats} * 49 + count(attendees) * 15`.
- Functions supported: `round()`, `ceil()`, `floor()`, `abs()`, `min()`, `max()`, `count(field)`.
- **Answer Piping:** Use `{{field_name}}` inside labels, paragraphs, success messages, auto-responder emails, PDF filenames, and BlokForms Sign agreement bodies.
---
# Workflows, Payments, Signing & Integrations
## Multi-Step Approval Workflows
Enable `settings.workflow` on any form to route incoming submissions through ordered approval steps:
```json
{
"workflow": {
"enabled": true,
"steps": [
{
"id": "step_mgr",
"name": "Manager Review",
"order": 1,
"approverEmail": "manager@company.eu",
"approverName": "Operations Lead",
"reminderAfterHours": 24
},
{
"id": "step_cfo",
"name": "Finance Sign-off",
"order": 2,
"approverEmail": "finance@company.eu",
"condition": { "field": "amount_eur", "operator": "gte", "value": 1000 }
}
],
"onApproved": { "setStatus": "read", "notifySubmitter": true },
"onDenied": { "setStatus": "archived", "notifySubmitter": true }
}
}
```
- Approvers receive a signed 1-click review link at `https://cdn.blokforms.com/approve/:token`.
- Team members can also approve or deny steps in Studio or via `POST /api/v1/approvals/:stepId/decide` (and the `decide_approval_step` MCP tool).
- The hourly EU cron automatically sends overdue reminders and daily/weekly Digest emails (`settings.digest`).
## Live Appointment Slot Booking
Adding an `appointment` field enables:
- Live slot availability lookup: `GET https://cdn.blokforms.com/f/:formId/slots?field=appointment_slot&date=2026-12-10`
- Server-side overbooking protection (HTTP `409 SLOT_UNAVAILABLE` when slot capacity is reached)
- Automatic RFC 5545 calendar invite download: `GET https://cdn.blokforms.com/f/:formId/bookings/:bookingId.ics`
- Emits the `booking.created` event to webhooks and native integrations
## EU Payments (Mollie & Stripe)
1. Connect **Mollie** (iDEAL, Bancontact, SEPA, Klarna) or **Stripe** under **Workspace settings -> Payments** (API keys are AES-256-GCM encrypted at rest).
2. Add a `product_list` or `calculation` field and enable `settings.payments`.
3. Submissions create a checkout session and return `payment.checkoutUrl`; webhooks at `/webhooks/mollie/:paymentId` and `/webhooks/stripe/:orgId` update transaction status and trigger receipt emails.
## PDF Documents & BlokForms Sign
- **PDF Generator (`settings.pdf.enabled: true`):** Generates A4 PDF 1.4 documents with WinAnsi EU character support, VAT order tables, and optional SHA-256 audit certificates stored in private EU R2.
- **BlokForms Sign (`settings.signing.enabled: true`):** Auto-initiates multi-signer envelopes with 6-digit email OTP verification at `https://cdn.blokforms.com/sign/:token` and produces a tamper-evident signed PDF.
## Native Integrations & HMAC Webhooks
Connect encrypted integrations via Studio, `POST /api/v1/integrations`, or `create_form_integration` MCP tool:
| Provider | Required `config` keys |
| --- | --- |
| `slack` | `{ webhookUrl }` |
| `teams` | `{ webhookUrl }` |
| `notion` | `{ apiKey, databaseId, titleProperty? }` |
| `airtable` | `{ apiKey, baseId, tableName }` |
| `hubspot` | `{ apiKey }` |
| `google_sheets` | `{ webhookUrl }` |
| `make_zapier` | `{ webhookUrl }` |
Supported events: `submission.created`, `submission.spam`, `submission.updated`, `payment.paid`, `payment.failed`, `payment.refunded`, `signature.completed`, `signature.declined`, `approval.approved`, `approval.denied`, `booking.created`.
---
# REST API & Security
The full OpenAPI 3.1 specification is published live at:
```text
https://api.blokforms.com/api/v1/openapi.json
```
## Authentication
Pass a scoped Personal Access Token created in **Workspace settings -> Developers & API**:
```bash
curl https://api.blokforms.com/api/v1/forms \
-H "Authorization: Bearer bf_pat_YOUR_TOKEN"
```
## Key Management Endpoints (`https://api.blokforms.com`)
| Method & Path | Purpose |
| --- | --- |
| `GET /api/v1/templates` | List all 16 starter templates |
| `GET/POST /api/v1/projects` | List or create projects |
| `GET/POST /api/v1/projects/:projectId/forms` | List or create forms |
| `GET/PATCH/DELETE /api/v1/forms/:formId` | Read, update, or delete a form |
| `GET /api/v1/forms/:formId/snippets` | Get embed snippets (auto-uses verified custom domain) |
| `GET /api/v1/forms/:formId/submissions` | List or FTS5 search submissions (`?q=...`) |
| `GET /api/v1/forms/:formId/submissions/export` | Export as `?format=xlsx|csv|json` |
| `POST /api/v1/submissions/triage` | Bulk status update, assign, or delete (up to 200) |
| `GET /api/v1/forms/:formId/analytics` | Cookie-free conversion, funnel, UTM & device metrics |
| `GET /api/v1/forms/:formId/report` | Anonymized field distribution report |
| `GET /api/v1/forms/:formId/approvals` | List approval workflow runs |
| `POST /api/v1/approvals/:stepId/decide` | Approve or deny a pending workflow step |
| `GET /api/v1/forms/:formId/bookings` | List appointment bookings |
| `POST /api/v1/bookings/:bookingId/cancel` | Cancel a booking and reopen the slot |
| `GET/POST /api/v1/integrations` | List or create encrypted native integrations |
| `POST /api/v1/ai/generate-form` | Generate a validated form blueprint from a prompt |
| `POST /api/v1/forms/:formId/ai/ask` | Ask the AI Data Assistant (PII scrubbed by default) |
| `GET /api/v1/organization/audit-logs` | Inspect workspace audit log entries |
| `GET/POST /api/v1/organization/domains` | Manage agency custom domains & DoH TXT verification |
| `POST /api/v1/organization/gdpr/erase` | Preview (`dryRun: true`) or erase all data for an email |
## Public Edge Endpoints (`https://cdn.blokforms.com`)
| Method & Path | Purpose |
| --- | --- |
| `GET /v1/forms/:id/schema` | Edge-cached public form schema (`?locale=en|nl|de|fr`) |
| `POST /f/:id` | Submit JSON, multipart, or URL-encoded form data |
| `POST /f/:id/uploads` | Two-step private EU R2 file or signature upload |
| `GET /f/:id/slots?field=...&date=YYYY-MM-DD` | Live appointment slot availability |
| `GET /f/:id/bookings/:bookingId.ics` | Download RFC 5545 calendar invite |
| `POST /f/:id/unlock` | Verify password and issue a 12-hour HMAC unlock token |
| `POST /f/:id/drafts` & `GET /f/:id/drafts/:token` | Save & Continue Later drafts |
| `GET/POST /approve/:token(/decide)` | Hosted approval review and 1-click decision |
| `GET /sign/:token` | Hosted BlokForms Sign e-signature ceremony |
## Password-Protected Forms
When `settings.security.passwordEnabled` is `true`, `POST /f/:id` returns HTTP `401 PASSWORD_REQUIRED` unless unlocked. Call `POST /f/:id/unlock` with `{ "password": "..." }` to receive `{ "ok": true, "accessToken": "..." }`, then pass `X-BlokForms-Access: ` (or `_bf_access` in JSON) on submission.
## Verifying Webhook Signatures (HMAC-SHA256)
Every outbound webhook includes:
- `X-BlokForms-Event`
- `X-BlokForms-Delivery`
- `X-BlokForms-Timestamp` (Unix seconds)
- `X-BlokForms-Signature: t=,v1=`
Verify in Node.js or Cloudflare Workers:
```ts
import crypto from "node:crypto";
export function verifyBlokFormsWebhook(rawBody: string, header: string, secret: string): boolean {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (!parts.t || !parts.v1) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${parts.t}.${rawBody}`)
.digest("hex");
return crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}
```