Forms API
Create, read, update, and delete forms programmatically.
/api/formsList all forms
Returns a paginated list of forms for the authenticated user. Requires API key.
Response
{
"forms": [
{
"id": "form_abc123",
"title": "Contact Form",
"description": "Get in touch with us",
"published": true,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
],
"plan": "pro",
"pagination": {
"page": 1,
"limit": 50,
"total": 1,
"totalPages": 1
}
}/api/formsCreate a form
Creates a new form with the specified configuration. Requires API key.
Request body
{
"title": "Contact Form",
"description": "Get in touch with us",
"questions": [
{
"id": "q1",
"type": "short_text",
"title": "Your name",
"required": true
},
{
"id": "q2",
"type": "email",
"title": "Email address",
"required": true
},
{
"id": "q3",
"type": "long_text",
"title": "Message",
"required": false
}
],
"theme": {
"primaryColor": "#000000",
"backgroundColor": "#ffffff"
}
}Response
{
"id": "form_abc123",
"title": "Contact Form",
"published": false,
"created_at": "2025-01-15T10:30:00Z"
}/api/forms/:idGet a form
Returns the full form configuration. Published forms are publicly accessible.
Response
{
"id": "form_abc123",
"title": "Contact Form",
"description": "Get in touch with us",
"published": true,
"questions": [...],
"theme": {...},
"embed_settings": {...},
"allowed_domains": ["example.com"]
}/api/forms/:idUpdate a form
Update form configuration. Requires API key and form ownership.
Request body
{
"title": "Updated Contact Form",
"published": true
}Response
{
"id": "form_abc123",
"title": "Updated Contact Form",
"published": true,
"updated_at": "2025-01-15T11:00:00Z"
}/api/forms/:idDelete a form
Permanently deletes a form and all its responses. Requires API key.
Response
{ "success": true }Public submission endpoints
These endpoints are used by the embed SDK and don't require API key authentication. Instead, they use short-lived tokens for security.
/api/forms/:id/tokenGet embed token
Issues a signed token required for form submissions. Tokens expire after 30 minutes.
Response
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"expiresIn": 1800
}/api/forms/:id/submitSubmit a response
Submit form answers. Requires a valid embed token. Used by the embed SDK.
Request body
{
"answers": {
"q1": "John Doe",
"q2": "john@example.com",
"q3": "Hello, I have a question..."
},
"_token": "eyJhbGciOiJIUzI1NiIs...",
"fingerprint": "abc123...",
"clientMetadata": {
"screenWidth": 1920,
"screenHeight": 1080,
"language": "en-US",
"pageUrl": "https://example.com/contact"
}
}Response
{
"success": true,
"responseId": "resp_xyz789"
}Form blocks
See the Form Blocks reference for detailed settings and subtypes.
short_textFreelong_textFreeemailFreenumberFreephoneFreeurlFreedateFreedate_rangeFreecontactFreemultiple_choiceFreedropdownFreeyes_noFreecolor_pickerFreeratingFreestar_ratingFreenumber_ratingFreesliderFreerankingFreevideoProsignatureProfile_uploadPropaymentProtext_blockFreeconsentFreehiddenFreeError responses
form_not_found404Form does not existform_not_published403Form is not accepting responsesform_closed403Form closed by date or response limitdomain_not_allowed403Submission from unauthorized domaininvalid_token403Missing or expired embed tokenduplicate_submission400User already submitted (Pro+)rate_limited429Too many submissions from this IP