Authentication
API keys: format, types, scopes, roles, policies, rotation and revocation.
Every request to https://mform.md/api/public/v1 carries Authorization: Bearer mf_live_<8>_<32>. Dashboard cookies are never read by the API. A key belongs to one workspace; we store only an HMAC of it, so a lost key cannot be shown again — rotate it.
MCP clients can also sign in with OAuth instead of a key (see OAuth 2.1). OAuth access tokens (mfo_…) work only on the MCP endpoint, never on the REST API.
Key types (presets)
Settings → Developers → API keys, workspace owners and admins only. The type sets the role and the scopes; personal data is a separate tick; you can limit the key to some forms.
| Type | id | Role | Scopes |
|---|---|---|---|
| Read only | read_only | viewer | workspace:read, forms:read, responses:read |
| Zapier / Make | zapier_make | admin | workspace:read, forms:read, forms:write, responses:read, files:read, webhooks:manage |
| AI agent (MCP) | ai_agent | editor | workspace:read, forms:read, forms:write, responses:read, ai:summarize |
| Full access | full_access | admin | workspace:read, forms:read, forms:write, responses:read, responses:delete, files:read, ai:summarize, webhooks:manage |
Scopes
| Scope | Allows | Minimum role | Plan | Where |
|---|---|---|---|---|
| workspace:read | GET /me: the workspace, the key, usage | viewer | all | API + MCP |
| forms:read | forms, questions, projects, templates, form.* events | viewer | all | API + MCP |
| responses:read | responses (personal data redacted), exports, print links, response events | viewer | all | API + MCP |
| forms:write | create and edit forms and questions, publish, share links | editor | Pro+ | API + MCP |
| ai:summarize | AI summaries | editor | Pro+ | API + MCP |
| responses:pii | respondent name, e-mail, phone and contact answers in clear | editor (explicit opt-in) | all | API + MCP |
| responses:delete | delete and restore responses (restorable 30 days) | admin | Pro+ | API + MCP |
| files:read | file and recording contents (15-minute links) | editor (explicit opt-in) | all | API only |
| webhooks:manage | webhook endpoints, deliveries, retries | admin (explicit opt-in) | Business+ | API only |
What a key can actually do
- Effective rights = the key's scopes ∩ the CURRENT role of the person who created it ∩ the workspace plan ∩ the workspace policies ∩ the key's form list. GET /me shows the result.
- Demoted creator: the key is capped on the next request. Creator removed from the workspace: the key is suspended for good (401 api_key_suspended).
- Write scopes (forms:write, ai:summarize, responses:delete) need Pro or higher; webhooks:manage needs Business or higher. When only the plan blocks a call you get 403 plan_feature_missing, otherwise 403 scope_missing.
- Personal data needs the tick on the key, the workspace policy "Allow personal data through the API" and role editor or higher. files:read additionally needs personal data.
- A key limited to some forms sees only those forms, their responses and their events; everything else is 404.
Workspace policies
- "Allow the public API" off: every key gets 403 channel_disabled.
- "Allow personal data through the API" off: no key receives personal data, whatever its tick.
- IP allowlist (workspace security settings): calls from other addresses get 403 ip_not_allowed.
Lifecycle
- Expiry: 30, 90 or 365 days (default 365). Keys without expiry: Business and up.
- Rotate: a new key with the same rights; the old one keeps working for 24 hours.
- Revoke: immediate (401 api_key_revoked). Expired keys: 401 api_key_expired.
- Security e-mails to the admins: key created, rotated, revoked, suspended, and 7 days before expiry.
- Keys in the old format (mf_<8>_<32>) are accepted until 25 February 2027 and marked legacy in GET /me: rotate them.
- Never put a key in a browser, a mobile app or a public repository.
Authentication errors
| HTTP | code | When |
|---|---|---|
| 401 | api_key_missing | no Authorization header |
| 401 | api_key_invalid | malformed or unknown key, or an OAuth token sent to the REST API |
| 401 | api_key_revoked | revoked, or the old key after the rotation grace |
| 401 | api_key_expired | past its expiry |
| 401 | api_key_suspended | its creator left the workspace |
| 403 | workspace_inactive | the workspace was deleted |
| 403 | ip_not_allowed | not in the IP allowlist |
| 403 | channel_disabled | the admin turned the public API off |