GET
Forms
Forms API
https://api.airogelcms.com/v1/accounts/:account_id/forms
Forms are configurations that define how user-submitted data is captured and stored. Each form links to a collection (where submissions are stored as entries) and a blueprint (which defines the form fields).
Supported Operations
- GET /v1/accounts/:account_id/forms - List forms
- GET /v1/accounts/:account_id/forms/:id - Get a form
- POST /v1/accounts/:account_id/forms - Create a form
- PUT /v1/accounts/:account_id/forms/:id - Update a form
- DELETE /v1/accounts/:account_id/forms/:id - Delete a form
Create Fields
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | yes | Display name |
| handle | string | no | URL-friendly identifier (auto-generated from title) |
| collection_handle | string | yes | Collection where submissions are stored |
| blueprint_handle | string | yes | Blueprint defining form fields |
| redirect_url | string | no | URL to redirect after successful submission |
| success_message | string | no | Flash message shown after submission |
| honeypot_enabled | boolean | no | Enable spam protection honeypot field |
Note: The blueprint must belong to the specified collection.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id
|
string | Required | Your account ID |
handle
|
string | Optional | Filter by exact handle match |
page
|
integer | Optional | Page number (default: 1) |
Request Example
# Create form
curl -X POST \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Contact Form",
"handle": "contact",
"collection_handle": "submissions",
"blueprint_handle": "contact-form",
"redirect_url": "/thank-you",
"success_message": "Thanks for your message!",
"honeypot_enabled": true
}' \
https://api.airogelcms.com/v1/accounts/$ACCOUNT_ID/forms
# Update form
curl -X PUT \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Contact Form",
"honeypot_enabled": false
}' \
https://api.airogelcms.com/v1/accounts/$ACCOUNT_ID/forms/contact
Response Example
{
"id": "form_abc123",
"handle": "contact",
"title": "Contact Form",
"collection_handle": "submissions",
"collection_id": "clctn_xyz789",
"blueprint_handle": "contact-form",
"blueprint_id": "blprt_def456",
"redirect_url": "/thank-you",
"success_message": "Thanks for your message!",
"honeypot_enabled": true,
"created_at": "2025-01-08T12:00:00Z",
"updated_at": "2025-01-08T12:00:00Z",
"fields": [
{
"handle": "name",
"display": "Your Name",
"type": "BlueprintFieldText",
"position": 1,
"options": {}
},
{
"handle": "email",
"display": "Email Address",
"type": "BlueprintFieldText",
"position": 2,
"options": {}
},
{
"handle": "message",
"display": "Message",
"type": "BlueprintFieldRichText",
"position": 3,
"options": {}
}
]
}
Additional Notes
Form submission flow: Forms are rendered on the frontend using Liquid templates and submitted to POST /cms/:handle/submit. This creates a new CollectionEntry in the form's collection.
The API is for managing form configurations, not for submitting form data.
Honeypot protection: When enabled, adds a hidden field to catch spam bots. Submissions that fill this field are rejected.