Muster CRMDocs

Authentication

Learn how to authenticate with the Muster CRM API using API keys.

The Muster CRM API uses API keys for authentication. Each API key has specific permissions that control what operations it can perform.

API key format

API keys follow this format:

muster_<43-character-random-string>

The muster_ prefix identifies the key as a Muster CRM key. Keys minted before 2026-09-26 start with crm_, and before 2026-09-13 with wmbly_; both keep working, because a key is stored only as a hash and nothing can rewrite the one in your integration. The remaining 43 characters are 32 random bytes encoded as base64url (no padding): 256 bits of entropy, so brute-forcing a valid key is computationally infeasible.

Keys are stored as a SHA-256 hash; the plaintext is shown exactly once on creation. To help you spot a key in the dashboard without exposing the secret, we store the brand plus the first 2 random characters (key_prefix, e.g. muster_ab) and the last 4 characters (key_suffix, e.g. wxyz). Render them as muster_ab…wxyz.

Using your API key

Include your API key in the Authorization header of every request:

curl -X GET "https://api.muster.cdaeris.com/v1/api-keys" \
  -H "Authorization: Bearer muster_abc123..." \
  -H "Content-Type: application/json"

For mutation retries, include an Idempotency-Key header with a unique value per logical operation. Muster CRM stores completed mutation responses for 24 hours per organization and key, then replays matching retries instead of performing the operation again. A key belongs to the credential and the exact request that first used it, resource ids included; see retry safety for how refusals and server errors are handled.

Verifying a credential

To check that a credential is valid and see who it belongs to, call GET /v1/me. It works with an API key, an OAuth access token, or a dashboard session, requires no specific permission, and returns the caller's identity:

curl -X GET "https://api.muster.cdaeris.com/v1/me" \
  -H "Authorization: Bearer muster_abc123..."
{
  "user_id": "0b1f...",
  "email": "jane@acme.com",
  "name": "Jane Doe",
  "organization_id": "9a2c...",
  "organization_name": "Acme Inc",
  "auth_type": "api_key",
  "scopes": ["read_contacts", "write_contacts"]
}

auth_type is api_key, oauth, or jwt, and scopes lists the granted API scopes for key and OAuth callers (empty for dashboard sessions, which use organization roles instead). This is the right endpoint for an integration to validate a connection and render a label. The separate GET /v1/auth/me is session-only and is not reachable with an API key or OAuth token.

OAuth access tokens

API keys authenticate your own scripts. If you are building an app that other people connect their Muster CRM workspace to, use OAuth instead: the user grants your app scoped access and you receive a bearer access token (prefix wmat_). It goes in the same Authorization: Bearer header and is checked against the same permissions, so every endpoint below behaves identically whether you present an API key or an OAuth token. The difference is only how the credential is obtained. See OAuth for the full flow.

Key security best practices

Keep Your Keys Secret

Never expose API keys in client-side code, public repositories, or logs. Treat them like passwords.

Do

  • Store API keys in environment variables or secure secret managers
  • Use different keys for development and production
  • Restrict keys to only the permissions they need
  • Set expiration dates for keys when possible
  • Use IP allowlists to restrict key usage

Don't

  • Commit API keys to version control
  • Share API keys via email or chat
  • Use production keys in development
  • Give keys more permissions than necessary

Permissions

Each API key has a permissions bitmask that controls its capabilities. See the Permissions Reference for a complete list. A key (or OAuth grant) is also capped at its creator's current role, checked on every request; see Capped at the creator's role.

Permission categories

CategoryDescription
ReadView resources (emails, campaigns, contacts, etc.)
WriteCreate and modify resources
BulkPerform bulk operations
SpecialAdvanced features (realtime, webhooks, API key management)

Example: read-only key

A read-only API key might have these permissions:

{
  "permissions": 31
}

This combines:

  • READ_EMAILS (1)
  • READ_CAMPAIGNS (2)
  • READ_CONTACTS (4)
  • READ_UNIBOX (8)
  • READ_ANALYTICS (16)

Total: 1 + 2 + 4 + 8 + 16 = 31

IP restrictions

You can restrict API keys to specific IPs or CIDR ranges. Entries can be bare IPs (v4 or v6) or CIDR blocks; an empty list means "any IP".

{
  "name": "Production Server",
  "permissions": 688159,
  "allowed_ips": [
    "203.0.113.10",
    "203.0.113.11",
    "10.0.0.0/8",
    "2001:db8::/32"
  ]
}

