Skip to main content

Getting an API key

API keys are created from your Messages.dev dashboard.
  1. Go to API Keys in the sidebar
  2. Click Create Key
  3. Give it a name and copy the key. It starts with sk_live_ and is only shown once
Store your API key securely. It won’t be displayed again after creation. If you lose it, revoke it and create a new one.

Authenticating requests

Scopes

Each API key has scopes that control which endpoints it can access.

Line restrictions

API keys can be restricted to specific lines. A line-restricted key can only read and write data for its allowed lines. Requests to other lines return 403. This is useful when you have multiple integrations or want to limit blast radius. You can configure line restrictions when creating a key in the dashboard.
All API keys automatically have access to the sandbox line, regardless of line restrictions.

Errors