# API keys

URL: https://docs.folkways.io/docs/console/api-keys

Create Platform API keys for your servers, choose what each may read, and revoke them.

**API keys** let your own servers and scripts call the [Platform API](/docs/platform-api), for example to read usage
into your own dashboards or check a segment's limits. They are read-only for now.

<Callout>
  API keys are for the Platform API only. Apps connect to the Realtime API with
  [tokens](/docs/concepts/authentication), never with an API key.
</Callout>

## Create one [#create-one]

1. Open **API keys** and choose **New API key**. Owners and admins manage keys.
2. Give it a name, e.g. "Analytics backend", and an optional description.
3. Under **Access**, add what it may read: the whole workspace, or one segment. Add several entries to reach several
   segments.
4. Optionally set an expiry date.
5. Choose **Create**, then copy the key. **It is shown once**; afterwards only its prefix is visible.

Store it in your server's secrets and send it as the `X-API-Key` header:

```bash
curl https://api.folkways.io/api/v1/organizations/$WORKSPACE_ID/usage \
  -H "X-API-Key: $FOLKWAYS_API_KEY"
```

## What a key can reach [#what-a-key-can-reach]

A key belongs to one workspace and reaches only the workspace or segments in its access list:

| Access | Lets the key read |
| --- | --- |
| Workspace | The workspace, its segment list, its subscription and its usage |
| Segment | That segment and its usage |

A key never has more than read access, whatever the access level says, and can't call anything that needs a
signed-in owner or admin. See [Platform API authentication](/docs/platform-api/authentication).

## Edit, revoke, delete [#edit-revoke-delete]

- **Edit** changes a key's name and description; its access and secret stay the same.
- **Revoke** stops it at once, for good.
- **Delete** removes it from the list.

Create one key per server or script, so you can revoke one without touching the others.
