Managing API Keys
API keys allow external systems to interact with your Synapse workspace programmatically. You use them to ingest events, manage contacts, and pull reporting data through the API.
Who Can Manage API Keys
Only these roles can create and revoke API keys:
| Action | Owner | Admin | Developer | Marketing | Operations | Viewer |
|---|---|---|---|---|---|---|
| View API keys | Yes | Yes | Yes | -- | -- | -- |
| Create API keys | Yes | Yes | Yes | -- | -- | -- |
| Revoke API keys | Yes | Yes | Yes | -- | -- | -- |
If you don't see the API Keys page in Settings, your role does not have access. Ask an Owner or Admin to create a key for you.
Creating an API Key
- Go to Settings > API Keys in the dashboard sidebar.
- Click Create API Key.
- Fill in the details:
| Field | Description |
|---|---|
| Name | A descriptive label (e.g., "Production Event Ingestion", "Backend Data Sync") |
| Scope | What the key is allowed to do (see Scopes below) |
| Environment | live for production, test for development/staging |
| Expiration | Optional -- set a date when the key automatically stops working |
- Click Create.
- Copy the key immediately. It is shown only once and cannot be retrieved later.
The full API key is displayed only at creation time. If you lose it, you'll need to revoke the old key and create a new one. There is no way to recover or view the key again.
Understanding Scopes
Each API key has a scope that controls which endpoints it can access. Always choose the most restrictive scope that meets your needs.
| Scope | What It Can Do | Best For |
|---|---|---|
| data | Ingest events, create/update/delete contacts | SDKs, backend integrations, data pipelines |
| reporting | Read analytics, pull reports | BI tools, dashboards, reporting scripts |
| management | Everything in data + manage contacts + workspace settings | Admin scripts, migration tools |
| full | Complete API access (all scopes) | Internal tooling only -- avoid in production |
Scope Details
data scope covers:
POST /v1/events-- send eventsPOST /v1/contacts-- create or update a contactPOST /v1/contacts/bulk-- bulk import contactsPATCH /v1/contacts/{external_id}-- update a contact
management scope adds:
DELETE /v1/contacts/{external_id}-- delete contacts- All
datascope endpoints
reporting scope covers:
- Analytics and reporting read endpoints
full scope covers:
- All of the above
Never use a full scope key in client-side code or public repositories. If you only need to send events from a frontend SDK, use a data scope key.
Key Format
Synapse API keys follow a predictable format that helps you identify them:
For example:
psk_live_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4-- a live/production keypsk_test_f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3-- a test/development key
The psk_live_ or psk_test_ prefix tells you at a glance whether a key is for production or testing. The prefix is also used internally for fast key lookup, while the full key is verified against a bcrypt hash for security.
Using API Keys
API keys are sent via request headers. Synapse supports two authentication methods:
Header Authentication
Include both your workspace ID and API key as headers:
Basic Authentication
Alternatively, use HTTP Basic Auth with your workspace ID as the username and API key as the password:
Both methods work identically. Choose whichever is more convenient for your integration.
Revoking an API Key
When a key is compromised, no longer needed, or an employee leaves, revoke it immediately:
- Go to Settings > API Keys.
- Find the key you want to revoke.
- Click Revoke.
- Confirm the action.
Revocation takes effect immediately. Any requests using the revoked key will receive a 401 Unauthorized response.
Revoked keys are kept in the list with a "Revoked" status so you have an audit trail. You can filter the list to hide revoked keys if the list gets long.
Security Best Practices
- Use the narrowest scope possible. If a service only sends events, give it a
datakey -- notfull. - Use separate keys per integration. If your backend and your analytics tool both need API access, create a separate key for each. That way you can revoke one without disrupting the other.
- Set expiration dates for keys given to contractors or temporary integrations.
- Rotate keys periodically. Create a new key, update your integration, then revoke the old one.
- Never commit keys to version control. Use environment variables or a secrets manager.
- Use
testenvironment keys during development and staging. They make it easy to identify and clean up test data.
Plan Limits
The number of API keys you can create depends on your plan. If you hit the limit, you'll see a "plan limit reached" error. Revoke unused keys or upgrade your plan to create more.
Next Steps
- Team Roles & Permissions -- understand who can manage keys
- Sender Domain Setup -- configure your sending domain
- API Reference -- full endpoint documentation