Create an API key
Make a key for a script that reads coverage, choosing its role, its owner and the one workspace it reaches, copy the secret while Studio shows it, and prove the key works with one call.
Goal
A key named Coverage report that can read one workspace and change nothing, with its secret copied somewhere safe and one call that proves it works.
Before you start
A key is how a script, a scheduled job or an AI client signs in to Studio. It acts with a role, like a person does, and it can never do more than the admin who made it.
Open Settings → API, and its Auth tab. Two tabs: API, the reference you read in the next lesson, and Auth. Auth starts with MCP server, the address an AI client connects to (lesson 3). Below it is API keys: Every key in the organisation. Each acts with a role and never does more than its owner. On a new install it reads No API keys yet. Create one to call the API.
Press Create key, and name it. The dialog says A key acts with a role, like a person does. It can never do more than you, and the secret is shown once. Under NAME type
Coverage report, and under DESCRIPTION (optional) Weekly coverage figures for the security report. Whoever finds the key in a year can tell what it is for.
Choose its role. Under ROLE are the four cards you know from adding a teammate: Read-only, Analyst, Engineer and Admin. Choose Read-only. Below the cards Studio lists what the role grants: Every Read-only scope (23), from
me:readandworkspaces:readtosearch:read. Every one ends in:read. Choose Engineer for a moment and the list grows to 28, with five marked • can change data:detections:propose,alerts:write,cases:write,kanban:writeandsearch:execute. Go back to Read-only. Limit to specific scopes lets you take scopes away from the role, never add them.
Choose its owner and its reach. Under OWNER:
- Personal: Stops working if your account is disabled.
- Service: Belongs to the org, survives staff changes.
The report must outlast whoever set it up, so choose Service. Under REACH, All workspaces is Any workspace you can open, and One workspace is Locked to a single workspace. Choose One workspace, then Corporate SOC under WORKSPACE.

Leave the expiry, and read the allowlist. EXPIRES reads 90 days by default; clear it for no expiry. Leave it: a key that expires is a key you are made to look at again. IP ALLOWLIST (optional) limits the key to the addresses you list, such as the one server the script runs on. Leave it empty for this lesson.
Press Create key, and copy the secret. A green banner reads Copy your new token now — it won't be shown again., with the secret beginning
tlk_, Copy token and Done. Press Copy token, save it in your password manager, then press Done. Studio keeps only a hash: if the secret is lost, you make a new key. In the table, Coverage report is a Service token, with its Prefix (the first characters of the secret, so you can tell keys apart), Read-only, 23 scopes, Corporate SOC, Last used Never, its expiry date and Active.

Prove it works. In your terminal, read the secret into a variable without it landing in your shell's history, then ask Studio who the key is:
read -rs TALON_KEY curl -s https://studio.example.com/api/v1/me -H "Authorization: Bearer $TALON_KEY"Paste the secret after
read -rsand press Enter; nothing is echoed. Use your own Studio's address in place ofstudio.example.com. The answer is the key itself:"kind":"service", the 23 scopes, the workspace it is locked to, and"userId":null, because a Service key belongs to no one person. Back on the Auth tab, Last used now shows today's date.
You should now see
Coverage report on Settings → API → Auth: Service token, Read-only, 23 scopes, Corporate SOC, Active, with a date under Last used. Keep the terminal open: the next lesson uses the same key.
Quick check
Go deeper
- API Tokens, for the keys, their scopes and the endpoints.