API Docs — AgentForms
API Reference v1.0

AgentForms API

Build, manage, and submit forms programmatically. RESTful endpoints with JSON responses, webhook support, and real-time analytics.

Authentication

All API requests require authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY_HERE

Generate API keys in your account settings.

API Reference

All endpoints use the base URL https://agentforms.io.

GET /api/v1/sites

List all sites for the authenticated user.

Response

sites[] array List of site objects
sites[].id string Unique site identifier
sites[].name string Display name
GET /api/v1/sites/{siteId}/submissions

List form submissions for a specific site.

Parameters

siteId string Site identifier (path parameter) required
limit integer Max results per page (default: 50)
offset integer Pagination offset (default: 0)
GET /api/v1/sites/{siteId}/submissions/{submissionId}

Retrieve a single submission by ID.

Parameters

siteId string Site identifier required
submissionId string Submission identifier required
POST /api/v1/sites/{siteId}/submissions

Submit form data to a specific site.

Request Body

data object Key-value pairs matching your form fields required
data.* any Arbitrary field values
GET /api/v1/sites/{siteId}/fields

List form field definitions for a site.

GET /api/v1/sites/{siteId}/analytics

Get analytics data for a site.

Parameters

period string Time range: 7d, 30d, 90d
POST /api/v1/sites/{siteId}/export

Export submissions as CSV, JSON, or PDF.

Request Body

format string Export format: csv, json, pdf required
GET /api/v1/sites/{siteId}/documents

List documents associated with a site.

GET /api/v1/webhooks

List all configured webhooks for the authenticated user.

POST /api/v1/webhooks

Create a webhook for real-time notifications.

Request Body

site_id string Site to attach the webhook to
url string Target webhook URL required
events[] array Events to subscribe to (e.g., submission.created) required

Quick Start

Copy-paste examples to get up and running.

Submit Form Data

curl -X POST https://agentforms.io/api/v1/sites/{siteId}/submissions \
  -H "Authorization: Bearer YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"data": {"name": "John Doe", "email": "john@example.com", "message": "Hello!"}}'

Get Submissions

curl -X GET "https://agentforms.io/api/v1/sites/{siteId}/submissions?limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY_HERE"

Create Webhook

curl -X POST https://agentforms.io/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-app.com/webhook", "events": ["submission.created"]}'

More Info

Base URL https://agentforms.io
OpenAPI Spec /api/docs/openapi.json
Support Contact Support
Status System Status