Agency API · v1
Your clients.
Your systems.
Manage FormHam from your own software and AI tools: amend client settings, configure forms, work with leads, manage teams and connect integrations using your current app permissions.
Base URL: https://app.formham.co.uk/api/agency/v1
Get started
- Sign in to FormHam → API Tokens.
- Select the client business. In “All businesses”, use the client selector on the API Tokens screen.
- Choose Enable Agency API and confirm the access you are granting. If your plan is ineligible, the screen shows the upgrade route.
- Choose New token, give it a name such as “Private AI assistant”, and choose Agency API.
- Copy the token into your system’s secret store. It is shown once. Repeat for each client you want that system to access.
Verify the key before changing anything:
export FORMHAM_API_TOKEN='replace-with-your-secret'
curl --fail-with-body https://app.formham.co.uk/api/agency/v1/me \
-H "Authorization: Bearer $FORMHAM_API_TOKEN" \
-H 'Accept: application/json'
/me returns the current user, accessible businesses and businesses_unavailable explanations. Never put a real key in a URL, screenshot, source repository or public AI chat.
Keys, client selection and permissions
Every request requires Authorization: Bearer TOKEN and should send Accept: application/json. Writes use Content-Type: application/json. Browser login cookies and plugin/integration keys do not replace an agency key.
Keys created in the app are pinned to one client. For the management routes under /app, that client is selected automatically. You may send X-Business-Id: 93 explicitly. An unscoped agency key must select a business for management requests. Every supplied header, query or body business selector must agree; conflicting selectors are refused.
Agency credentials work only under /api/agency/v1. They cannot use older /api/my-forms, /api/v1 or administrator endpoints to bypass the agency checks. Use the intended integration credential for those separate APIs.
Membership, role, plan, API opt-in and credential validity are checked on requests. Owners/admins can manage sensitive settings, credentials and data exports. Members retain ordinary app permissions; a token never upgrades its user. Removing membership or revoking a token removes its authority. Expiry is returned with issued credentials and shown in the token list.
Read and amend a client
GET /app/business reads the selected client. PATCH /app/business accepts partial settings. Unspecified fields stay unchanged.
curl --fail-with-body -X PATCH \
https://app.formham.co.uk/api/agency/v1/app/business \
-H "Authorization: Bearer $FORMHAM_API_TOKEN" \
-H 'Accept: application/json' -H 'Content-Type: application/json' \
--data '{"name":"Example client","contact_email":"hello@example.com"}'
| Settings | JSON fields |
|---|---|
| Identity | name, website, contact_email, from_name, from_email |
| Delivery | email_provider: agency_mailgun, custom_mailgun or smtp; mailgun_domain, mailgun_secret, smtp_host, smtp_port (1–65535), smtp_username, smtp_password, smtp_encryption (tls, ssl, none) |
| Working hours | office_hours_start, office_hours_end, timezone, business_days (array of weekday numbers 1–7) |
| Privacy | gdpr_mode, submission_retention_days (1–3650), purge_test_submissions, hide_technical_fields |
| Branding | brand_color (#RRGGBB), brand_logo_url, email_footer_text |
| Domains and integrations | allowed_domains (public hostnames), mailchimp_api_key, mailchimp_server_prefix (for example us21) |
Use GET /app/customer-api to inspect entitlement and access state; PATCH /app/customer-api with {"enabled":false} disables agency access for this client. Re-enabling after disabling requires the app, because the disabled API refuses further agency requests.
Forms and notifications
GET /app/forms lists forms. POST /app/forms creates a form and requires name. GET and PATCH /app/forms/{id} use the numeric form ID. The sync routes outside /app use form UUIDs instead.
POST /api/agency/v1/app/forms
{"name":"Website enquiries","is_active":true,"email_notifications":true,
"spam_protection":"challenge","allowed_domains":["example.com"]}
PATCH /api/agency/v1/app/forms/123
{"name":"Sales enquiries","is_active":false}
Form settings include redirect_url, reply_to_field, email_notifications, webhook_url, sms_enabled, whatsapp_enabled, notification_phone, allowed_domains, recaptcha_enabled, spam_protection, mailing_list_id, mailing_list_email_field, mailing_list_first_name_field, mailing_list_last_name_field, form_schema and form_styles. Plan and destination restrictions still apply. Mailing lists must belong to the selected client.
POST /app/forms/{id}/test runs the app’s test flow. It may trigger delivery; use a test client and destinations you control.
Notification templates
GET/POST /app/forms/{id}/notifications; PATCH/DELETE /app/forms/{id}/notifications/{notificationId}. Both create and update require recipient_type (admin, custom, respondent), reply_to_mode (none, static, field), subject (max 500) and body (max 50,000). Optional fields: name, recipient_email, recipient_field, reply_to_email, reply_to_field, include_all_fields, delay_minutes (0–20160), respect_business_hours, is_active. Choosing a new custom recipient requires owner/admin permission.
Leads, attachments and privacy
GET /app/submissions returns a standard paginator with data, current_page, last_page and total. It uses 50 rows per page. Pass page, from and to (date strings). all=true returns at most 500 rows and is not an unbounded export.
Follow-up: PUT /app/submissions/{id}/lead-status with {"status":"contacted"} sets a lead's status; GET/POST /app/submissions/{id}/notes read and add internal team notes ({"body":"…"}), and DELETE /app/submissions/{id}/notes/{noteId} removes one (its author, or an owner/admin). An erased lead refuses new notes with 409.
GET /app/submissions/{id} returns one submission by numeric ID. Attachment links use GET /app/submission-files/{submissionFile} with the bearer header; never forward the agency key to another host. GET /app/logs, GET /app/logs/failed-count and POST /app/logs/{id}/retry expose the app’s delivery tools; retrying can send a message.
Owner/admin data exports: GET /app/submissions/export supports from/to, or a subject email for a subject access export. GET /app/forms/{id}/export/panel exports one form. These may return file downloads rather than JSON. HEAD is refused on audited export routes. Streamed downloads recheck current access before emitting data.
POST /app/submissions/{id}/erase erases one submission; POST /app/submissions/erase-by-email with {"email":"person@example.com"} erases matching subject data within the selected client. These are audited and role restricted. Require explicit human approval in your own AI workflow before invoking them.Team and credential management
GET /app/business/members lists members. POST /app/business/members takes email and optional role (admin or member). It may send an invitation. PATCH /app/business/members/{userId} takes role; role changes require an owner. DELETE removes the member, subject to the app’s owner protections. The last owner cannot be removed or demoted.
GET /app/tokens inventories the current user’s keys for this client; it does not return usable secrets. POST /app/tokens takes name (max 100) and scope (agency or business, default business). The 201 response includes id, token, scope, abilities and expiry metadata. Store the secret immediately. DELETE /app/tokens/{id} revokes it. You cannot manage another client’s keys through a scoped credential.
Lists, sending domains, plugins and billing
GET/POST /app/mailing-lists; creation requires name and accepts description. PATCH /app/mailing-lists/{id} changes those fields; DELETE removes a list. GET /app/mailing-lists/{id}/subscribers lists its subscribers. GET /app/mailing-lists/{id}/export and /export/all download subscriber exports.
GET /app/mailing-list-destination-providers lists available providers and configuration requirements. Create a destination with POST /app/mailing-lists/{id}/destinations, supplying provider, optional label and provider-specific config. PATCH /app/mailing-lists/{id}/destinations/{destinationId} updates label, is_active or config; DELETE removes it. POST .../{destinationId}/backfill queues existing subscribers for that destination. This can transmit personal data externally.
GET /app/sending-domain reads DNS/provisioning status. POST /app/sending-domain takes domain; POST /app/sending-domain/verify rechecks it. These use the same provider, plan and owner/admin checks as the app.
POST /app/plugin-token requires business_id matching the selected client and issues/rotates that client’s plugin credential. POST /app/download-plugin downloads a client-configured ZIP containing a separate plugin credential; protect the archive as a secret.
GET /app/billing reads billing. POST /app/billing/checkout takes business_id, plan and optional period (month or year) and returns checkout details. POST /app/billing/portal returns portal_url. A person follows the hosted billing link; the API does not bypass payment approval or directly replace subscription webhooks.
GET /app/dashboard and GET /app/onboarding-progress provide the app’s summary views. GET /app/businesses lists accessible clients within this key’s scope.
Bulk sync into your own systems
The original sync API remains available alongside management. GET /businesses lists reachable clients. GET /usage?month=2026-10 reads usage. GET /forms accepts business_id and is_active; GET /forms/{uuid} reads a form. POST /forms requires business_id and name. PATCH /forms/{uuid} supports the sync settings; use the management endpoint for full app settings.
GET /submissions accepts since, until, form_uuid, business_id, lead_status (new, contacted, won, lost or spam; new means never triaged), limit (max 500) and cursor. Every lead carries its lead_status. Use ISO-8601 timestamps, store receipt_id to deduplicate and follow next_cursor until it is null. Keep other filters fixed while paging. GET /submissions/{receiptId} reads one lead and its delivery attempts. Numeric management IDs, UUIDs and receipt IDs are different identifiers.
Deleting a lead (“remove my details”)
DELETE /submissions/{receiptId} permanently deletes one lead: the submission row, its uploaded files, its delivery logs and email index, pending scheduled notifications, and any mailing-list subscriber captured from it. It is not a redaction and cannot be undone. Your key needs the owner or admin role on the lead’s business.
| Status | Meaning |
|---|---|
| 204 | Deleted. Also returned when the same receipt id was already deleted through this endpoint, so retrying after a timeout is safe. |
| 404 | Unknown receipt id, or one belonging to a business this key cannot reach. The two are indistinguishable. |
| 403 | Your role on that business is member; deletion needs owner or admin. |
| 503 | The deletion could not be recorded or completed (for example, file storage refused). Retry. |
Each deletion is audited with who made it, the business, a hash of the receipt id and the number of records removed, never the lead’s content.
curl --fail-with-body -X DELETE \
https://app.formham.co.uk/api/agency/v1/submissions/0b6c1f9e-7d1a-4a5e-9f4e-2c8d3b1a6e70 \
-H "Authorization: Bearer $FORMHAM_API_TOKEN" -H 'Accept: application/json'
curl --fail-with-body --get \
https://app.formham.co.uk/api/agency/v1/submissions \
-H "Authorization: Bearer $FORMHAM_API_TOKEN" -H 'Accept: application/json' \
--data-urlencode 'since=2026-10-01T00:00:00Z' --data-urlencode 'limit=100'
Do not assume every response has the same wrapper: app list endpoints can return arrays or standard Laravel pagination; sync list endpoints return data, next_cursor and has_more. Inspect and handle the endpoint’s actual response.
Rate limits, errors and retries
The API baseline is 120 requests/minute/user or IP. Agency traffic also has a per-token budget of 120/minute and 3,000/hour. Management has separate per-user limits: 120 reads/minute, 30 standard writes/minute (including team changes), 12 sensitive operations/minute and 6 provider/credential operations/minute. Limits layer; a lower remaining budget wins. Keys belonging to the same user share the baseline and management budgets.
| Status | Handling |
|---|---|
| 401 | Missing, expired or revoked authentication. Check/reissue the key. |
| 402 / 403 | Plan, API opt-in, scope, role or membership refuses this action. Do not loop retries. |
| 404 | Resource absent or unavailable within this client’s scope. |
| 409 | State conflict, such as issuing an agency key before enabling API access. |
| 413 | Request exceeds the server’s management payload limit. |
| 422 | Invalid input. Read message/error and any errors field validation details. |
| 429 | Wait for Retry-After; use bounded backoff. |
| 5xx | Temporary server/provider issue. Use bounded retries for safe reads; inspect state before replaying writes. |
Every error is JSON with the same envelope: {"error":"…","message":"…","request_id":"…"}, plus errors on a 422. Branch on error; quote request_id (also in the X-Request-Id header) when you contact support. You may send your own X-Request-Id to correlate with your logs. Successful responses carry X-RateLimit-Limit and X-RateLimit-Remaining.
Safe retries with Idempotency-Key
Create endpoints marked Idempotency-Key in the reference below accept a key you choose (for example a UUID per logical create). Retrying with the same key and the same request within 24 hours returns the first response, with Idempotent-Replayed: true, instead of creating a second form, list, note or invitation. Reusing a key for a different request is refused with 422 idempotency_key_reused; a retry while the first attempt is still running gets 409 idempotency_request_in_progress. Other writes (delivery tests, retries, backfills) have no key: check the resulting state before replaying them.
curl --fail-with-body -X POST https://app.formham.co.uk/api/agency/v1/forms \
-H "Authorization: Bearer $FORMHAM_API_TOKEN" -H 'Accept: application/json' \
-H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
--data '{"business_id":93,"name":"Website enquiries"}'
Using the API safely with AI
- Keep keys server-side in a secret manager. Give each client/integration its own key, rotate periodically and revoke unused keys.
- Do not embed keys in browser JavaScript, URLs, source control or prompt text. Inject the bearer header through your tool’s protected connection settings.
- Treat submitted lead content as untrusted data. It must not become instructions that can call tools, change recipients, mint credentials or erase data.
- Use an allowlist of permitted operations in your AI system. Require human confirmation for credentials, team changes, destinations, exports, billing and erasure.
- Send only the personal data your system needs. Restrict logs and exports, and honour each client’s retention policy.
- Secrets in settings responses may be masked. Omit unchanged secret fields; do not overwrite a working secret with a displayed placeholder.
The server hashes stored API tokens, checks tenant scope and current authority, audits sensitive actions and refuses private-network outbound targets through its guarded transports. These controls reduce risk; they are not a promise that software is invulnerable.
API reference
All 84 operations below are generated from the OpenAPI 3.1 document that the test suite checks against the deployed routes. Download it for code generation or import the collection into Postman or Bruno:
- OpenAPI (YAML) · OpenAPI (JSON)
- Postman / Bruno collection — set the
tokenvariable locally; never commit it. - Route index (JSON) · llms.txt
No endpoints match that search.
Identity
Who the token is and what it can reach.
GET /api/agency/v1/meWho this token is and what it can reach
The first call to make. Lists reachable businesses and, for the token user's other businesses, why each is unavailable.
Responses
200 application/json
Identity.
| Field | Type | Description |
|---|---|---|
user | object | |
user.id | integer | |
user.name | string | |
user.email | string (email) | |
token | object | |
token.name | string | null | |
token.scoped_to_business_id | integer | null | Set when the token is pinned to one business. |
businesses | array of object | |
businesses[].id | integer | |
businesses[].name | string | |
businesses[].slug | string | null | |
businesses[].plan | string | Internal plan key (e.g. |
businesses[].plan_label | string | |
businesses_unavailable | array of object | |
businesses_unavailable[].id | integer | |
businesses_unavailable[].name | string | |
businesses_unavailable[].reason | string (one of: plan_does_not_include_api, api_not_enabled, token_scoped_to_another_business) |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Sync
Cursor-paginated, cross-business reads and the form create used by build pipelines.
GET /api/agency/v1/businessesEvery business this token can reach
Responses
200 application/json
Businesses, ordered by name.
| Field | Type | Description |
|---|---|---|
data | array of object | |
data[].id | integer | |
data[].name | string | |
data[].slug | string | null | |
data[].website | string | null | |
data[].contact_email | string | null | |
data[].plan | string | Internal plan key (e.g. |
data[].plan_label | string | |
data[].forms | integer | Number of forms. |
data[].allowed_domains | array of string | |
data[].created_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/formsForms across every reachable business
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_id | query | integer | Restrict to one business. 403 |
is_active | query | boolean | |
limit | query | integer (min 1; max 500; default 100) | Rows per page. |
cursor | query | integer (min 0) | The |
Responses
200 application/json
A page of forms, ordered by internal id.
| Field | Type | Description |
|---|---|---|
data | array of object | |
data[].uuid | string | |
data[].name | string | |
data[].is_active | boolean | |
data[].business_id | integer | |
data[].business_name | string | null | |
data[].submit_url | string (uri) | Where an HTML form posts. |
data[].created_at | string | null (date-time) | |
next_cursor | integer | null | Pass as |
has_more | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/formsCreate a form on one of your businesses
Stands a client's form up from a build script. Email notifications default on; spam protection is the
proof-of-work challenge (suitable for sites you build). Omitting fields creates name/email/message.
422 form_limit_reached when the plan's form ceiling is hit.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
business_idrequired | integer | |
namerequired | string (max length 255) | |
is_active | boolean (default true) | |
email_notifications | boolean (default true) | |
notification_emails | array of string (email; max length 255) (max items 20) | |
redirect_url | string | null (uri; max length 2048) | Must be https. |
fields | array of object (max items 100) | |
fields[].typerequired | string (max length 40) | |
fields[].namerequired | string (max length 100) | |
fields[].label | string | null (max length 255) | |
fields[].placeholder | string | null (max length 255) | |
fields[].required | boolean |
Responses
201 application/json
Created.
| Field | Type | Description |
|---|---|---|
data | object | |
data.uuid | string | |
data.name | string | |
data.is_active | boolean | |
data.business_id | integer | |
data.business_name | string | null | |
data.submit_url | string (uri) | Where an HTML form posts. |
data.created_at | string | null (date-time) | |
data.email_notifications | boolean | |
data.notification_emails | array of string (email) | |
data.redirect_url | string | null | |
data.fields | array of object | |
data.fields[].type | string | |
data.fields[].name | string | null | |
data.fields[].label | string | null | |
data.fields[].required | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/forms/{uuid}One form, with its field list
Parameters
| Name | In | Type | Description |
|---|---|---|---|
uuidrequired | path | string |
Responses
200 application/json
The form.
| Field | Type | Description |
|---|---|---|
data | object | |
data.uuid | string | |
data.name | string | |
data.is_active | boolean | |
data.business_id | integer | |
data.business_name | string | null | |
data.submit_url | string (uri) | Where an HTML form posts. |
data.created_at | string | null (date-time) | |
data.email_notifications | boolean | |
data.notification_emails | array of string (email) | |
data.redirect_url | string | null | |
data.fields | array of object | |
data.fields[].type | string | |
data.fields[].name | string | null | |
data.fields[].label | string | null | |
data.fields[].required | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/forms/{uuid}Rename, pause or re-route a form
There is no DELETE here by design — is_active=false stops a form accepting submissions. 422 nothing_to_update for an empty body. Use /app/forms/{id} for the full settings.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
uuidrequired | path | string |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string (max length 255) | |
is_active | boolean | |
email_notifications | boolean | |
notification_emails | array of string (email; max length 255) | null (max items 20) | |
redirect_url | string | null (uri; max length 2048) | Must be https. |
Responses
200 application/json
The updated form.
| Field | Type | Description |
|---|---|---|
data | object | |
data.uuid | string | |
data.name | string | |
data.is_active | boolean | |
data.business_id | integer | |
data.business_name | string | null | |
data.submit_url | string (uri) | Where an HTML form posts. |
data.created_at | string | null (date-time) | |
data.email_notifications | boolean | |
data.notification_emails | array of string (email) | |
data.redirect_url | string | null | |
data.fields | array of object | |
data.fields[].type | string | |
data.fields[].name | string | null | |
data.fields[].label | string | null | |
data.fields[].required | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/submissionsLeads across every reachable business
Keyset-paginated on the internal id: follow next_cursor until it is null, keeping the other filters fixed.
Store receipt_id to de-duplicate. Quarantined (held) leads are excluded unless include_quarantined=1.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business_id | query | integer | |
form_uuid | query | string (max length 64) | 404 if the form is not reachable. |
since | query | string (date-time) | Created at or after (ISO-8601). |
until | query | string (date-time) | Created at or before (ISO-8601). |
include_quarantined | query | boolean (default false) | |
lead_status | query | string (one of: new, contacted, won, lost, spam) |
|
limit | query | integer (min 1; max 500; default 100) | Rows per page. |
cursor | query | integer (min 0) | The |
Responses
200 application/json
A page of leads.
| Field | Type | Description |
|---|---|---|
data | array of object | |
data[].submission_id | integer | |
data[].receipt_id | string | |
data[].form | object | |
data[].form.uuid | string | null | |
data[].form.name | string | null | |
data[].submitted_at | string | null (date-time) | |
data[].source_url | string | null | |
data[].page_title | string | null | |
data[].data | object | The submitted fields, flattened (field name → value). |
data[].files | array of object | |
data[].files[].filename | string | |
data[].files[].bytes | integer | |
data[].files[].mime | string | null | |
data[].files[].download_url | string | null | Time-limited signed URL. |
data[].business_id | integer | |
data[].quarantined | boolean | |
data[].quarantine_reason | string | null | |
data[].lead_status | string (one of: new, contacted, won, lost, spam) | |
next_cursor | integer | null | Pass as |
has_more | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/submissions/{receiptId}One lead by receipt id, with its delivery attempts
Parameters
| Name | In | Type | Description |
|---|---|---|---|
receiptIdrequired | path | string | The submission's receipt id (36 characters of hex and hyphens). |
Responses
200 application/json
The lead.
| Field | Type | Description |
|---|---|---|
data | object | The outbound webhook's payload shape (minus |
data.submission_id | integer | |
data.receipt_id | string | |
data.form | object | |
data.form.uuid | string | null | |
data.form.name | string | null | |
data.submitted_at | string | null (date-time) | |
data.source_url | string | null | |
data.page_title | string | null | |
data.data | object | The submitted fields, flattened (field name → value). |
data.files | array of object | |
data.files[].filename | string | |
data.files[].bytes | integer | |
data.files[].mime | string | null | |
data.files[].download_url | string | null | Time-limited signed URL. |
data.business_id | integer | |
data.quarantined | boolean | |
data.quarantine_reason | string | null | |
data.lead_status | string (one of: new, contacted, won, lost, spam) | |
data.deliveries | array of object | |
data.deliveries[].type | string | Channel (email, webhook, sms, ...). |
data.deliveries[].status | string | |
data.deliveries[].message | string | null | |
data.deliveries[].at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/submissions/{receiptId}Permanently delete one lead ("remove my details")
Irreversible: removes the submission, its files, delivery logs, email index, pending scheduled notifications
and any mailing-list subscriber captured from it. Audited without personal data. 204 also when the same
receipt id was already deleted here, so a retry after a timeout is safe. 403 insufficient_role for a member;
503 audit_unavailable / delete_failed — retry.
Roles: owner, admin
Parameters
| Name | In | Type | Description |
|---|---|---|---|
receiptIdrequired | path | string | The submission's receipt id (36 characters of hex and hyphens). |
Responses
204
Deleted (or already deleted).
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
GET /api/agency/v1/usageSubmission counts per business for a month
For reconciling what you bill clients against what arrived. A month that does not parse falls back to the current month.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
month | query | string | Defaults to the current month. |
Responses
200 application/json
Counts.
| Field | Type | Description |
|---|---|---|
month | string | |
data | array of object | |
data[].business_id | integer | |
data[].business_name | string | |
data[].submissions | integer | |
total | integer |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Workspace
GET /api/agency/v1/app/businessRead the selected business's settings
The selected business's settings. Secrets (mailgun_secret, mailchimp_api_key,
recaptcha_secret_key) come back masked as ***, or null when not set. can_manage
and my_role describe the caller's own authority, so a client can hide controls the
caller is not allowed to use.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The business settings.
| Field | Type | Description |
|---|---|---|
id | integer | |
name | string | |
slug | string | |
website | string | null | |
contact_email | string | null | |
from_name | string | null | |
from_email | string | null | |
email_provider | string (one of: agency_mailgun, custom_mailgun, smtp) | |
mailgun_domain | string | null | |
mailgun_secret | string | null |
|
smtp_host | string | null | |
smtp_port | integer | null | |
smtp_username | string | null | |
smtp_encryption | string | Defaults to |
office_hours_start | string | HH:MM, default 09:00. |
office_hours_end | string | HH:MM, default 17:00. |
timezone | string | Defaults to |
business_days | array of integer (min 1; max 7) | ISO weekday numbers (1 = Monday); always a concrete list. |
gdpr_mode | boolean | |
submission_retention_days | integer | null | |
purge_test_submissions | boolean | |
hide_technical_fields | boolean | |
lead_digest_enabled | boolean | |
brand_color | string | null | |
brand_logo_url | string | null | |
email_footer_text | string | null | |
mailchimp_api_key | string | null |
|
mailchimp_server_prefix | string | null | |
plan | string | Internal plan key. |
can_manage | boolean | Whether the caller is owner/admin (may change privileged settings). |
my_role | string | null (one of: owner, admin, member, null) | |
allowed_domains | array of string | |
formspark_form_id | string | null | |
recaptcha_enabled | boolean | |
recaptcha_site_key | string | null | |
recaptcha_secret_key | string | null |
|
recaptcha_version | string (one of: v2, v3) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/businessUpdate the selected business's settings
A partial update; send only the fields you want to change. Any member can change the
day-to-day fields (name, website, branding, office hours, business days, timezone,
hide_technical_fields, email_footer_text). The privileged fields (BusinessSettingsService::PRIVILEGED_FIELDS: mail transport,
from_name/from_email, contact_email, GDPR/retention, Mailchimp, reCAPTCHA,
allowed_domains, formspark_form_id, lead_digest_enabled) need owner or admin.
Touching one as a member returns 403 with a fields list naming them.
Sending *** for mailgun_secret, mailchimp_api_key or recaptcha_secret_key keeps
the stored secret. Mail-transport changes are checked by MailTransportSettings, which can
refuse with 403 or 422 and an errors object keyed by the field. Saving allowed_domains
also pushes the domains to the platform reCAPTCHA key's allowed-domain list. The change is
audited (business_settings_updated). 409 means the data changed during the save; retry.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string (max length 255) | |
website | string | null (uri; max length 2048) | |
contact_email | string | null (email; max length 255) | Privileged. |
from_name | string | null (max length 255) | Privileged. |
from_email | string | null (email; max length 255) | Privileged. |
email_provider | string (one of: agency_mailgun, custom_mailgun, smtp) | Privileged. |
mailgun_domain | string | null (max length 255) | Privileged. |
mailgun_secret | string | null (max length 255) | Privileged. |
smtp_host | string | null (max length 255) | Privileged. |
smtp_port | integer | null (min 1; max 65535) | Privileged. |
smtp_username | string | null (max length 255) | Privileged. |
smtp_password | string | null (max length 255) | Privileged. Write-only. |
smtp_encryption | string | null (one of: tls, ssl, none, null) | Privileged. |
office_hours_start | string | null (max length 5) | |
office_hours_end | string | null (max length 5) | |
timezone | string | null (max length 64) | |
business_days | array of integer (min 1; max 7) | null | ISO weekday numbers (1 = Monday .. 7 = Sunday). An empty array clears it. |
gdpr_mode | boolean | Privileged. |
submission_retention_days | integer | null (min 1; max 3650) | Privileged. |
purge_test_submissions | boolean | Privileged. |
hide_technical_fields | boolean | |
lead_digest_enabled | boolean | Privileged. |
brand_color | string | null (max length 7) | |
brand_logo_url | string | null (uri; max length 2048) | |
email_footer_text | string | null (max length 1000) | |
mailchimp_api_key | string | null (max length 500) | Privileged. |
mailchimp_server_prefix | string | null | Privileged. Mailchimp data-centre prefix, e.g. |
allowed_domains | array of string | null | Privileged. Also synced to the platform reCAPTCHA key. |
formspark_form_id | string | null | Privileged. |
recaptcha_enabled | boolean | Privileged. |
recaptcha_site_key | string | null (max length 500) | Privileged. |
recaptcha_secret_key | string | null (max length 500) | Privileged. |
recaptcha_version | string | null (one of: v2, v3, null) | Privileged. |
Responses
200 application/json
Saved.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/businessesList the businesses this token can act on
Every business the caller belongs to, filtered to the ones this agency token may use
(AgencyApiAccess::businessIdsFor), with trial and billing state attached so a client
can show a "trial ending" or "payment failed" banner without asking again.
This route stays open when billing is lapsed, so it never returns 402. It is not
exempt from suspension: if the selected business is suspended you get 423
business_suspended.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The businesses, sorted by name.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].name | string | |
[].slug | string | |
[].role | string | null (one of: owner, admin, member, null) | |
[].billing_status | object | |
[].billing_status.past_due | boolean | |
[].billing_status.billing_portal_available | boolean | |
[].billing_status.status | string | null | |
[].billing_status.portal_url | string | null (uri) | |
[].billing_status.billed_by_agency | boolean | |
[].billing_status.free_access | boolean | True during free early access. |
[].billing_status.free_until | string | null (date) | |
[].trial_state | string (one of: none, active, ending_soon, grace, lapsed) | |
[].trial_ends_at | string | null (date-time) | |
[].trial_ends_on | string | null | Human date, e.g. "4 December 2026". |
[].trial_days_remaining | integer | null | |
[].trial_setup_complete | boolean | Whether this trial has earned the setup bonus. |
[].trial_setup_bonus_days | integer | |
[].trial_lapses_at | string | null (date-time) | When the lapsed-trial restriction actually applies (grace plus any bonus). |
[].trial_lapses_on | string | null | |
[].trial_restricts_writes_only | boolean | True when a lapsed trial only blocks writes (reads and exports still work). |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/dashboardDashboard stats and things needing attention
Today's counts, 30-day spam and untriaged-lead figures, delivery success rate, form health
and an attention list of problems (no forms, failed notifications, bouncing recipients,
quiet forms, unfinished sending domain, held leads).
Cached per business for 45 seconds, so a new submission can take that long to show.
delivery_rate and send_success_rate are null when nothing has been sent today.
can_manage is true only when an attention item offers a fix and the caller is owner or
admin.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The dashboard payload.
| Field | Type | Description |
|---|---|---|
business_name | string | |
date_label | string | |
stats | object | |
stats.spam_blocked_30d | integer | |
stats.leads_awaiting_30d | integer | |
stats.forms_live | integer | |
stats.forms_active | integer | |
stats.forms_paused | integer | |
stats.forms_total | integer | |
stats.submissions_today | integer | |
stats.sub_trend | number | Percent change in submissions vs yesterday (0 when yesterday had none). |
stats.delivery_rate | number | null | Legacy alias of |
stats.send_success_rate | number | null | Percent of today's send attempts that did not fail; null when none. |
stats.delivery_attempts | integer | |
stats.failed_channels | integer | Failed send attempts today. |
stats.held | integer | Leads held for review. |
stats.attention_count | integer | |
stats.attention_summary | string | null | |
attention | array of object | |
attention[].type | string (one of: warning, error) | |
attention[].screen | string | App screen the item points at (e.g. |
attention[].form_id | integer | Present on "no recent submissions" items. |
attention[].title | string | |
attention[].subtitle | string | |
attention[].action | string | |
attention[].fix | object | A one-click fix (owner/admin), currently only for bouncing recipients. |
attention[].fix.kind | string (one of: replace_recipient) | |
attention[].fix.recipient | string (email) | |
recent_submissions | array of object (max items 5) | |
recent_submissions[].id | integer | |
recent_submissions[].form | string | |
recent_submissions[].email | string | |
recent_submissions[].name | string | |
recent_submissions[].status | string | |
recent_submissions[].time_ago | string | |
recent_submissions[].receipt_id | string | null | |
forms | array of object | |
forms[].id | integer | |
forms[].name | string | |
forms[].subs_today | integer | |
forms[].status | string (one of: live, paused, atRisk) | |
can_manage | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/notification-recipients/replaceReplace a notification email address everywhere it is used
Swaps from for to across the business's form notifications, per-form recipients,
contact_email and default notification emails. It never changes a team member's login;
team_member in the response says whether from is also one. Clears the dashboard cache.
422 when from and to are the same address, or when from is not used anywhere any more
(and is not a team member's address).
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
fromrequired | string (email; max length 254) | The address to replace. |
torequired | string (email; max length 254) | The new address (validated with |
Responses
200 application/json
Where the address was replaced.
| Field | Type | Description |
|---|---|---|
replaced | integer | Total places changed. |
notifications | integer | |
forms | integer | |
contact_email | boolean | |
default_notification_emails | boolean | |
team_member | boolean | Whether the old address is also a team member's login (never changed here). |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/setupSetup choices
What the business said during setup and can change under "Your setup": hidden menu entries, which emails are sent, what the website is built with, and the choices on offer.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The current choices.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/setupChange setup choices
A partial update; send only what changes. emails.enquiry switches enquiry emails on
every form of the business. Owner or admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
platform | string (one of: html, wordpress, react, builder, none) | |
hidden_features | array of string (one of: followup, lists, integrations, team, developer, sending_domain) | |
emails | object | |
emails.enquiry | boolean | |
emails.followup | boolean | |
emails.summary | boolean | |
decline_offer | boolean |
Responses
200 application/json
The choices after the change.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/onboarding-progressSetup checklist progress
The four setup steps (create a form, choose recipients, lock forms to your domain, get a first lead), worked out from the business's real state. Read-only: there is no way to mark a step done by hand.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The checklist.
| Field | Type | Description |
|---|---|---|
steps | array of object | |
steps[].id | string | Step key (form, recipients, domain, live). |
steps[].title | string | |
steps[].done | boolean | |
steps[].body | string | |
steps[].detail | string | null | |
steps[].detail_label | string | null | |
steps[].action | string | |
steps[].screen | string | |
complete | integer | |
total | integer | |
percent | integer | |
finished | boolean | |
next | one of | |
next.id | string | Step key (form, recipients, domain, live). |
next.title | string | |
next.done | boolean | |
next.body | string | |
next.detail | string | null | |
next.detail_label | string | null | |
next.action | string | |
next.screen | string | |
business_name | string |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Team
GET /api/agency/v1/app/business/membersList the business's team members
Everyone with access to the selected business, sorted by name, with their role.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The members.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].name | string | |
[].email | string (email) | |
[].is_admin | boolean | Platform administrator flag. |
[].role | string (one of: owner, admin, member) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/business/membersAdd or invite a team member
If the email belongs to an existing FormHam account, that person gets access straight away. Otherwise an invitation email is sent (valid 7 days; sending again refreshes it). The response is the same either way, so it cannot be used to find out who has an account.
Only an owner's role is honoured; when an admin adds someone they always join as
member. owner cannot be granted here. 402 when the plan's max_team_members limit
(members plus pending invitations) is reached. Audited.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | Lower-cased and trimmed before use. |
role | string (one of: admin, member) | Only used when the caller is an owner. Defaults to |
Responses
200 application/json
Access granted or invitation sent (deliberately indistinguishable).
| Field | Type | Description |
|---|---|---|
ok | boolean | |
message | string |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/business/members/{userId}Change a team member's role
Owner only. Demoting the business's last owner is refused with 422. 404 when the user is not a member of this business. Audited when the role actually changes.
Roles: ownerExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
userIdrequired | path | integer | The user's id (from the members list). |
Request body application/json
| Field | Type | Description |
|---|---|---|
rolerequired | string (one of: owner, admin, member) |
Responses
200 application/json
Role set.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/business/members/{userId}Remove a team member
Removes the person's access to the selected business. An admin can remove only members, not owners or other admins. You cannot remove yourself, and the business must always keep at least one owner (both 422). Removing someone who is not a member succeeds and changes nothing. Audited.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
userIdrequired | path | integer | The user's id (from the members list). |
Responses
200 application/json
Removed (or was not a member).
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
API access & credentials
GET /api/agency/v1/app/customer-apiAgency API status for this business
Whether the plan includes the agency API, whether it is switched on, and where its docs live.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The agency API state, plus whether the caller may change it.
| Field | Type | Description |
|---|---|---|
business_id | integer | |
entitled | boolean | Whether the plan includes the agency API. |
enabled | boolean | |
enabled_at | string | null (date-time) | |
plan | string | |
plan_label | string | |
required_plans | array of string | Sold names of the plans that include it. |
base_url | string (uri) | |
docs_url | string (uri) | |
can_manage | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/customer-apiTurn the agency API on or off
Switching it on opens programmatic read access to every lead this business holds, so it is owner/admin only and recorded on the business (who and when). Turning it on needs a plan that includes it (402 otherwise). Turning it off does not revoke tokens, but they stop working immediately because access is checked on every request.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
enabledrequired | boolean |
Responses
200 application/json
The new state.
| Field | Type | Description |
|---|---|---|
business_id | integer | |
entitled | boolean | Whether the plan includes the agency API. |
enabled | boolean | |
enabled_at | string | null (date-time) | |
plan | string | |
plan_label | string | |
required_plans | array of string | Sold names of the plans that include it. |
base_url | string (uri) | |
docs_url | string (uri) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/download-pluginDownload the WordPress plugin for this business
Returns a file download (application/zip): the FormHam WordPress plugin, pre-configured
for the selected business. Each call mints a new plugin token and builds it into the
package, so treat the zip as a credential. No request body is needed; the business comes
from X-Business-Id.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/zip
The plugin package. Sent with Cache-Control no-store.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/plugin-tokenMint a WordPress plugin token and download link
Mints a new plugin token for the business and returns a single-use download link for the plugin package (the link carries a nonce, not the token, and lasts 24 hours). Plugin tokens for this business that have already gone stale are removed first; live ones are kept.
business_id in the body must be the selected business (a mismatch with X-Business-Id
is 403).
Roles: owner, admin, memberExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
business_idrequired | integer (min 1) | Must exist and match the selected business. |
Responses
200 application/json
The download link.
| Field | Type | Description |
|---|---|---|
business_id | integer | |
business_name | string | |
download_url | string (uri) | Single-use plugin download link (24h nonce). |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/tokensList your API tokens for this business
The caller's own API tokens that are scoped to the selected business
(access-business:{id}). Tokens for other clients are never listed. The token secret is
never returned, only its last four characters.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Newest first.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].name | string | |
[].last_four | string | |
[].last_used_at | string | null | Relative, e.g. "2 hours ago". |
[].created_at | string | null | e.g. "18 Nov 2026". |
[].expires_at | string | null (date-time) | |
[].expires_on | string | null | |
[].expired | boolean | |
[].scope | string (one of: agency, admin, business) | |
[].business_id | integer | null | |
[].business_name | string | null |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/tokensCreate an API token for this business
Mints a Sanctum token scoped to the selected business. The plaintext token is returned
only in this response; store it now.
scope: agency also grants the agency API ability. That needs a plan with the agency API
(402 otherwise) and the agency API switched on for the business (409 otherwise, see
PATCH /app/customer-api).
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
namerequired | string (max length 100) | |
scope | string (one of: business, agency; default 'business') |
Responses
201 application/json
The new token, including its plaintext secret.
| Field | Type | Description |
|---|---|---|
id | integer | |
name | string | |
token | string | The plaintext token. Only ever returned here. |
scope | string (one of: business, agency) | |
abilities | array of string | |
created_at | string | null | e.g. "18 Nov 2026". |
expires_at | string | null (date-time) | |
expires_on | string | null | |
expired | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/tokens/{id}Revoke one of your API tokens
Deletes one of the caller's own tokens. Irreversible: anything using that token stops working at once. Returns 404 unless the token belongs to the caller and is scoped to the selected business. Audited.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer | The token id (from the tokens list). |
Responses
200 application/json
Revoked.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Sending domain
GET /api/agency/v1/app/sending-domainCustom sending domain status
The business's custom sending domain, its DNS records and verification status, and whether the plan includes it.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The sending domain state.
| Field | Type | Description |
|---|---|---|
root_domain | string | null | |
sending_domain | string | null | |
status | string | null (one of: dns_pending, verifying, active, failed, null) | |
dns_managed | boolean | |
records | array of object | DNS records to add. |
verified_at | string | null (date-time) | |
plan | string | |
entitled | boolean | |
required_plans | array of string | |
plan_label | string | |
can_manage | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/sending-domainSet up a custom sending domain
Registers the domain with Mailgun and returns the DNS records to add at your DNS host (calls an external API). Changes where this business's lead emails come from. Only a platform admin's request writes the records into a Bunny DNS zone automatically.
403 when the caller is not owner/admin, or when the plan does not include
white_label_email. 422 when provisioning fails.
Roles: owner, adminExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
domainrequired | string (max length 255) |
Responses
200 application/json
The sending domain state after provisioning.
| Field | Type | Description |
|---|---|---|
root_domain | string | null | |
sending_domain | string | null | |
status | string | null (one of: dns_pending, verifying, active, failed, null) | |
dns_managed | boolean | |
records | array of object | DNS records to add. |
verified_at | string | null (date-time) | |
plan | string | |
entitled | boolean | |
required_plans | array of string | |
plan_label | string | |
can_manage | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/sending-domain/verifyRe-check sending domain verification
Asks Mailgun to re-check the domain's DNS and returns the updated state (calls an external API). 422 when the check fails.
Roles: owner, adminExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The sending domain state after the check.
| Field | Type | Description |
|---|---|---|
root_domain | string | null | |
sending_domain | string | null | |
status | string | null (one of: dns_pending, verifying, active, failed, null) | |
dns_managed | boolean | |
records | array of object | DNS records to add. |
verified_at | string | null (date-time) | |
plan | string | |
entitled | boolean | |
required_plans | array of string | |
plan_label | string | |
can_manage | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Billing
POST /api/agency/v1/app/account/deleteDelete your own login
Irreversible. Deletes the calling user's account, including all of their API tokens
(so the token used for this request stops working). Requires the current password
(an account with no password is refused with 422). Refused with 422 while the caller is the
last owner of any workspace, and for platform administrator accounts. Reachable when
billing is lapsed.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_sensitive
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
password | string | null (max length 1024) | The caller's current password. Nullable in validation, but required in practice. |
Responses
200 application/json
Deleted.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/billingPlan, subscription, usage and limits
Everything the billing screen needs: current plan and price, the full plan catalogue,
subscription and trial state, this month's usage against plan limits, and who pays (a
client workspace shows its agency in billed_by).
Stays reachable when billing is lapsed (never 402), so a client can always show how to pay.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The billing state.
| Field | Type | Description |
|---|---|---|
trial_state | string (one of: none, active, ending_soon, grace, lapsed) | |
trial_ends_at | string | null (date-time) | |
trial_ends_on | string | null | Human date, e.g. "4 December 2026". |
trial_days_remaining | integer | null | |
trial_setup_complete | boolean | Whether this trial has earned the setup bonus. |
trial_setup_bonus_days | integer | |
trial_lapses_at | string | null (date-time) | When the lapsed-trial restriction actually applies (grace plus any bonus). |
trial_lapses_on | string | null | |
trial_restricts_writes_only | boolean | True when a lapsed trial only blocks writes (reads and exports still work). |
business_id | integer | |
business_name | string | |
can_manage | boolean | |
plan | string | |
plan_label | string | |
price_label | string | |
price_unit | string | null | |
plans | array of object | |
plans[].key | string | |
plans[].sold_key | string | |
plans[].name | string | |
plans[].price_label | string | |
plans[].price_unit | string | null | |
plans[].blurb | string | null | |
plans[].featured | boolean | |
plans[].features | array of string | |
plans[].limits | object | |
plans[].entitlements | array of string | |
plans[].purchasable | boolean | |
plans[].annual | object | null | |
plans[].annual.purchasable | boolean | |
plans[].annual.monthly_equivalent_label | string | |
plans[].annual.yearly_label | string | |
plans[].annual.saving_label | string | null | |
plans[].annual.saving_percent | integer | null | |
plans[].per_site | boolean | |
subscription_status | string | null | |
subscription_active | boolean | |
on_trial | boolean | |
renews_at | string | null | Human date of the current Stripe period end; null unless subscribed. |
portal_url | string (uri) | Browser route to the Stripe portal. |
has_subscription | boolean | |
free_access | boolean | True during free early access: nothing is charged and every trial date is null. |
free_until | string | null (date) | |
free_until_label | string | null | Human date free early access ends. |
free_until_month | string | null | Human month free early access ends. |
purchasable_plans | array of string | |
billing_status | object | |
billing_status.past_due | boolean | |
billing_status.billing_portal_available | boolean | |
billing_status.status | string | null | |
billing_status.portal_url | string | null (uri) | |
billing_status.billed_by_agency | boolean | |
billing_status.free_access | boolean | True during free early access. |
billing_status.free_until | string | null (date) | |
prices_exclude_vat | boolean | |
billed_by | object | null | |
billed_by.id | integer | |
billed_by.name | string | |
is_owner | boolean | |
usage | object | |
usage.submissions | integer | This calendar month. |
usage.forms | integer | |
usage.team_members | integer | Members plus pending invitations. |
limits | object | |
limits.submissions | integer | null | |
limits.forms | integer | null | |
limits.team_members | integer | null |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/billing/checkoutStart a Stripe Checkout session
Returns a Stripe Checkout URL for the chosen plan. It changes nothing on the account: the plan only changes when Stripe's webhook confirms payment. The price comes from server config, never the request. Per-site (Agency) plans are priced by the current billable site count.
business_id must be the selected business (a mismatch with X-Business-Id is 403).
422 when the workspace is billed through its agency, the plan is unknown, or the plan has
no self-service price for that period. 503 when Stripe is unavailable. Reachable when
billing is lapsed.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitive
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
business_idrequired | integer (min 1) | Must exist and match the selected business. |
planrequired | string (max length 50) | Plan key, by its sold name (e.g. |
period | string (one of: month, year; default 'month') |
Responses
200 application/json
Where to send the customer to pay.
| Field | Type | Description |
|---|---|---|
checkout_url | string (uri) |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
POST /api/agency/v1/app/billing/client-workspacesAdd a client workspace under your Agency subscription
Creates a new workspace billed through the paying Agency workspace, with the caller as its owner. It copies the payer's plan and subscription status and its sites join the payer's billable count, which can change what the agency pays: a Stripe quantity sync is queued.
Only an owner of a paying, active (or trialing) per-site Agency workspace that is not
itself a client workspace may do this (403 otherwise). website must be a public domain
(422 otherwise).
Roles: ownerExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
namerequired | string (min length 2; max length 120) | |
website | string | null (max length 255) | The client site's public domain, e.g. |
Responses
201 application/json
The new workspace.
| Field | Type | Description |
|---|---|---|
id | integer | |
name | string | |
slug | string |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/billing/close-workspaceClose the selected workspace
Irreversible. Cancels the Stripe subscription and removes everyone's access immediately
(including this token's access to the workspace), then erases its submissions, files, forms
and subscribers in the background; the owners are emailed when that has finished. Owner only. Confirmed twice:
confirm_name must match the workspace name and password must be the caller's current
password (an account with no password, e.g. Google sign-in, is refused with 422).
422 when the workspace still pays for open client workspaces. 502 when the subscription could not be cancelled; then nothing has changed. Reachable when billing is lapsed.
Roles: ownerExtra rate limits: customer_read, customer_sensitive
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
confirm_namerequired | string (max length 255) | The workspace name, typed exactly (compared after trimming). |
password | string | null (max length 1024) | The caller's current password. Nullable in validation, but required in practice. |
Responses
202 application/json
Closing: access is removed, erasure is still running.
| Field | Type | Description |
|---|---|---|
ok | boolean | |
status | string | |
subscription_cancelled | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
502 application/json
The Stripe subscription could not be cancelled, so nothing was changed.
POST /api/agency/v1/app/billing/portalGet a Stripe billing portal link
Creates a Stripe billing portal session (calls an external API) and returns its URL. The
portal can cancel the subscription and shows invoices, so it is owner/admin only. A
business that has never paid has no Stripe customer; then portal_url is the app's own
billing screen (/#/billing) instead. Reachable when billing is lapsed.
Roles: owner, adminExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The portal (or billing screen) URL.
| Field | Type | Description |
|---|---|---|
portal_url | string (uri) |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/billing/sitesBillable sites under the subscription
What an Agency (per-site) subscription is counting, workspace by workspace, for the workspace that pays (the agency, if the selected business is a client workspace). Includes the monthly estimate and whether the caller may add client workspaces. Reachable when billing is lapsed.
Roles: owner, adminExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The site count.
| Field | Type | Description |
|---|---|---|
per_site | boolean | |
payer | object | |
payer.id | integer | |
payer.name | string | |
count | integer | |
sites | array of string | Every distinct billable site key, sorted. |
monthly_estimate_label | string | null | |
workspaces | array of object | |
workspaces[].id | integer | |
workspaces[].name | string | |
workspaces[].is_payer | boolean | |
workspaces[].sites | array of string | |
can_create_workspaces | boolean |
401 application/json
Missing, expired or revoked credential.
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Forms (management)
GET /api/agency/v1/app/formsList the business's forms
Every (non-deleted) form in the selected business, newest first, with its
submission count, public endpoint URL and the number of leads held in the
last 7 days because they arrived with no reCAPTCHA token
(tokenless_held_7d, the signature of a plain HTML form posting to a
reCAPTCHA-mode form). Not paginated. slack_webhook_url,
recaptcha_secret_key and webhook_secret are never returned.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The business's forms.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].business_id | integer | |
[].parent_form_id | integer | null | |
[].user_id | integer | null | |
[].name | string | |
[].pretty_name | string | null | |
[].uuid | string (uuid) | |
[].endpoint | string (uri) | The public submission URL: |
[].redirect_url | string | null | |
[].email_notifications | boolean | |
[].notification_emails | array of string | null | |
[].reply_to_field | string | null | |
[].sms_enabled | boolean | |
[].whatsapp_enabled | boolean | |
[].notification_phone | string | null | |
[].webhook_url | string | null | |
[].uploads_enabled | boolean | |
[].allowed_domains | array of string | null | |
[].field_mapping | object | array of any | null | |
[].form_schema | array of any | object | null | Normalised form-builder field definitions. |
[].form_styles | object | array of any | null | |
[].recaptcha_enabled | boolean | integer | null | |
[].recaptcha_site_key | string | null | |
[].recaptcha_version | string | null | |
[].spam_protection | string | null (one of: challenge, recaptcha, both, off, null) | |
[].spam_pow_difficulty | integer | null | |
[].is_active | boolean | |
[].max_fields | integer | null | |
[].mailing_list_id | integer | null | |
[].mailing_list_email_field | string | null | |
[].mailing_list_first_name_field | string | null | |
[].mailing_list_last_name_field | string | null | |
[].created_at | string | null (date-time) | |
[].updated_at | string | null (date-time) | |
[].deleted_at | string | null (date-time) | |
[].submissions_count | integer | |
[].tokenless_held_7d | integer |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/formsCreate a form
Creates a form with a fresh UUID endpoint. Defaults to is_active: true and
spam_protection: challenge unless supplied. A default notification is
created automatically. Writes an audit event when delivery fields are set.
A member may create a form, but any security fields they send
(allowed_domains, recaptcha_enabled, spam_protection, is_active,
redirect_url) are silently ignored, and delivery fields are inherited from
the business defaults: sending a delivery value that differs from the
business default returns 403. Enabling sms_enabled/whatsapp_enabled
while that platform channel is off returns 422. allowed_domains is capped
across the whole business (422 when exceeded). mailing_list_id must be a
live list in this business. 409 if the data changed during the operation.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
namerequired | string (max length 255) | |
redirect_url | string | null (uri; max length 2048) | |
reply_to_field | string | null (max length 100) | |
is_active | boolean | |
email_notifications | boolean | |
webhook_url | string | null (uri; max length 2048) | |
sms_enabled | boolean | Cannot be turned on while the platform SMS channel is off (422). |
whatsapp_enabled | boolean | Cannot be turned on while the platform WhatsApp channel is off (422). |
notification_phone | string | null (max length 30) | |
allowed_domains | array of string (hostname) | null | Public hostnames (e.g. |
recaptcha_enabled | boolean | |
spam_protection | string (one of: challenge, recaptcha, both, off) | Which spam defence runs. Defaults to |
mailing_list_id | integer | null | A non-deleted mailing list belonging to this business. |
mailing_list_email_field | string | null (max length 100) | |
mailing_list_first_name_field | string | null (max length 100) | |
mailing_list_last_name_field | string | null (max length 100) | |
form_schema | array of any | null | Form-builder field list; normalised before storage. |
form_styles | object | null | Form-builder style map; normalised before storage. |
Responses
201 application/json
The created form.
| Field | Type | Description |
|---|---|---|
id | integer | |
business_id | integer | |
parent_form_id | integer | null | |
user_id | integer | null | |
name | string | |
pretty_name | string | null | |
uuid | string (uuid) | |
endpoint | string (uri) | The public submission URL: |
redirect_url | string | null | |
email_notifications | boolean | |
notification_emails | array of string | null | |
reply_to_field | string | null | |
sms_enabled | boolean | |
whatsapp_enabled | boolean | |
notification_phone | string | null | |
webhook_url | string | null | |
uploads_enabled | boolean | |
allowed_domains | array of string | null | |
field_mapping | object | array of any | null | |
form_schema | array of any | object | null | Normalised form-builder field definitions. |
form_styles | object | array of any | null | |
recaptcha_enabled | boolean | integer | null | |
recaptcha_site_key | string | null | |
recaptcha_version | string | null | |
spam_protection | string | null (one of: challenge, recaptcha, both, off, null) | |
spam_pow_difficulty | integer | null | |
is_active | boolean | |
max_fields | integer | null | |
mailing_list_id | integer | null | |
mailing_list_email_field | string | null | |
mailing_list_first_name_field | string | null | |
mailing_list_last_name_field | string | null | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) | |
deleted_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/forms/{id}Show one form
One form with its submission count (polled by the editor's go-live panel to
notice the first submission), public endpoint, its default notification
template and tokenless_held_7d.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id (numeric primary key, not the UUID). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The form.
| Field | Type | Description |
|---|---|---|
id | integer | |
business_id | integer | |
parent_form_id | integer | null | |
user_id | integer | null | |
name | string | |
pretty_name | string | null | |
uuid | string (uuid) | |
endpoint | string (uri) | The public submission URL: |
redirect_url | string | null | |
email_notifications | boolean | |
notification_emails | array of string | null | |
reply_to_field | string | null | |
sms_enabled | boolean | |
whatsapp_enabled | boolean | |
notification_phone | string | null | |
webhook_url | string | null | |
uploads_enabled | boolean | |
allowed_domains | array of string | null | |
field_mapping | object | array of any | null | |
form_schema | array of any | object | null | Normalised form-builder field definitions. |
form_styles | object | array of any | null | |
recaptcha_enabled | boolean | integer | null | |
recaptcha_site_key | string | null | |
recaptcha_version | string | null | |
spam_protection | string | null (one of: challenge, recaptcha, both, off, null) | |
spam_pow_difficulty | integer | null | |
is_active | boolean | |
max_fields | integer | null | |
mailing_list_id | integer | null | |
mailing_list_email_field | string | null | |
mailing_list_first_name_field | string | null | |
mailing_list_last_name_field | string | null | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) | |
deleted_at | string | null (date-time) | |
submissions_count | integer | |
tokenless_held_7d | integer | |
default_notification | one of | |
default_notification.id | integer | |
default_notification.form_id | integer | |
default_notification.name | string | null | |
default_notification.recipient_type | string (one of: admin, custom, respondent) | |
default_notification.recipient_email | string | null | |
default_notification.recipient_field | string | null | |
default_notification.reply_to_mode | string (one of: none, static, field) | |
default_notification.reply_to_email | string | null | |
default_notification.reply_to_field | string | null | |
default_notification.subject | string | |
default_notification.body | string | |
default_notification.is_active | boolean | |
default_notification.is_default | boolean | |
default_notification.include_all_fields | boolean | null | |
default_notification.delay_minutes | integer | |
default_notification.respect_business_hours | boolean | |
default_notification.created_at | string | null (date-time) | |
default_notification.updated_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/forms/{id}Update a form
Partial update. Any member may edit cosmetic fields (name, form_schema,
form_styles), but changing a delivery field (webhook_url,
notification_phone, sms_enabled, whatsapp_enabled,
email_notifications, reply_to_field, mailing_list_*) or a security
field (allowed_domains, recaptcha_enabled, spam_protection,
is_active, redirect_url) returns 403 for a member; resending an
unchanged value is allowed. Delivery changes are audited. Enabling SMS or
WhatsApp while the platform channel is off returns 422 (unless already on).
allowed_domains is capped across the whole business (422). 409 if the
data changed during the operation.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id (numeric primary key, not the UUID). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string (max length 255) | |
redirect_url | string | null (uri; max length 2048) | |
reply_to_field | string | null (max length 100) | |
is_active | boolean | |
email_notifications | boolean | |
webhook_url | string | null (uri; max length 2048) | |
sms_enabled | boolean | Cannot be turned on while the platform SMS channel is off (422). |
whatsapp_enabled | boolean | Cannot be turned on while the platform WhatsApp channel is off (422). |
notification_phone | string | null (max length 30) | |
allowed_domains | array of string (hostname) | null | Public hostnames (e.g. |
recaptcha_enabled | boolean | |
spam_protection | string (one of: challenge, recaptcha, both, off) | Which spam defence runs. Defaults to |
mailing_list_id | integer | null | A non-deleted mailing list belonging to this business. |
mailing_list_email_field | string | null (max length 100) | |
mailing_list_first_name_field | string | null (max length 100) | |
mailing_list_last_name_field | string | null (max length 100) | |
form_schema | array of any | null | Form-builder field list; normalised before storage. |
form_styles | object | null | Form-builder style map; normalised before storage. |
Responses
200 application/json
The updated form (re-read from the database).
| Field | Type | Description |
|---|---|---|
id | integer | |
business_id | integer | |
parent_form_id | integer | null | |
user_id | integer | null | |
name | string | |
pretty_name | string | null | |
uuid | string (uuid) | |
endpoint | string (uri) | The public submission URL: |
redirect_url | string | null | |
email_notifications | boolean | |
notification_emails | array of string | null | |
reply_to_field | string | null | |
sms_enabled | boolean | |
whatsapp_enabled | boolean | |
notification_phone | string | null | |
webhook_url | string | null | |
uploads_enabled | boolean | |
allowed_domains | array of string | null | |
field_mapping | object | array of any | null | |
form_schema | array of any | object | null | Normalised form-builder field definitions. |
form_styles | object | array of any | null | |
recaptcha_enabled | boolean | integer | null | |
recaptcha_site_key | string | null | |
recaptcha_version | string | null | |
spam_protection | string | null (one of: challenge, recaptcha, both, off, null) | |
spam_pow_difficulty | integer | null | |
is_active | boolean | |
max_fields | integer | null | |
mailing_list_id | integer | null | |
mailing_list_email_field | string | null | |
mailing_list_first_name_field | string | null | |
mailing_list_last_name_field | string | null | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) | |
deleted_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/forms/{id}Delete a form (soft)
Soft-deletes the form and deactivates it. Its public endpoint answers
410 Gone from then on; its submissions are kept for export and the
retention sweep. The name is rewritten to "<name> (deleted #<id>)" (the
original is kept as pretty_name if none was set) so a new form can reuse
the name. Not restorable through this API. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id (numeric primary key, not the UUID). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Deleted.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/forms/{id}/duplicateDuplicate a form
Copies the form's fields, settings and every notification template under a
new UUID endpoint. The copy is named "<name> (copy)", "(copy 2)" and so
on. Owner/admin only, because the copy carries the source's delivery and
security settings. No request body. 409 if the data changed during the
operation.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Id of the source form. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Responses
201 application/json
The new form.
| Field | Type | Description |
|---|---|---|
id | integer | |
business_id | integer | |
parent_form_id | integer | null | |
user_id | integer | null | |
name | string | |
pretty_name | string | null | |
uuid | string (uuid) | |
endpoint | string (uri) | The public submission URL: |
redirect_url | string | null | |
email_notifications | boolean | |
notification_emails | array of string | null | |
reply_to_field | string | null | |
sms_enabled | boolean | |
whatsapp_enabled | boolean | |
notification_phone | string | null | |
webhook_url | string | null | |
uploads_enabled | boolean | |
allowed_domains | array of string | null | |
field_mapping | object | array of any | null | |
form_schema | array of any | object | null | Normalised form-builder field definitions. |
form_styles | object | array of any | null | |
recaptcha_enabled | boolean | integer | null | |
recaptcha_site_key | string | null | |
recaptcha_version | string | null | |
spam_protection | string | null (one of: challenge, recaptcha, both, off, null) | |
spam_pow_difficulty | integer | null | |
is_active | boolean | |
max_fields | integer | null | |
mailing_list_id | integer | null | |
mailing_list_email_field | string | null | |
mailing_list_first_name_field | string | null | |
mailing_list_last_name_field | string | null | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) | |
deleted_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/forms/{id}/export/panelDownload a form's submissions
Streams every submission of one form as a file download (CSV by default,
or JSON). Sensitive values are masked unless the caller is allowed to see
them unmasked (platform administrators, or when submission masking is
disabled). Every attempt, refusal and outcome is written to the data-access
audit log. HEAD is rejected with 405.
On the agency API the business and requester are taken from the token and
X-Business-Id; the browser panel's signed-link parameters do not apply.
403 Export access unavailable. when current authority cannot be
confirmed; 422 Export options invalid. for a bad format; 503 when the
audit trail cannot be written (no download starts). These bodies use a
message key rather than error.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. Soft-deleted forms in the business can still be exported. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
format | query | string (one of: csv, json; default 'csv') | |
from | query | string (date) | Earliest submission date (inclusive, from start of day). Any date string Carbon can parse; empty means no lower bound. |
to | query | string (date) | Latest submission date (inclusive, to end of day). Empty means no upper bound. |
Responses
200 text/csv
File download. Content-Disposition names it
submissions-<form-slug>-<Ymd-His>.<csv|json>. Sent with
Cache-Control: private, no-store, max-age=0.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
POST /api/agency/v1/app/forms/{id}/testSend a test submission through a form
Stores a real submission (receipt id TEST-XXXXXXXX, data
{name: "Test Submission", email: "test@example.com", _test: true}) and
queues the form's live delivery channels for it: the notification emails
if enabled, the webhook if one is set, and SMS/WhatsApp if enabled with a
phone number. Sends real messages to the configured recipients. No
request body.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The test submission was stored and its deliveries queued.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/forms/{id}/webhook-secretShow the form's webhook signing secret
The per-form secret receivers use to verify X-Formham-Signature-V2. It is
a credential, so owner/admin only. May generate and store a secret if the
form does not yet have one. Re-reads the stored secret; does not rotate it.
Roles: owner, adminExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The secret.
| Field | Type | Description |
|---|---|---|
secret | string | HMAC key for verifying |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/forms/{id}/webhook-secret/rotateRotate the form's webhook signing secret
Generates and stores a new signing secret and returns it. Irreversible: the old secret stops being used immediately, so receivers verifying with it will reject deliveries until updated. Owner/admin only. No request body.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The new secret.
| Field | Type | Description |
|---|---|---|
secret | string | HMAC key for verifying |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/forms/{id}/webhook-testSend a signed sample to a webhook URL
POSTs a sample payload, signed exactly like a real delivery (plus
X-Formham-Test: 1), to url if given or else the form's saved
webhook_url, and reports what came back. Makes an outbound HTTP request
to a customer-chosen address (public addresses only, pinned DNS, no
redirects, 10 s timeout). Nothing is stored. A connection failure still
returns 200 with ok: false. 422 when no URL is available or the URL is not
a public http(s) address. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_external
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
url | string | null (uri; max length 2048) | URL to test instead of the saved |
Responses
200 application/json
The outcome of the test request.
| Field | Type | Description |
|---|---|---|
ok | boolean | True when the receiver answered 2xx. |
status | integer | null | HTTP status returned, or null if the request could not be made. |
latency_ms | integer | |
error | string | null | Why the request could not be made (null when a response came back). |
body | string | null (max length 500) | First 500 characters of the response body. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Notifications
GET /api/agency/v1/app/forms/{id}/notificationsList a form's notification templates
Every email notification template on the form, the system-managed default one first, then by id.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The form's notifications.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].form_id | integer | |
[].name | string | null | |
[].recipient_type | string (one of: admin, custom, respondent) | |
[].recipient_email | string | null | |
[].recipient_field | string | null | |
[].reply_to_mode | string (one of: none, static, field) | |
[].reply_to_email | string | null | |
[].reply_to_field | string | null | |
[].subject | string | |
[].body | string | |
[].is_active | boolean | |
[].is_default | boolean | |
[].include_all_fields | boolean | null | |
[].delay_minutes | integer | |
[].respect_business_hours | boolean | |
[].created_at | string | null (date-time) | |
[].updated_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/forms/{id}/notificationsAdd a notification template to a form
Creates an additional (non-default) notification; is_active defaults to
true. Future submissions to the form will send this email. A member may
create notifications addressed to the business's recipients (admin) or the
submitter (respondent), but recipient_type: custom or
reply_to_mode: static names a fixed destination and returns 403 for a
member. Audited. 409 if the data changed during the operation.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string | null (max length 255) | |
recipient_typerequired | string (one of: admin, custom, respondent) |
|
recipient_email | string | null (max length 1000) | Address(es) for |
recipient_field | string | null (max length 100) | |
reply_to_moderequired | string (one of: none, static, field) |
|
reply_to_email | string | null (email; max length 255) | |
reply_to_field | string | null (max length 100) | |
subjectrequired | string (max length 500) | |
bodyrequired | string (max length 50000) | |
include_all_fields | boolean | |
delay_minutes | integer (min 0; max 20160) | Send delay in minutes (max 14 days). |
respect_business_hours | boolean | |
is_active | boolean |
Responses
201 application/json
The created notification.
| Field | Type | Description |
|---|---|---|
id | integer | |
form_id | integer | |
name | string | null | |
recipient_type | string (one of: admin, custom, respondent) | |
recipient_email | string | null | |
recipient_field | string | null | |
reply_to_mode | string (one of: none, static, field) | |
reply_to_email | string | null | |
reply_to_field | string | null | |
subject | string | |
body | string | |
is_active | boolean | |
is_default | boolean | |
include_all_fields | boolean | null | |
delay_minutes | integer | |
respect_business_hours | boolean | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/forms/{id}/notifications/{notificationId}Update a notification template
Updates any notification on the form, including the default one. Despite
the PATCH verb the same validation as create applies, so
recipient_type, reply_to_mode, subject and body are required on
every call. A member may edit content, but actually changing the
destination to a custom address (or a static reply-to) returns 403.
Audited. 409 if the data changed during the operation.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
notificationIdrequired | path | integer | Notification id (must belong to the form). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string | null (max length 255) | |
recipient_typerequired | string (one of: admin, custom, respondent) |
|
recipient_email | string | null (max length 1000) | Address(es) for |
recipient_field | string | null (max length 100) | |
reply_to_moderequired | string (one of: none, static, field) |
|
reply_to_email | string | null (email; max length 255) | |
reply_to_field | string | null (max length 100) | |
subjectrequired | string (max length 500) | |
bodyrequired | string (max length 50000) | |
include_all_fields | boolean | |
delay_minutes | integer (min 0; max 20160) | Send delay in minutes (max 14 days). |
respect_business_hours | boolean | |
is_active | boolean |
Responses
200 application/json
The updated notification.
| Field | Type | Description |
|---|---|---|
id | integer | |
form_id | integer | |
name | string | null | |
recipient_type | string (one of: admin, custom, respondent) | |
recipient_email | string | null | |
recipient_field | string | null | |
reply_to_mode | string (one of: none, static, field) | |
reply_to_email | string | null | |
reply_to_field | string | null | |
subject | string | |
body | string | |
is_active | boolean | |
is_default | boolean | |
include_all_fields | boolean | null | |
delay_minutes | integer | |
respect_business_hours | boolean | |
created_at | string | null (date-time) | |
updated_at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/forms/{id}/notifications/{notificationId}Delete a notification template
Permanently deletes a non-default notification; irreversible. The default
notification can never be deleted (422 The default notification cannot be deleted.). Owner/admin only (403 otherwise). Audited. 409 if the data
changed during the operation.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Form id. |
notificationIdrequired | path | integer | Notification id (must belong to the form). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Deleted.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Delivery logs
GET /api/agency/v1/app/logsList recent delivery log entries
The 200 most recent delivery attempts (email, webhook, Slack, SMS,
WhatsApp, mailing list, integration hook) across the business's
submissions, newest first. Not paginated and takes no filters. status is
the raw stored value; status_group and status_label are the
customer-facing outcome (a quarantined lead is labelled Held).
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Recent delivery log entries.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].type | string | Channel, e.g. |
[].status | string (one of: success, delivered, failed, queued, pending, skipped, superseded, unknown) | Raw stored status. |
[].status_group | string (one of: sent, deferred, delivered, failed, pending, skipped) | |
[].status_label | string | Display label, e.g. |
[].recipient | string | null | Display form of the destination. |
[].message | string | null | |
[].form | string | The form's name, or |
[].receipt_id | string | null | |
[].time | string |
|
[].date | string |
|
[].is_today | boolean | |
[].at | string | null (date-time) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/logs/failed-countCount today's failed deliveries
Number of delivery log rows with raw status failed created today (server
day) for the business's submissions. Drives the failure badge.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The count.
| Field | Type | Description |
|---|---|---|
count | integer (min 0) |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/logs/{id}/retryRetry a failed delivery
Re-dispatches one failed delivery. May send a real email, webhook, Slack
message, SMS/WhatsApp or third-party sync. Only a row whose raw status is
failed is eligible; the claim is atomic, so a concurrent double retry
dispatches once and the loser gets 409.
Per channel: email, slack, mailing_list and a live hook mark this
row queued and the job resolves it; webhook leaves this row as is and
the job writes a fresh row; sms/whatsapp mark this row superseded and
send again when the channel is live, or mark it skipped when the provider
is not configured; a hook whose subscription is gone does nothing. No
request body.
409 Only a failed delivery can be retried. or That submission no longer exists.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Delivery log row id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Retry accepted (or settled with nothing to dispatch).
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Mailing lists
GET /api/agency/v1/app/mailing-list-destination-providersList the destination types a mailing list can mirror to
Every external provider a list can be mirrored to, with the config keys
each one accepts and which of them are secrets (returned masked as ***
elsewhere). Static; not business-specific.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The providers.
| Field | Type | Description |
|---|---|---|
[].key | string (one of: mailchimp, contentmate, webhook, google_sheets, brevo, mailerlite, hubspot, pipedrive) | |
[].label | string | |
[].fields | array of string | Config keys this provider accepts. |
[].secret_fields | array of string | Config keys that are secrets (masked as |
[].boolean_fields | array of string | Config keys that are booleans. |
[].optional_fields | array of string | Config keys that may be left out. |
[].testable | boolean | Whether the connection test endpoints support this provider. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/mailing-listsList the business's mailing lists
Every (non-deleted) mailing list ordered by name, with subscriber counts and
its destinations. Destination config secrets are masked as ***. Not
paginated.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The mailing lists.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].name | string | |
[].description | string | null | |
[].is_active | boolean | null | May be null in the create response, which does not re-read database defaults. |
[].subscribers | integer | All subscribers, including unsubscribed. |
[].active | integer | Current (not unsubscribed) subscribers. |
[].destinations | array of object | |
[].destinations[].id | integer | |
[].destinations[].provider | string | Provider key, e.g. |
[].destinations[].provider_label | string | |
[].destinations[].label | string | null | |
[].destinations[].is_active | boolean | |
[].destinations[].config | object | Provider config with every secret key that is set replaced by |
[].destinations[].last_synced_at | string | null (date-time) | |
[].destinations[].last_error | string | null | |
[].destinations[].is_failing | boolean | True when |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/mailing-listsCreate a mailing list
Creates an empty mailing list in the business. Owner/admin only (403 Only an owner or admin can manage mailing lists.).
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
namerequired | string (max length 255) | |
description | string | null (max length 1000) |
Responses
201 application/json
The created list (counts are always 0).
| Field | Type | Description |
|---|---|---|
id | integer | |
name | string | |
description | string | null | |
is_active | boolean | null | May be null in the create response, which does not re-read database defaults. |
subscribers | integer | All subscribers, including unsubscribed. |
active | integer | Current (not unsubscribed) subscribers. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/mailing-lists/{id}Rename or redescribe a mailing list
Updates the list's name and/or description. Where the list is mirrored to is managed through the destination endpoints instead. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
name | string (max length 255) | |
description | string | null (max length 1000) |
Responses
200 application/json
Updated.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/mailing-lists/{id}Delete a mailing list (soft)
Soft-deletes the list; it disappears from the API and can no longer be chosen by a form. Not restorable through this API. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Deleted.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/mailing-lists/{id}/destinationsMirror a mailing list to an external system
Adds an active destination; every future subscriber on the list is then
sent to that third party (use the backfill endpoint for existing ones).
config is validated by the chosen provider's own rules (see
GET /app/mailing-list-destination-providers) and stored encrypted.
label defaults to the provider's label. Audited as a data-sharing event.
Owner/admin only. 422 Unknown destination type. (with an allowed list of
provider keys) for an unrecognised provider.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
Request body application/json
| Field | Type | Description |
|---|---|---|
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object |
|
config.audience_idrequired | string (max length 64) | |
config.api_key | string | null (max length 128) | Secret. |
config.server_prefix | string | null | Data-centre prefix, e.g. |
config.credentials_from | string | null (one of: business, null) | |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.base_urlrequired | string (uri; max length 255) | Must be https. |
config.tokenrequired | string (max length 255) | Secret. Must carry the |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.urlrequired | string (uri; max length 2048) | Must be https. |
config.secret | string | null (max length 255) | Secret. |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.urlrequired | string (max length 2048) | An Apps Script web app URL: |
config.secret | string | null (max length 255) | Secret. |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.api_keyrequired | string (max length 255) | Secret. |
config.list_idrequired | string | integer | |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.api_keyrequired | string (max length 2048) | Secret. |
config.group_id | string | integer | null | |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.access_tokenrequired | string (max length 255) | Secret. A private app access token. |
config.add_note | boolean | null | |
providerrequired | string | |
label | string | null (max length 120) | |
configrequired | object | |
config.api_tokenrequired | string (max length 255) | Secret. |
config.company_domainrequired | string | The |
config.create_lead | boolean | null | |
config.add_note | boolean | null |
Responses
201 application/json
Created.
| Field | Type | Description |
|---|---|---|
ok | boolean | |
id | integer | The new destination's id. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PATCH /api/agency/v1/app/mailing-lists/{id}/destinations/{destinationId}Update a mailing-list destination
Changes the label, active flag or individual config keys. Every config key
is optional on update and is merged into the stored config; sending ***
for a secret key (what the API returns for it) leaves the stored secret
unchanged. The provider cannot be changed. Owner/admin only. 422 Unknown destination type. if the stored provider is no longer supported.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
destinationIdrequired | path | integer | Destination id (must belong to the list). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
label | string | null (max length 120) | Null or omitted keeps the current label. |
is_active | boolean | |
config | object | Any subset of the provider's config keys, each validated by the
provider's rule for it. |
Responses
200 application/json
Updated.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/mailing-lists/{id}/destinations/{destinationId}Stop mirroring a mailing list to a destination
Deletes the destination and its stored credentials. Subscribers already sent to the third party stay there. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
destinationIdrequired | path | integer | Destination id (must belong to the list). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Deleted.
| Field | Type | Description |
|---|---|---|
ok | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/mailing-lists/{id}/destinations/{destinationId}/backfillPush every existing subscriber to a destination
Queues one sync job per subscriber on the list (an upsert for current subscribers, an unsubscribe for those who have left), sending their details to the third party. Audited with the number queued. Repeating it queues everyone again. No request body. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
destinationIdrequired | path | integer | Destination id (must belong to the list). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
Jobs queued.
| Field | Type | Description |
|---|---|---|
ok | boolean | |
queued | integer (min 0) | Number of subscriber sync jobs queued. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/mailing-lists/{id}/destinations/testTest destination credentials before saving them
Makes one read-only call to the vendor with the supplied config. Nothing is stored and no
subscriber data is sent. Only providers whose testable is true. Owner/admin only.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
providerrequired | string | |
configrequired | object | The same keys as when creating a destination for this provider. |
Responses
200 application/json
The test ran; see ok.
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the vendor accepted the credentials. A refusal is still HTTP 200. |
message | string |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/mailing-lists/{id}/destinations/{destinationId}/testTest a saved destination's stored credentials
One read-only call to the vendor. Does not change the destination's sync status. Owner/admin only. No request body.
Roles: owner, adminExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
destinationIdrequired | path | integer | Destination id (must belong to the list). |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 application/json
The test ran; see ok.
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the vendor accepted the credentials. A refusal is still HTTP 200. |
message | string |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/mailing-lists/{id}/exportDownload a list's current subscribers as CSV
Streams the list's current (not unsubscribed) subscribers as a CSV file
download, columns Email, First name, Last name, Source, Subscribed at
(ISO 8601). Bulk personal-data extraction: owner/admin only, and every
attempt, refusal and outcome is audited. 503 when the audit trail cannot be
written (no download starts). HEAD is rejected with 405.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 text/csv
File download named list-<id>-subscribers.csv, sent with Cache-Control: private, no-store, max-age=0.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
GET /api/agency/v1/app/mailing-lists/{id}/export/allDownload every subscriber, including unsubscribed, as CSV
Streams all of the list's subscribers, including those who
unsubscribed, ordered by subscription date, as a CSV file download with
columns Email, First Name, Last Name, Source, Subscribed At, Unsubscribed At (Y-m-d H:i:s). Owner/admin only; audited exactly like the
current-subscriber export. 503 when the audit trail cannot be written.
HEAD is rejected with 405.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Responses
200 text/csv
File download named subscribers-<Y-m-d>.csv, sent with Cache-Control: private, no-store, max-age=0.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
GET /api/agency/v1/app/mailing-lists/{id}/subscribersList a mailing list's current subscribers
Current (not unsubscribed) subscribers, most recently subscribed first, 50
per page. subscribed_at is a human-relative string (e.g. 3 days ago),
not a timestamp; use the CSV export for exact times.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Mailing list id. |
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
page | query | integer (min 1; default 1) |
Responses
200 application/json
A page of subscribers.
| Field | Type | Description |
|---|---|---|
data | array of object | |
data[].id | integer | |
data[].email | string | |
data[].first_name | string | null | |
data[].last_name | string | null | |
data[].source | string | null | |
data[].subscribed_at | string | Human-relative time, e.g. |
current_page | integer | |
last_page | integer | |
per_page | integer | |
total | integer | |
from | integer | null | |
to | integer | null | |
first_page_url | string | |
last_page_url | string | |
next_page_url | string | null | |
prev_page_url | string | null | |
path | string | |
links | array of object | |
links[].url | string | null | |
links[].label | string | |
links[].active | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
Leads (management)
GET /api/agency/v1/app/submission-files/{submissionFile}Download one submission attachment
Streams the stored bytes of one uploaded file as an attachment (Content-Disposition: attachment,
Content-Type is the file's sniffed MIME type, X-Content-Type-Options: nosniff). This is the
bearer-authenticated equivalent of the browser's signed download link and is the download_url
returned by GET /app/submissions/{id}.
The file must belong to a submission of the selected business; a file of another tenant answers 404
exactly like one that does not exist. A file whose stored object was removed by a prune or an erasure
also answers 404. Every download is written to the data-access audit log. HEAD is refused with 405.
Roles: owner, admin, memberExtra rate limits: customer_read, 60,1
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
submissionFilerequired | path | integer (min 1) | Submission file id (route-model bound). |
Responses
200 application/octet-stream
The file's bytes.
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/submissionsList the business's submissions (the inbox)
The inbox list for the selected business, newest first, 50 per page.
Filters only ever narrow the business-scoped query, so a form_id from another tenant simply matches
nothing. Without lead_status (and outside view=held) rows already marked spam are left out; pass
lead_status=spam to see them. from / to that do not parse are ignored rather than rejected.
q is a free-text search applied last (an email address, a receipt id, or text); search in the
response says how it was interpreted.
With all=true the response is not paginated: up to 500 rows as {data, total}.
held_count (quarantined rows in the business, whatever the filter) is included either way.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
view | query | string (one of: held) |
|
form_id | query | integer (min 1) | Only submissions of this form (digits only; anything else is ignored). |
lead_status | query | string (one of: new, contacted, won, lost, spam) | Follow-up status filter. |
from | query | string (date) | Inclusive start date (start of day). Unparseable values are ignored. |
to | query | string (date) | Inclusive end date (end of day). Unparseable values are ignored. |
q | query | string | Free-text search (email address, receipt id, or text in the submission). |
all | query | boolean (default false) | Return up to 500 rows unpaginated instead of a page of 50. |
page | query | integer (min 1; default 1) | Page number (paginated mode only). |
Responses
200 application/json
A page of submissions, or (with all=true) up to 500 unpaginated.
| Field | Type | Description |
|---|---|---|
data | array of object | |
data[].id | integer | |
data[].form_id | integer | |
data[].form | string | Form name, or |
data[].email | string | The submission's email field, or |
data[].name | string | The submission's name field, or |
data[].status | string (one of: held, failed, deferred, pending, sent, delivered, stored) | What became of the submission's deliveries: |
data[].lead_status | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
data[].time_ago | string | Short relative age, or |
data[].receipt_id | string (uuid) | |
data[].created_at | string | Formatted |
data[].held | boolean | Quarantined (held for review). |
data[].held_reason | string | null | Plain-English reason written by the ingest pipeline; null unless held. |
data[].held_hint | string | null (one of: likely_promotional, possibly_genuine, null) | A triage hint (not a verdict) for held, unerased rows; null otherwise. |
current_page | integer | |
last_page | integer | |
per_page | integer | |
total | integer | |
from | integer | null | |
to | integer | null | |
first_page_url | string | |
last_page_url | string | |
next_page_url | string | null | |
prev_page_url | string | null | |
path | string | |
links | array of object | |
links[].url | string | null | |
links[].label | string | |
links[].active | boolean | |
held_count | integer | Quarantined submissions in the business. |
search | object | null | How |
search.mode | string (one of: none, email, receipt, text) | |
search.scanned | integer | Rows decrypted and scanned for a text search. |
search.truncated | boolean | True when the text scan stopped at its cap. |
data | array of object (max items 500) | |
data[].id | integer | |
data[].form_id | integer | |
data[].form | string | Form name, or |
data[].email | string | The submission's email field, or |
data[].name | string | The submission's name field, or |
data[].status | string (one of: held, failed, deferred, pending, sent, delivered, stored) | What became of the submission's deliveries: |
data[].lead_status | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
data[].time_ago | string | Short relative age, or |
data[].receipt_id | string (uuid) | |
data[].created_at | string | Formatted |
data[].held | boolean | Quarantined (held for review). |
data[].held_reason | string | null | Plain-English reason written by the ingest pipeline; null unless held. |
data[].held_hint | string | null (one of: likely_promotional, possibly_genuine, null) | A triage hint (not a verdict) for held, unerased rows; null otherwise. |
total | integer | Number of rows returned (not the business total). |
held_count | integer | |
search | object | null | How |
search.mode | string (one of: none, email, receipt, text) | |
search.scanned | integer | Rows decrypted and scanned for a text search. |
search.truncated | boolean | True when the text scan stopped at its cap. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/submissions/bulk/lead-statusSet the follow-up status of up to 100 submissions
Sets the same lead status on every listed submission of the selected business. Ids from another tenant
or that do not exist are skipped silently; ids / updated in the response report what was changed.
Last write wins on concurrent updates. Day-to-day work: any member may do it.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
idsrequired | array of integer (min 1) (max items 100) | |
statusrequired | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
Responses
200 application/json
The submissions that were updated.
| Field | Type | Description |
|---|---|---|
updated | integer | |
ids | array of integer | |
lead_status | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/submissions/{id}Show one submission
The full submission for the inbox detail view. Answers are split server-side: fields holds what the
visitor answered; technical_fields holds underscore metadata, plugin plumbing (CF7 _wpcf7*,
captcha tokens) and, when the business hides technical fields (the default), recognised technical keys.
Attachments carry a download_url pointing at GET /app/submission-files/{submissionFile};
preview_url is always null on this transport. A submission of another tenant answers 404.
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Responses
200 application/json
The submission.
| Field | Type | Description |
|---|---|---|
fields | object | The visitor's answers, flattened, keyed by field name. |
technical_fields | object | Underscore metadata and plugin/captcha plumbing. |
page_url | string | null |
|
ip | string | null | |
created_at | string | null | Formatted |
lead_status | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
erased | boolean | True when the submission was GDPR-redacted. |
held | boolean | |
held_reason | string | null | |
files | array of object | |
files[].id | integer | |
files[].filename | string | |
files[].bytes | integer | |
files[].mime | string | |
files[].download_url | string (uri) |
|
files[].preview_url | null | Always null on the agency transport. |
logs | array of object | |
logs[].type | string | Delivery channel, e.g. |
logs[].status | string | Raw stored status. |
logs[].status_group | string | Normalised outcome group (e.g. delivered, failed, pending, skipped). |
logs[].status_label | string | |
logs[].recipient | string | null | |
logs[].message | string | null |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
PUT /api/agency/v1/app/submissions/{id}/lead-statusSet one submission's follow-up status
Sets the lead status (new / contacted / won / lost / spam). Marking spam hides the lead from the
default inbox list. Last write wins on concurrent updates. Any member may do it.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Request body application/json
| Field | Type | Description |
|---|---|---|
statusrequired | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
Responses
200 application/json
The status now stored.
| Field | Type | Description |
|---|---|---|
lead_status | string (one of: new, contacted, won, lost, spam) | Follow-up status. A submission with no status set reads as |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
GET /api/agency/v1/app/submissions/{id}/notesList a submission's internal team notes
Internal notes on the submission, oldest first. can_delete says whether the caller may delete each one (its author, or an owner/admin).
Roles: owner, admin, memberExtra rate limits: customer_read
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Responses
200 application/json
The notes.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].body | string | |
[].author | string | Author's name, or |
[].created_at | string | null | Formatted |
[].can_delete | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/submissions/{id}/notesAdd an internal team note to a submission
Adds a note (trimmed; an all-whitespace body is a 422 The note is empty.) and returns the full,
updated note list. An erased (GDPR-redacted) submission takes no new notes: 409
This submission was erased; notes cannot be added to it. Any member may add a note.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Idempotency-Key | header | string (min length 1; max length 255) | Makes a retried create safe. See "Idempotency" above. Kept for 24 hours. |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Request body application/json
| Field | Type | Description |
|---|---|---|
bodyrequired | string (max length 5000) |
Responses
201 application/json
Note added; the submission's full note list.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].body | string | |
[].author | string | Author's name, or |
[].created_at | string | null | Formatted |
[].can_delete | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
DELETE /api/agency/v1/app/submissions/{id}/notes/{noteId}Delete an internal team note
Deletes one note and returns the remaining note list. Its author may delete it; otherwise owner/admin
only (403 Only the note's author or a workspace owner/admin can delete it.).
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
noteIdrequired | path | integer (min 1) |
Responses
200 application/json
Note deleted; the remaining notes.
| Field | Type | Description |
|---|---|---|
[].id | integer | |
[].body | string | |
[].author | string | Author's name, or |
[].created_at | string | null | Formatted |
[].can_delete | boolean |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
POST /api/agency/v1/app/submissions/{id}/releaseRelease a held (quarantined) submission for delivery
Runs the normal delivery pipeline once for a held lead: sends the notification emails, webhooks and
integration hooks exactly as if it had arrived cleanly. Idempotent: a lead that is no longer held
(already released, by you or a teammate racing you) answers 200 with released: false, already_released: true and nothing is sent again.
409 This lead cannot be released... when it was erased or its upload is still processing.
503 when delivery could not be queued; the lead stays held and nothing was sent. Any member may release.
Roles: owner, admin, memberExtra rate limits: customer_read, customer_write
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Responses
200 application/json
Released, or already released.
| Field | Type | Description |
|---|---|---|
released | boolean | |
already_released | boolean | Present (true) only when the lead was no longer held. |
status | string (one of: held, failed, deferred, pending, sent, delivered, stored) | What became of the submission's deliveries: |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
409 application/json
The resource's state does not allow this, or an Idempotency-Key request is still in flight.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
Privacy & erasure
Audited, owner/admin-only, irreversible or data-exporting operations. Require human approval in automated workflows.
POST /api/agency/v1/app/submissions/bulk/deletePermanently delete up to 100 submissions
Irreversible. Hard-deletes each listed submission of the selected business (including soft-deleted
ones) with its files, delivery logs and linked mailing-list subscribers, and writes a deletion tombstone
so a later agency DELETE /submissions/{receiptId} for the same receipt answers "already gone".
Ids from another tenant or that do not exist are skipped silently; ids in the response lists what was
actually deleted.
Owner/admin only (403 Only an owner or admin can delete submissions.; the refusal is audited). Every
row is audited before and after. If an audit write or a deletion fails mid-batch the request stops and
answers 503 with the partial result: {error, deleted, ids} naming the rows already deleted.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
idsrequired | array of integer (min 1) (max items 100) |
Responses
200 application/json
What was deleted.
| Field | Type | Description |
|---|---|---|
deleted | integer | |
ids | array of integer |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
404 application/json
Absent, or not reachable with this token (the two are indistinguishable).
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
Stopped part-way (audit or deletion failure). Rows already deleted are listed.
POST /api/agency/v1/app/submissions/erase-by-emailErase every submission from one email address (GDPR erasure)
Irreversible. Redacts the personal data of every submission in the selected business that belongs
to the given address, redacts matching mailing-list subscribers and delivery-log recipients/messages,
and deletes attached files. Rows are kept as redacted tombstones (_gdpr_redacted), not deleted.
Owner/admin only (403 Only an owner or admin can erase submission data.; the refusal is audited).
The attempt and outcome are audited; if an audit write fails no erasure starts (503), and a failure
during erasure answers 503 asking you to reconcile from the audit trail.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
Request body application/json
| Field | Type | Description |
|---|---|---|
emailrequired | string (email) |
Responses
200 application/json
Erasure counts.
| Field | Type | Description |
|---|---|---|
erased | integer | Same as |
email | string | The normalised address that was erased. |
business_id | integer | |
redacted_submissions | integer | |
redacted_subscribers | integer | |
redacted_logs | integer | |
deleted_files | integer |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
GET /api/agency/v1/app/submissions/exportExport submissions as CSV, or one data subject's data (DSAR)
Two modes, both owner/admin only (403 Only an owner or admin can export submission data.) and fully
audited. Always a file download; HEAD is refused with 405.
- Without
email: a UTF-8 CSV (with BOM) of the business's submissions, one row per submission:Receipt ID, Form, Status, Submitted At, one column per field key seen (underscore keys skipped), thenLead Statuslast. Narrow withfrom,to,form_idandids. - With
email: a subject-access export for that address within this business.subject-data.json(application/json) or, when any matching submission has attachments,subject-data.zip(application/zip) containing the JSON and the files. An invalid address answers 422A valid subject email address is required.
If an audit write fails, or preparation fails, nothing is downloaded and the answer is 503.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
email | query | string (email; max length 254) | Subject email address. Its presence switches to the DSAR export. Max 254 characters. |
from | query | string (date) | CSV mode only. Inclusive start date. |
to | query | string (date) | CSV mode only. Inclusive end date. |
form_id | query | integer (min 1) | CSV mode only. Only this form's submissions. |
ids | query | string | CSV mode only. Comma-separated submission ids ("export selected"); non-digit entries are dropped, capped at 500. |
Responses
200 text/csv
The export file (Cache-Control: private, no-store).
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.
POST /api/agency/v1/app/submissions/{id}/eraseErase one submission's personal data (GDPR erasure)
Irreversible. Redacts the submission's data (it remains as a _gdpr_redacted tombstone), redacts
its delivery logs and deletes its files. Reaches soft-deleted submissions too.
An id that does not exist in the selected business is not a 404: it answers 200 with
redacted_submissions: 0. Owner/admin only (403 Only an owner or admin can erase submission data.,
audited). Attempt and outcome are audited; an audit failure means no erasure (503), and a failure during
erasure answers 503 asking you to reconcile from the audit trail.
Note: unlike the other {id} routes this one has no numeric router constraint; send an integer.
Roles: owner, adminExtra rate limits: customer_read, customer_sensitiveSecurity: admin MFA and IP allowlist enforced for platform admins
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Business-Id | header | integer (min 1) | The business this management request acts on. Optional for a token pinned to one business; required
otherwise (422 when missing). A |
idrequired | path | integer (min 1) | Submission id (numeric; scoped to the selected business). |
Responses
200 application/json
Erasure result.
| Field | Type | Description |
|---|---|---|
ok | boolean | |
business_id | integer | Absent when nothing matched. |
redacted_submissions | integer (one of: 0, 1) | 0 when no such submission exists in this business. |
redacted_logs | integer | |
deleted_files | integer | Absent when nothing matched. |
401 application/json
Missing, expired or revoked credential.
402 application/json
The business's subscription or trial has lapsed, or a plan limit was reached (payment_required or a specific code).
403 application/json
The token, plan, opt-in, role or membership refuses this action. Codes include
token_not_scoped_for_agency_api, business_not_accessible, insufficient_role and the generic forbidden.
Do not retry.
422 application/json
Invalid input (validation_failed with errors), or a specific code such as idempotency_key_reused.
423 application/json
The business is suspended (business_suspended).
429 application/json
A rate limit was exceeded. Wait for Retry-After.
503 application/json
A temporary failure (audit store, file storage, provider). Retry with backoff.