Skip to Content
Getting StartedAuthentication

Authentication

All endpoints under /api/v1 (except /api/v1/openapi.yaml and /api/v1/openapi.json) require a Bearer API key in the Authorization header:

curl -H "Authorization: Bearer msk_xxxxxxxx" \ https://app.msend.dev/api/v1/agent

Key Scopes

Owners and admins create API keys at /o/<organization>/agents. A key can be scoped in two ways:

ScopeBehavior
Agent-scopedBound to one agent. Uses that agent’s channels and GET /api/v1/agent returns that agent.
Organization-wideNot bound to a single agent. Operations that target a specific agent or channel require agent_id (e.g. GET /api/v1/events?agent_id=agt_xxx) or channel_id (e.g. POST /api/v1/messages). GET /api/v1/agent returns 404.

Key Storage & Rotation

  • Only a SHA-256 digest of each key is stored in the database; msend cannot show a key again after creation.
  • You can create multiple keys per agent (for zero-downtime rotation) and revoke any key immediately from the agent page.
  • Revoked or invalid keys return 401 Unauthorized.
  • Requests made with a key belonging to a paused agent return 403 Forbidden.

Never commit msk_... keys to source control or expose them in client-side browser code. Always pass them via environment variables such as MSEND_API_KEY.

Last updated on