Agents
Public Fill
NativeForm exposes a dedicated public agent-fill protocol. Agents discover the schema from the manifest, create drafts, then submit directly or through confirmation links.
For private management APIs that require authentication, use API keys and follow the Agents Auth guide.
AI agents visiting nativeform.app can find a short guide at If you're an AI.
Endpoints
Canonical public routes for AI-assisted form filling. No API key required.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/public/forms/{slug}/ai-manifest | Returns the form schema, field definitions, rate limits, and agent instructions.
|
| POST | /api/public/forms/{slug}/drafts | Creates a draft response with partial or complete answers.
|
| POST | /api/public/forms/{slug}/submissions | Finalizes a draft into a submitted response.
|
| GET | /api/public/confirm/{token} | Renders the human confirmation page for a draft.
|
| POST | /api/public/confirm/{token} | Confirms and submits the draft via the human review flow.
|
Draft Request
Create a draft response with partial or complete answers.
/api/public/forms/{slug}/draftsRequest Body
answersarrayRequiredArray of field answers. Each entry maps a fieldKey to its value.
fieldKeystringThe key of the form field to fill.
valuestring | number | booleanThe answer value matching the field type.
respondentobjectOptional identification of the person submitting.
externalIdstringYour application's user ID.
displayNamestringDisplay name shown in responses.
contactobjectContact info, e.g. { email: "ada@lovelace.ai" }.
metadataRecord<string, unknown>Optional metadata stored with the response for tracking purposes.
Example request
Example response
Submit Request
Finalize a draft into a submitted response.
/api/public/forms/{slug}/submissionsRequest Body
draftIdstringRequiredThe draft ID returned from the drafts endpoint.
answersarrayRequiredComplete set of field answers. Must include all required fields.
fieldKeystringThe key of the form field.
valuestring | number | booleanThe final answer value.
Example request
ChatGPT Fallback
If an assistant cannot call APIs directly, return confirmation.webUrl. The user opens the link and confirms submission in a human UI.
1. Create draft
Agent creates a draft through POST /api/public/forms/{slug}/drafts.
2. Share confirmation link
Agent shares confirmation.webUrl with the user as a clickable link.
3. User confirms
User opens /public/confirm/{token} and reviews prefilled answers before confirming submission.
Discovery
Public form pages and embed pages include machine-readable markers and JSON instructions for agents.
HTML meta tags
Public form pages expose nativeform:ai-manifest and nativeform-agent-instructions meta tags for agent discovery.
AI manifest endpoint
Read schema, field definitions, and rate limits from /api/public/forms/{slug}/ai-manifest.
Required headers
Send x-nativeform-agent (required) plus optional version and channel headers when posting drafts and submissions.
Error handling
Handle 422 fieldErrors and 429 Retry-After without dropping collected context.
Errors
Public endpoints return typed error envelopes with stable codes.
| Status | Code | Description |
|---|---|---|
| 422 | VALIDATION_ERROR | One or more fields failed validation. Check fieldErrors for per-field details and prompt the user for corrections. |
| 403 | POLICY_DISABLED | Public AI fill is disabled for this form. The form owner must enable it in form settings. |
| 429 | RATE_LIMITED | Too many requests. Honor the Retry-After header and back off before retrying. |
| 400 | INVALID_CONFIRM_TOKEN | The confirmation token is expired or invalid. Create a new draft to get a fresh token. |
fieldErrors for precise follow-up prompts and honor Retry-After on 429 responses.