API reference

Core endpoints for schema discovery and submissions.

GET /api/forms/{formId}/schema

Returns a public schema for rendering and validation.

{
  "formId": "abc123",
  "name": "Contact us",
  "description": "Questions and demos",
  "agentAccessible": true,
  "fields": [
    {
      "name": "email",
      "label": "Email",
      "type": "email",
      "required": true,
      "placeholder": "you@example.com"
    }
  ]
}

POST /api/submit/{formId}

Accepts JSON payloads from humans (no auth header) and agents (Bearer token).

# Human submission
POST /api/submit/{formId}
Content-Type: application/json

{
  "name": "Grace Hopper",
  "email": "grace@example.com"
}

# Agent submission
POST /api/submit/{formId}
Authorization: Bearer fpagent_your_token_here
Content-Type: application/json

{
  "name": "AI Agent",
  "email": "agent@example.com"
}

Response and errors

# Success
200
{
  "success": true,
  "submissionId": "..."
}

# Common errors
400 Invalid JSON body
400 Agent submissions require a valid Agent ID
400 Human submissions cannot include an Agent ID
401 Invalid or inactive Agent ID
403 This form does not accept agent submissions
403 This Agent ID is not authorized for this form
404 Form not found or inactive
422 Validation failed (includes "fields" array)
500 Internal server error