API keys give code-level access for Dynamic Yield APIs, for example, to create and manage API-based experiences, or update product feeds.
Create an API key
Note: To ensure that API Keys are used responsibly, only teammates with Admin permissions on the site can create and edit API keys. Teammates with Editor permissions can view API keys, but cannot create or delete them. Teammates with Viewer permissions can't see the API Keys page at all.
- Go to Settings › API Keys and click New Key.
- Enter a name, and internal notes (optional).
- Choose between a server-side and a client-side key. Each type can only be used with its designated endpoint (see Basic Concepts).
- In the ACL section, select one or more permissions for the key. Different options appear based on your site's vertical or features that were enabled on your site.
- Click Save.
You can now click Copy to get the key in plain text. The key should be passed as an HTTP header with any API call you make. For example:
PUT /v2/feeds/dyid/666532575846065165 HTTP/1.1
DY-API-Key: baadc6ba740a352c9106dc7857a7eb9c
Content-Type: application/json
{// JSON-formatted request body...}
POST /v2/serve/user/choose
DY-API-Key: baadc6ba740a352c9106dc7857a7eb9c
Content-Type: application/json
{// JSON-formatted request body...}
Deletean API key
Deleting an API key is irreversible, and any APIs referring to a deleted key must be modified to use a new key.
- Go to Settings › API Keys.
- Hover over the key you want to delete and click the trash icon
. The key is deleted within a few minutes.