Skip to main content
Requests to the Partner API are authenticated with a partner API key, which is tied to your partner profile and gives access to your data across all the programs you’re enrolled in. Partner API keys follow the format:
.env
Partner API keys are secret. Store them in your server-side code, such as in an environment variable, and never expose them on a website.
Partner API keys only work with the Partner API. Workspace API keys (dub_) are rejected by the Partner API, and partner API keys can’t be used with the Dub API.

Create an API key

1

Go to API Keys

In the partner dashboard, go to Settings > API Keys.Only partner profile owners can create API keys.
2

Create the key

Give the key a name, select its scopes, and choose when it expires.Keys can be set to never expire, or to expire after 7, 30, 60, or 90 days, or 1 year.
3

Copy the key

Copy your key and store it in a safe place. You won’t be able to see it again.
4

Use the key

Send your key as a Bearer token in the Authorization header of your requests:
A partner profile can have up to 5 API keys at a time. Every owner of the partner profile receives an email when a new key is created.

Scopes

Each key is limited to the scopes you select when you create or edit it. You must select at least one. A request with a key that’s missing a required scope returns a 403 error that names the scopes it needs.
Give each key only the scopes it needs to reduce the impact if the key is ever exposed.

Manage your API keys

Owners can edit a key’s name, scopes, and expiration, or delete it, from the API Keys page. Other members of the partner profile can view the list of keys. A key stops working as soon as it’s deleted or expires. Requests with an expired key return a 401 error. If your partner account isn’t approved in the Dub Partner Network, you can still view and delete your existing keys, but you can’t create or edit keys, and requests with them return a 403 error. Keys are also deleted automatically when the person who created them is removed from the partner profile, is no longer an owner, or deletes their Dub account.