Developer Documentation
Integrate YourForm directly into your application. Build custom forms, handle submissions programmatically, and manage your data with our powerful API and SDKs.
Authentication
Build safe and secure integrations by managing your API keys in the dashboard.
Client-Side Usage
If you are using the SDK or API on the client-side (in a browser), you must whitelist your domain in the Dashboard settings. Backend usage does not require origin whitelisting.
Rate Limiting
YourForm API uses a rate-limiting system to ensure stability and fair usage.
| Scope | Limit | Description |
|---|---|---|
| Form Submission (Per IP) | 20 req / 1 min | Limit per user IP address to prevent abuse. |
| Form Submission (Daily Limit) | 1000 req / day | Per Form. Total submissions allowed per day. |
| Retrieve Form (API) | 60 req / 1 min | Per API Key For fetching form details. |
| Public Form Access | 100 req / 1 min | Per IP. For viewing public forms. |
Response Headers
SDK Reference
The YourForm SDK provides a type-safe interface for interacting with your forms programmatically.
Installation
Basic Usage
Advanced Examples
List Forms
Get Form Details
Create the Form
Define your questions and set unique slugs. Slugs act as the durable API keys for your data fields.
Supported Question Types
Form Styles
Go Live
Forms start as DRAFT. Use the publish() method to enable public submissions and generate your Google Sheet.
Receive Data
Submit responses using a clean JSON payload. Mapping is simple: the key is your Slug, and the value is the User's Answer.
Error Handling
All SDK methods throw standard errors that you can catch and handle. Common errors include ValidationError, AuthenticationError, and RateLimitError.
Headless Implementation (Next.js)
Build a 100% custom UI while YourForm handles the backend, Google Sheets, and integrations. This "Twin-Pattern" keeps your API keys secure by splitting logic between Server and Client.
Find your Form ID
To start, you need the formId. You can get this from the dashboard URL or programmatically using the SDK.
Fetch & Cache Schema (Server-side)
Fetch your form definition once. **Do not call this API on every user request.** Cache the response in a variable or a file. Re-fetch only if you change your questions or slugs in the dashboard.
Build Secure Submission Flow
For 100% security, we recommend the "Twin-Pattern": fetch schema on the server, but also submit from the server. This keeps your API keys completely hidden from the browser.
3.1 Configure Environment
Create a .env.local file in your project root. Add your Secret Key here. Never commit this file to Git.
3.2 Create Server Action
Create a Server Action to handle the sensitive submission logic. This code runs only on your server.
3.3 Build Client Form
Now build your UI component. Use useActionState (available in React 19 / Next.js 15) to handle the server action response gracefully.
Securing Webhooks
Verify the HMAC Signature sent in the headers to ensure payloads are authentic.
Verification Example (Next.js App Router)
Create an API route at app/api/webhook/route.ts to handle incoming events.