Requests from outside every listed range are rejected with 403 Forbidden. There's a soft cap of 64 entries per key.

Email account restrictions

Limit API keys to specific email accounts:

{
  "name": "Marketing Team",
  "permissions": 127,
  "allowed_email_accounts": [
    "550e8400-e29b-41d4-a716-446655440000",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  ]
}

A restricted key reaches only those mailboxes and their mail. Every endpoint either applies the list, touches no mailbox at all, or refuses the key with 403 and code api_key_mailbox_limited. A new endpoint is refused to a restricted key until it is classified, so the limit cannot be skipped by a route that forgot to check it.

  • Mailboxes. GET /emails lists only the listed mailboxes, and every /emails/:id route and PATCH /emails/tags refuse any other mailbox.
  • Unibox. GET /unibox searches only the listed mailboxes, and naming another in email_id or email_ids is refused. GET /unibox/thread refuses another mailbox's email_id, and without one returns only the listed mailboxes' messages. GET /unibox/:id and the attachment routes answer 404 for a message in another mailbox. GET /unibox/count counts only the listed mailboxes. POST /unibox/reply and POST /unibox/compose send only from a listed mailbox, and compose's automatic pick needs email_account_id unless the key lists a single mailbox. GET /unibox/compose/candidates offers only listed mailboxes. GET /unibox/folders/live and GET /unibox/folders/live/message refuse another mailbox's email_id. PUT /unibox/ai-drafts/by-thread drafts only on a thread that arrives in a listed mailbox. The other Unibox endpoints (folders, labels, seen state, thread actions, drafts, agent drafts, snoozes, scheduled sends and the overview) refuse a restricted key.
  • Campaigns. A restricted key's campaigns use an explicit sender list (sender_strategy explicit) of its mailboxes. POST /campaigns, PATCH /campaigns/:id and PUT /campaigns/:id/senders refuse a pool resolved from mailbox tags or a sender outside the list, and every /campaigns/:id route refuses a campaign whose pool is not such a list. The test email and placement test send only from a listed mailbox. GET /campaigns refuses a restricted key.
  • Analytics. GET /analytics/accounts lists only the listed mailboxes, and GET /analytics/accounts/:id refuses any other. Workspace-wide analytics refuse a restricted key.
  • Contacts and CRM. Contacts, lists, companies, deals, pipelines, CRM tasks and their settings, templates, forms and AI skills work as usual. The mail on a contact's or company's timeline (/contacts/:id/emails, /timeline, /messages, /activities, /crm/companies/:id/email) is refused, as are contact research, campaign holds, reports, My Day and step drafts. Two things on these records still span every mailbox: a contact's engagement totals and last-sent, opened and replied times, and the campaign and step text on sequence tasks.
  • MCP. The tools act across the whole workspace, so /mcp refuses a restricted key. Use the REST endpoints, or a key without the restriction.
  • Realtime. The organization and account channels carry mail events from every mailbox, so the realtime socket refuses a restricted key (close reason 4010). See Realtime.
  • Everything else (API keys, webhooks, integrations, automations, OAuth apps, audit logs, meetings, warmup routing, the advisor and suppressions) refuses a restricted key, because each acts on the whole workspace.

Key expiration

Set an expiration date for temporary access:

{
  "name": "Contractor Access",
  "permissions": 31,
  "expires_at": "2027-12-31T23:59:59Z"
}

After expiration, the key returns 401 Unauthorized.

Using a credential with MCP

An MCP client (Claude Code, Claude Desktop, Cursor) authenticates to Muster CRM with either an OAuth sign-in (the one-command path, no key to paste) or a static API key. For a key, send it as a bearer token to https://api.muster.cdaeris.com/v1/mcp; the client then sees exactly the tools the credential's scopes allow. See the MCP server page for both paths.

Error responses

401 Unauthorized

Returned when:

  • API key is missing
  • API key is invalid
  • API key has expired
  • API key has been revoked
{
  "error": "Unauthorized",
  "message": "Token not found."
}

403 Forbidden

Returned when:

  • API key lacks required permissions
  • The key's creator no longer has the role permission the route needs
  • Request IP is not in allowlist
  • Email account is not in allowlist
  • The workspace does not hold the Webhooks and API module: every API-key request is refused with code webhooks_not_in_plan. OAuth access tokens, MCP connections (with either credential) and dashboard sessions are not affected
{
  "error": "Forbidden",
  "message": "You don't have access to this feature."
}

Next steps

On this page