An API key lets your scripts and tools use the DatAds Public API for one client. A key with the permission Read reads the client's data. A key with the permission Read & write can also make changes, such as creating reports or starting Blink chats. API keys are only for the Public API: the DatAds MCP server for Claude and ChatGPT uses your DatAds sign-in, not an API key.
Who can use this
Plans: Regular and Custom, the legacy Plus and Pro plans, and the free trial. Not available on Lite and the legacy Starter plan.
Roles: Admin creates and revokes API keys. Members see the client's API keys, but can't create or revoke them. Visitors and Guests don't see API keys.
An API key belongs to one client
An API key gives access to the data of one client: its ad accounts, ads, reports, Inspiration Boards, Brain and Blink chats. Every Public API request with the key works on that client, and a request can't switch to another client.
A client can have several API keys, up to 50 active keys. Give each tool its own key, so you can revoke one tool's key without stopping the others. To work with several clients, create a key in each client. A key created in All Clients reads every ad account of the workspace. To learn what the Public API offers, see Public API: access, rate limits and errors.
Read and Read & write keys
Each API key has one of two permissions. You choose the permission when you create the key:
Read: the key reads data, but can't change anything. Read is the default.
Read & write: the key reads data and makes changes. It can create and change reports, move them to the Bin and restore them, create and change Blink projects, change the Brand Context and Brand Memory, start and continue Blink chats, and create, change, delete and run Blink automations.
Use a Read key for tools that only read data, such as a BI tool or a dashboard. Use a Read & write key only for tools that must make changes. A Read key that tries to make a change gets status 403 and the message "Not authorized."
Changes made with a Read & write key act as the person who created the key. That person must still be an Admin, or a Member with access to the client. Report histories and Brain histories show each change with the source API and the name of the key.
Create an API key
To create an API key for a client:
Go to Settings > Clients.
Next to the client, select Manage.
In the list of sections, select API Key.
Select Add key.
In the Add API Key window, enter a Name that says which tool uses the key, for example "Looker connector".
Under Permission, select Read or Read & write.
Optional: under Expiry, select the date when the key stops working. Leave it empty if the key should never expire.
Select Create key.
Select Copy and store the API key in a secure place, such as a secrets manager or an environment variable.
Select I've copied my key, then select Done.
The API Keys table now lists the key with its name, its last 4 characters, its permission, its expiry date or Never, the date it was created and who created it. The key works right away: send it in the X-API-Key header of every Public API request.
The name, permission and expiry can't be changed after the key is created. To change them, create a new key and revoke the old one.
Open the API keys from Connections
Admins can also open the API keys of the client they work in from the Connections page. To open the API Key section from Connections:
Go to Settings > Connections.
Under External Tools, on the API card, select Manage keys.
DatAds opens the API Key section of the client selected in the sidebar. If Manage keys can't be selected and shows "Select a client first", select a client in the sidebar and try again.
The full API key is shown only once
DatAds shows the full API key only once, right after you create it. Later, the API Keys table shows only the last 4 characters. DatAds doesn't keep a readable copy of the key, so neither you nor DatAds support can show the full key again.
If you lost an API key, create a new key, add it to your scripts, then revoke the lost key.
Revoke an API key
Revoke an API key when a tool no longer needs it or when the key may be exposed. To revoke an API key:
Go to Settings > Clients, select Manage next to the client, then select API Key.
In the API Keys table, select the trash icon (Revoke key) next to the key.
In the Revoke API key? window, select Revoke key.
The key stops working at once and disappears from the table. Requests that still send it get status 401 and the message "Not authenticated." The other keys of the client keep working. You can't undo a revoke.
Replace an API key
The API Keys screen has no button to regenerate a key. To replace an API key without a break, create the new key first:
Create a new API key with the permission the tool needs. See Create an API key above.
Replace the old key with the new key in every script and tool that uses it.
Revoke the old key. See Revoke an API key above.
Only the new key works now.
Your existing key is called Default key
If the client had an API key before DatAds allowed several keys per client, that key appears in the API Keys table with the name Default key and the permission Read. It keeps working, so your scripts need no change. For older keys, Created by shows a dash.
A Default key can't make changes. To make changes through the Public API, create a new key with the permission Read & write.
Keep your API keys secret
Treat an API key like a password. Anyone who has the key can read the client's data, including its ads, performance, reports, Brain and Blink chats. With a Read & write key, they can also change reports, projects, the Brain and automations, and start Blink chats that use AI credits.
Never put an API key in client-side code, public code repositories or logs. Store it in environment variables or a secrets manager. If you think a key is exposed, revoke it at once and create a new one.
An API key stays active until it expires or you revoke it, also when the person who created it leaves the workspace. Changes with a Read & write key work only while its creator is still an Admin, or a Member with access to the client. If the creator leaves, create a new key.
Troubleshooting API keys
You don't see the Add key button
Only Admins can create and revoke API keys. Members see the API Keys table, or the message "Ask an admin of your workspace to add a key.", but no Add key button and no trash icon. Ask an Admin of your workspace to create the key.
Add key can't be selected
A client can have up to 50 active API keys. Below the table, DatAds shows how many keys are used, for example "50/50 keys used". Revoke a key that no tool uses anymore, then add the new key.
The API Key section is missing
The API Key section appears only for Admins and Members. Visitors don't see it. The Manage keys button in Settings > Connections is visible to Admins only. To check your role, ask an Admin. See Roles and permissions.
Requests answer "Not authenticated."
The Public API answers "Not authenticated." when the X-API-Key header is missing, the key is mistyped, or the key was revoked or has expired. Copy the key again without spaces, and check the header name. Revoked and expired keys no longer appear in the API Keys table. If the key is gone, create a new key.
A change answers "Not authorized."
The key has the permission Read, for example a Default key. Changes need a key with the permission Read & write. An Admin creates one in the API Key section, and you send it with the requests that make changes.
Common questions about API keys
Can I use the API key to connect Claude or ChatGPT?
No, an API key doesn't connect Claude, ChatGPT or other AI tools. Those tools use the DatAds MCP server, where you sign in with your DatAds account. See What the DatAds MCP server is.
Is the API key the same for all clients?
No, each client has its own API keys. A key works only on the client it was created in. A key created in All Clients reads every ad account of the workspace.
Can I change the permission of a key?
No, the name, permission and expiry of a key can't be changed. Create a new key with the permission you need, replace the old key in your tools, then revoke the old key.


