# API keys

Create, name, scope, copy and revoke the keys your own systems use to read leads, meetings and briefs through the Insurge API.

An API key lets one of your own systems, such as a CRM sync or a data warehouse job, call the Insurge API for your workspace. Each key has a name, a set of things it may do, and an expiry date. Keys live under **Settings → Developers**, and the key itself is shown only once, when you create it.

For how to call the API with a key, see the [API overview](/docs/developers/api).

## Before you start

- You need to be an admin in Insurge. Sales users don't see **Settings**. See [Team and roles](/docs/settings/team-and-roles).
- Decide which system will use the key and what it needs to read or do. Give each system its own key.

## Create a key

### Open Settings → Developers

Click **Settings** at the bottom of the sidebar, then the **Developers** tab. The **API keys** section is at the top.

### Click Create key

The **Create API key** window opens.

### Name it

Name it after the system that uses it, for example `CRM middleware`. The name is how you'll know which key to revoke later.

### Choose its access

Switch on only what the system needs. **Read leads**, **Read meetings** and **Read integrations** are on for a new key; the rest start off.

| Switch | Lets the key |
|---|---|
| **Read leads** | List and fetch leads. |
| **Read meetings** | List meetings and fetch briefs, without transcripts. |
| **Read transcripts** | Fetch what was said in a meeting, word for word. |
| **Read integrations** | See the CRM connection status and the sync log. |
| **Trigger CRM syncs** | Push a meeting into the connected CRMs. |
| **Download recordings** | List and download meeting recordings: the screen and both voices. |
| **Delete recordings** | Delete Insurge's copy of a recording once you have saved your own. It can't be undone. |
| **Create continue links** | Make a private link that lets a visitor carry on a session they left part way. |

**Create** stays greyed out until at least one switch is on.

### Choose when it expires

Pick **90 days**, **1 year** or **Never**. **1 year** is selected to start with. A key that never expires only stops working when you revoke it.

### Click Create and copy the key

A box appears above the table: **Copy this key now. It won't be shown again.** Click the copy button next to the key, store it where the system will read it, then click **I've saved it**.

**You can't see the key again**

Insurge keeps only a fingerprint of the key, so nobody can show it to you later. If you lose it, create a new key and revoke the old one.

## Your keys

The table lists every key that hasn't been revoked. A key that has expired stays in the table, marked `Expired`, until you revoke it.

| Column | Shows |
|---|---|
| **Name** | The name you gave it, or `Untitled`, and the first characters of the key. Use them to match a key in your systems to its row. |
| **Access** | What the key may do, in short: for example `CRM status, Leads, Meetings`. |
| **Expires** | `In 30 days` when it is less than 60 days away, otherwise the date. `Today`, `Expired` or `Never`. |
| **Last used** | The date the key last called the API, or `Never`. It updates at most once a minute. |

A key's name and access can't be changed. To give a system more or less access, create a new key, move the system to it, then revoke the old one.

## Revoke a key

### Click the bin icon on the key's row

The **Revoke this key?** window opens.

### Click Revoke

The key stops working at once, and anything still using it gets an error. The row leaves the table.

Revoke a key when the system that used it is retired, when someone who had it leaves, or as soon as you think it has leaked.

## Store keys safely

- Keep keys on your servers only: in a secrets manager, or in an environment variable your deployment sets. Never put a key in a web page, a mobile app, a spreadsheet, a chat message or a code repository.
- Give each system its own key with only the access it needs. Then you can revoke one without stopping the others, and each has its own [rate limit](/docs/developers/api#rate-limits).
- Prefer keys that expire. Put the expiry date in your team's calendar and replace the key before it.
- To replace a key without a gap: create the new key, switch the system to it, check that **Last used** on the new row shows today, then revoke the old one.

## Troubleshooting

#### The API answers 401 Invalid, expired or revoked API key

The key was revoked, has expired, or was copied incompletely. Check **Expires** on its row. If the row is gone, the key was revoked: create a new one.

#### The API answers 403 API key is missing scope

The key doesn't have the access that endpoint needs, for example **Read transcripts**. Access can't be added to a key: create a new key with that switch on.

#### The API answers 429 Rate limit exceeded

That key made too many requests in a short time. Wait for the number of seconds in `Retry-After`. If one system is busy all the time, give other systems their own keys.

#### I don't see Settings or Developers

Only admins see **Settings**. Ask an admin in your workspace to create the key or change your role.
