Skip to content

AI integrations, API, and MCP

SubmitOwl supports AI coding agents through the public API and a Model Context Protocol (MCP) server. These integrations are for server-side tools and local coding agents, not browser JavaScript.

Key Use
ak_... workspace API key Public API /v1 and MCP /mcp
sk_... server key Production server-side submissions to /f/{formId} only

Never print, commit, or place either key in browser or client-side code. For form integration, create an API key in Settings → API keys with the AI integration preset. The preset intentionally excludes submissions_write because integrating a form does not require changing submission state.

Browser forms submit directly to the public form endpoint without any key. Do not use an ak_ key for production form submission; SubmitOwl rejects it there.

Use the integrate_form MCP prompt, or copy the same prompt from a form’s Setup → Integrate with AI block. It tells the agent to inspect the project, choose or create a form, verify recipient state, preserve progressive enhancement, use only synthetic test data, send one test submission, run project checks, and avoid exposing keys.

Integrate a SubmitOwl form backend into this project.
Access and keys:
- Use the SubmitOwl MCP server (https://api.submitowl.com/mcp) if configured. Otherwise, use the public API at https://api.submitowl.com/v1.
- Workspace API keys (ak_) must come from the user's MCP config or environment. The key should use the dashboard's "AI integration" preset, or at minimum scopes forms_read, forms_write, recipients_read, recipients_write, and submissions_read; submissions_write is not needed for form integration. Never print, log, commit, or place ak_ keys in client-side code.
- Server keys (sk_) are separate from ak_ keys, used only for server-side production submissions, and must never appear in browser or client-side code. Browser forms submit directly to the public form endpoint without a key.
Steps:
1. Inspect the project's framework, existing form code, and available checks. Ask the user only if a required choice is missing, such as which form or recipient to use.
2. Choose an existing SubmitOwl form or create the right one. Check recipient verification first; if the needed recipient is not verified, stop and tell the user to verify that recipient before continuing.
3. Add the smallest framework-appropriate form markup or fetch integration, preserving progressive enhancement (working without JavaScript) wherever possible.
4. Send one test submission using synthetic placeholder data only.
5. Run available project checks (lint, typecheck, test, build).
Guardrails:
- Do not change unrelated design or copy.
- Do not use real personal data.
- Do not modify destinations, webhooks, Slack, or autoresponder settings, and never bypass recipient verification.
Finish by reporting the files changed, check and test submission results, and any remaining manual steps.

If the required recipient is not verified, the correct outcome is to stop and ask the user to verify that recipient. Do not bypass recipient verification.

The MCP endpoint is:

https://api.submitowl.com/mcp

It implements Streamable HTTP in stateless JSON mode. Clients should send:

Authorization: Bearer ak_your_workspace_key
Accept: application/json, text/event-stream

Browser clients are not supported; requests with an Origin header are rejected. GET and DELETE return 405 because SubmitOwl does not keep an MCP session stream open.

For Codex CLI, keep the key in an environment variable and configure the remote server:

Terminal window
codex mcp add submitowl \
--url https://api.submitowl.com/mcp \
--bearer-token-env-var SUBMITOWL_API_KEY

For Claude Code, add a remote HTTP MCP server with an authorization header using the current MCP configuration flow, for example:

Terminal window
claude mcp add --transport http submitowl https://api.submitowl.com/mcp \
--header "Authorization: Bearer $SUBMITOWL_API_KEY"

Other coding agents that support remote MCP servers can use the same URL and Authorization header. The command examples assume SUBMITOWL_API_KEY is already supplied by your shell environment or secret store; do not paste the key into a command, project file, shared terminal, shell history, documentation, or transcript.

Use Proxy/CLI mode rather than browser Direct mode, because browser Direct mode sends an Origin header:

Terminal window
npx @modelcontextprotocol/inspector --cli \
https://api.submitowl.com/mcp \
--transport http \
--header "Authorization: Bearer $SUBMITOWL_API_KEY" \
--method tools/list

Call a tool by name, for example:

Terminal window
npx @modelcontextprotocol/inspector --cli \
https://api.submitowl.com/mcp \
--transport http \
--header "Authorization: Bearer $SUBMITOWL_API_KEY" \
--method tools/call \
--tool-name get_workspace

MCP v1 exposes thin wrappers over the public API:

  • Workspace: get_workspace
  • Forms: list_forms, get_form, create_form, update_form_settings, get_form_setup, get_form_health, send_test_submission
  • Recipients: list_recipients, create_recipient
  • Submissions: list_submissions, get_submission, update_submission

MCP does not expose deleting resources, raw files, API key management, billing, account management, destination management, webhook/Slack/autoresponder management, or Held release.

If an agent does not support MCP, use the public API at:

https://api.submitowl.com/v1

Authenticate every request with Authorization: Bearer ak_your_workspace_key. GET /v1/me is the smallest connectivity check:

Terminal window
curl -H "Authorization: Bearer $SUBMITOWL_API_KEY" \
https://api.submitowl.com/v1/me

List forms with cursor pagination:

Terminal window
curl -H "Authorization: Bearer $SUBMITOWL_API_KEY" \
"https://api.submitowl.com/v1/forms?limit=100"

Create a form for verified recipient IDs:

Terminal window
curl -X POST \
-H "Authorization: Bearer $SUBMITOWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Contact form","recipient_ids":["rcp_example"]}' \
https://api.submitowl.com/v1/forms

