Skip to main content
There are two ways to authenticate, depending on what you connect:

Sign-in for AI assistants

Paste the MCP address in your assistant and log in to MagicPost in the window that opens:
MagicPost then issues a key for that assistant behind the scenes. You never see it, and the assistant appears in Settings → API & MCP, under Your connections, where you can disconnect it. See the Quickstart for the steps in each assistant.

API keys

Every call to /api/v1/* made by a tool or a script must carry an API key in the Authorization header. The MCP server accepts the same header from clients that do not sign in:

How tokens look

Tokens are formatted as mp_<32 random URL-safe bytes> — about 43 characters after the prefix. The full token is shown exactly once in the UI at creation time and is never displayed again. Only its prefix (e.g. mp_abc123) and metadata (name, created date, last used) are kept visible afterwards.
Treat your tokens like passwords. Anyone with the token has the same access to your MagicPost account as you do via the API.

Creating a token

From the web app: Settings → API & MCP → Connect a tool. Under Tools and code, pick n8n, Zapier, Make or your own code, give the key a name (e.g. Reporting script) and click Create key. The name has no functional effect: it helps you find the key in your connections and revoke the right one. You can hold up to 10 active tokens per account. Revoked tokens don’t count against the limit but remain visible in the history.

Using a token

With the MCP server

AI assistants sign in, so they need no token (see above). For an MCP client that cannot sign in, pass the token as a header. With a client that only speaks stdio, use the mcp-remote bridge:

With the REST API

Just add the header to every request:

Revoking a token

In Settings → API & MCP, under Your connections, hit Revoke on a key or Disconnect on an assistant. The change propagates within 60 seconds (the MCP server caches token validity for that long, so a revoked token may still work for up to a minute after revocation). Revocation is irreversible. The MCP integration that uses that token will start receiving 401 responses — create a new token to replace it.

Verifying a token

The GET /api/v1/auth/verify endpoint is the canonical way to check whether a token is currently valid. It returns the user record id, email and granted scopes if the token is good:

Scopes

All v1 tokens currently have a single access scope: mcp:v1. It grants full access to every /api/v1/* endpoint of the owning user. /auth/verify may list two more scopes, which only tell the MCP server which tools to list (see what your client lists): mcp:metrics_only for a member of an organisation whose plan is limited to analytics (the API only answers its metrics endpoints, whatever the scope), and mcp:own_account_only for an account that manages no member of an organisation. Finer-grained scopes (e.g. read-only, or “post:write” only) will land in a future version — existing tokens will keep their full access at that point.

Token security checklist

  • ✅ Store tokens in env vars or secret managers, never in client-side code
  • ✅ Use a different token per device or integration so you can revoke precisely if one leaks
  • ✅ Rotate tokens occasionally (every ~6 months for high-value automations)
  • ❌ Never commit tokens to git, even in a private repo
  • ❌ Never paste a token in a public log, screenshot, or support thread — revoke and recreate if you suspect leak