---
title: Managing keys
description: Create, narrow, roll and revoke API keys in the console, and who may do each in each environment.
section: Console
order: 2
---

# Managing keys

You will create an API key, narrow what it can do, roll it with a window and revoke it.

Keys are managed in the console under **API keys**. The API has no route to create or revoke a key. It has one route to check the key you call it with.

## Who can do what

| Action                       | Sandbox                 | Production   |
| ---------------------------- | ----------------------- | ------------ |
| Create, narrow, roll, revoke | Owner, Admin, Developer | Owner, Admin |

Use the environment switch at the top of the console to choose Sandbox or Production. Keys belong to the company, not to a member.

## Before you create a key

- The company owner must have accepted the API terms. Until then, no key can be created.
- A Production key can be created only after Nurish'd marks the company Live.

## Create a key

1. Choose the environment.
2. Select **Create key**.
3. Give the key a name that says what uses it, such as `order-service`.
4. Optionally narrow its scopes. See below.
5. Create it and copy the key.

The full key is shown once. Copy it into your secret manager now. If you lose it, create a new key.

## Narrow scopes

A key with no narrowed scopes follows the company's scopes. Pick fewer scopes to limit one key, for example `catalog:read` for a read-only job.

- A key can never hold a scope the company lacks.
- If Nurish'd removes a scope from the company, every key loses it.
- The scopes you can pick are the company's.

Confirm the result with `GET /developer/v1/key/get/document`. See [Scopes](/docs/concepts/scopes).

## Roll a key

Rolling makes a new key and sets the old one to expire. Choose when the old one expires:

| Window | Use it when                                         |
| ------ | --------------------------------------------------- |
| Now    | The old key leaked. Services using it fail at once. |
| 1 hour | You can deploy fast.                                |
| 1 day  | The usual choice.                                   |
| 7 days | Many services share the key.                        |

Copy the new key when it is shown, deploy it, check it, then let the old one expire. See [Authentication](/docs/concepts/authentication).

## Revoke a key

Revoke a key to stop it for good. A revoked key answers `401 invalid_api_key`. You cannot restore it. Create a new key if you need one.

A key that is expired or revoked and used for an action that needs an active key can also answer `409 key_not_active`.

## Next

- [Authentication](/docs/concepts/authentication): the header and storing keys.
- [Scopes](/docs/concepts/scopes): what to narrow to.
- [Members and roles](/docs/console/members-and-roles): the permission table.