Get setup details for a form:

Terminal window
curl -H "Authorization: Bearer $SUBMITOWL_API_KEY" \
https://api.submitowl.com/v1/forms/form_example/setup

Send one synthetic test submission:

Terminal window
curl -X POST \
-H "Authorization: Bearer $SUBMITOWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"email":"test@example.com","message":"Synthetic test submission"}}' \
https://api.submitowl.com/v1/forms/form_example/test-submission

List submissions in that form:

Terminal window
curl -H "Authorization: Bearer $SUBMITOWL_API_KEY" \
"https://api.submitowl.com/v1/forms/form_example/submissions?limit=100"
Scope Allows
forms_read List/read forms, setup, and health
forms_write Create forms, update form settings, send test submissions
recipients_read List recipients
recipients_write Create recipients and resend verification
submissions_read List/read submissions
submissions_write Archive, mark spam, or move submissions back to inbox

Write scopes do not imply read scopes. Missing scope returns 403 missing_scope; MCP converts that outcome into a tool error rather than hiding it as a transport failure.

Endpoint Scope
GET /v1/me any valid API key
GET /v1/forms, POST /v1/forms forms_read, forms_write
GET /v1/forms/{id}, PATCH /v1/forms/{id} forms_read, forms_write
GET /v1/forms/{id}/setup forms_read
GET /v1/forms/{id}/health forms_read
POST /v1/forms/{id}/test-submission forms_write
GET /v1/forms/{id}/submissions submissions_read
GET /v1/recipients, POST /v1/recipients recipients_read, recipients_write
POST /v1/recipients/{id}/resend recipients_write
GET /v1/submissions/{id}, PATCH /v1/submissions/{id} submissions_read, submissions_write
GET /v1/files/{id} submissions_read

The public API does not yet expose deletion, destination management, billing, account management, API key management, or Held release. GET /v1/files/{id} redirects to a short-lived signed file download URL; follow redirects only after confirming the destination is the expected SubmitOwl file host.

Successful responses use an envelope like { "ok": true, "data": ... }. Paginated endpoints add next_cursor; pass it back as cursor on the next request. limit is capped at 100.

Errors use:

{
"ok": false,
"error": {
"code": "invalid_body",
"message": "Invalid request body."
}
}

Common codes are invalid_api_key, missing_scope, not_found, invalid_body, payload_too_large, plan_required, rate_limited, and quota_exceeded. JSON bodies are capped at 16 KiB and nested objects at depth 6. Test submissions share the dashboard’s 20-per-hour counter and use only synthetic data. Recipient verification sends are limited per address, per workspace, and by the account/provider daily email budgets.

API rate limiting is enforced per IP and per key. Current binding limits are approximate per Cloudflare location: 60 unauthenticated requests per minute per IP, 120 authenticated-candidate requests per minute per IP, and 120 requests per minute per API key. 429 responses include Retry-After; daily verification counters use the next UTC counter reset rather than the generic minute bucket.