Forms API

Create, read, update, and delete forms programmatically.

GET/api/forms

List all forms

Returns a list of all forms for the authenticated user.

Response

JSON
{
  "forms": [
    {
      "id": "form_abc123",
      "title": "Contact Form",
      "status": "published",
      "created_at": "2025-01-15T10:30:00Z",
      "response_count": 42
    }
  ],
  "total": 1
}
POST/api/forms

Create a form

Creates a new form with the specified configuration.

Request body

JSON
{
  "title": "Contact Form",
  "description": "Get in touch with us",
  "questions": [
    {
      "type": "text",
      "title": "Your name",
      "required": true
    },
    {
      "type": "email",
      "title": "Email address",
      "required": true
    }
  ]
}

Response

JSON
{
  "id": "form_abc123",
  "title": "Contact Form",
  "status": "draft",
  "created_at": "2025-01-15T10:30:00Z"
}
GET/api/forms/:id

Get a form

Returns the full form configuration including all questions.

Response

JSON
{
  "id": "form_abc123",
  "title": "Contact Form",
  "description": "Get in touch with us",
  "status": "published",
  "questions": [...],
  "theme": {...},
  "settings": {...}
}
DELETE/api/forms/:id

Delete a form

Permanently deletes a form and all its responses.

Response

JSON
{
  "success": true
}