Rotate API Keys
When to rotate a Roboflow API key, how to find where a key is used before you rotate it, how Roll works, and how rotation reminders work.
Rotating an API key replaces its secret value with a new one. Anything still holding the old value loses access.
Roboflow recommends rotating keys about once a year. This is a guideline, not a requirement. The one-year interval comes from the security policies of organizations that use Roboflow, and a key keeps working past any rotation date. A reminder to rotate is not a sign of a breach.
Rotate right away when a key was exposed (ex: committed to a public repository, pasted in a chat, or held by someone who left the team). An exposed key must not stay live: roll or revoke it immediately and accept the outage, then fix the consumers. A protected key cannot be rolled or revoked, so unprotect it in the dashboard first.
Find Where the Key Is Used
The hard part of a rotation is knowing what depends on the key. Rotate a key an unknown system uses, and that system stops. Check these sources first:
The key's name and metadata in the key table. A key named after its consumer (ex: "line-3-camera-gateway") with an owner in its metadata is the fastest to trace. See Custom Metadata.
The dependency warning. When you click "Roll", "Revoke" or "Disable", the dialog lists what Roboflow knows depends on the key: Dedicated Deployments, Billing Folders, edge devices, whether it is the workspace default key, and whether it had billed usage in the last 30 days. See Dependency Warnings.
Audit Logs. They record management and write events made with the key, not inference or read traffic, so they show part of what the key does. See Audit Logs and SIEM Export.
Usage reporting. Billed usage is attributed per key, so recent usage shows the key was in use then, though the consumer may have moved since. Calls that are not billed do not appear. See Billing Folders.
Your own inventory: environment files, secret managers, CI variables, Docker commands, and devices provisioned by hand.
If the key only runs inference from edge devices or a Workflow, rolling it is low risk once those devices receive the new value. If nobody on the team can say where a key is used, create a second key and migrate instead of rolling.
Roll the Key
"Roll" revokes the key and creates its replacement in one step. The new key keeps the old key's name, permissions, folders, metadata and disabled state. Dedicated Deployments that run on the old key move to the new one automatically. If one cannot be moved, the roll fails with the error "The API key was not rolled", the old key stays live, and a replacement with the same name may already exist, so check the key list before retrying. Everything else fails until you update it with the new value.
Use Roll when a short cutover is acceptable, or when the key was exposed and must stop working now. If an exposed key backs a Dedicated Deployment, do not rely on a roll: give the deployment another key, then revoke the old key from the dashboard, which pauses the deployment.
Open the key table. Workspace keys are in Settings, "API Keys". Folder keys are in the folder card menu, "API Keys".
Click the "Roll" icon on the key's row. Read the dependency warning. If it lists anything, tick the confirmation box.
Click "I Understand, Roll This API Key". The row is highlighted and marked "New". Copy the new value.
Update every consumer with the new value and restart what needs restarting.
Watch your consumers' logs and health checks for authentication errors (401 and 403) over the next hours. Roboflow does not record calls rejected for a revoked key, so your own monitoring is the only signal that a consumer was missed.
A protected key cannot be rolled. Unprotect it first. See Protect a Key.
To roll from a script or an agent, use roboflow api-key roll, the REST API or the MCP Server. See Roll an API Key.

Create a New Key and Migrate
With two live keys you move consumers one at a time and keep the old key as a fallback until the last one is switched. Use this path for planned rotations only, never for an exposed key.
Click "Generate New Key" and give the new key the same permissions and folder as the old one. Name it after its consumer.
Update consumers with the new value, one at a time.
Once every consumer works with the new key, revoke the old one. The dependency warning cannot confirm the migration: it flags billed usage in the last 30 days, so a key you finished migrating last week still shows it, and calls that are not billed never show. Verify each consumer yourself before you revoke.
Who Can Rotate a Key
Rolling a key takes the "Create Api Key" and "Revoke Api Key" permissions, plus "Update Api Key" when the key is protected. For a workspace key the member also needs "View Workspace API Keys". For a folder key the member needs write access to the folder. See Role-Based Access Control.
Keep at least two people able to rotate every key, so a rotation does not wait on someone who left. Recommended Access Setup describes a role layout that does this.
Rotation Reminders
A key gets a reminder only when someone sets a "Rotation Due Date" on it. Set the date when you create the key or from "Edit". "Suggest One Year" fills in a date one year out. Clear the date to stop reminders.
"Owners" are the members emailed about the key. Only members who can roll the key can be owners. Leave the list empty to email everyone who can roll it. If none of the owners can roll the key any more (ex: they left the workspace), the email goes to everyone who can, with a note saying why. The "Generate New API Key" dialog preselects you as the owner; clear the field to email everyone.
The email goes out once per active key, on a day from 15 days before the due date through the due day. A date set closer than that can be reminded the next day. A key that is disabled through that window gets no reminder, enabling it after the due date sends nothing, and a workspace with a billing restriction gets no reminders at all. Nothing happens to the key on the due date, and it keeps working.
The key table shows how close each date is: "Rotate by" with the date, then "Due in" from 30 days out, "Due today" on the day, and "Overdue" after. "Show only keys due for rotation" filters the table to keys within 30 days of their date or overdue. A key with no date shows "No Rotation Date".
Rolling a key moves its due date forward by the same interval it had, up to one year, so a key rotated on schedule stays on schedule. A key with no recorded creation date keeps its date on roll, so set a new one when you roll it.

Last updated
Was this helpful?