---
title: "bird api-keys create"
description: "Create an API key"
canonical: "https://bird.com/docs/cli/reference/api-keys-create"
---

# `bird api-keys create`

## Usage

```bash
bird api-keys create [flags]
```

## Description

Create an API key

Create a workspace key and receive its token once, in this response; no later call reads it back. A key can never issue or revoke another key. Expiry is fixed at creation, and `cidrs` is applied in the same transaction, so an invalid range fails the whole call instead of leaving the key unrestricted.

Build the request from flags, a JSON ApiKeyCreate body via --body-file ("-" reads
stdin), or both — a flag overrides the matching body field. Run --example to
print a ready-to-edit body, or --dry-run to print the resolved request without
sending it.

## Examples

```bash
# print the body shape (no credentials needed)
bird api-keys create --example

# the body it prints:
```

```json
{
  "cidrs": ["203.0.113.0/24", "198.51.100.14/32"],
  "expires_at": "2027-01-01T00:00:00Z",
  "name": "Email operations production key",
  "scopes": [
    {
      "level": "read",
      "scope": "access_restrictions"
    }
  ]
}
```

```bash
# a key that can send email and read its own sending domains
bird api-keys create --name "Email ops key" --scope emails:write --scope domains:read

# preview the request without minting a key
bird api-keys create --name "Email ops key" --scope emails:write --expires-at 2027-01-01T00:00:00Z --dry-run
```

## Options

#### Key

| Name                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name`            | A label for the key, shown wherever it is listed. Names do not have to be unique, and the name has no effect on what the key can do.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `--scope <v1,v2,…>` | Permission as &lt;area>:&lt;level>. Repeatable, or comma-separated. Levels: read, write. Areas: access\_restrictions, emails, email\_management, email\_marketing, competitive, inbox\_insights, domains, realtime, sms, sms\_management, verify, whatsapp, whatsapp\_management, amb, amb\_management, rcs, rcs\_management, voice, voice\_management, mailbox, mailbox\_management, assets, esim, esim\_credentials, lookup, numbers, rates, brands, compliance, webhooks, preferences, workspace. compliance:write lets the key file and amend registrations with no person attesting, and some filings charge a setup fee to the wallet. |

#### Restrictions

| Name               | Description                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `--expires-at`     | When the key stops working (RFC 3339, e.g. 2027-01-01T00:00:00Z). Omit for a key that never expires; the expiry cannot be changed afterwards. |
| `--cidr <v1,v2,…>` | Source IP range the key is restricted to (CIDR). Repeatable, or comma-separated. Omit for a key with no IP restriction.                       |

#### Request

| Name                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `--body-file`       | Read the JSON request body from this file; "-" reads stdin   |
| `--example`         | Print a complete example request body, then exit             |
| `--dry-run`         | Print the resolved request without sending it, then exit     |
| `--idempotency-key` | Deduplication key; a retry with the same key won't act twice |

#### Options

| Name                | Description                                      |
| ------------------- | ------------------------------------------------ |
| `--response-schema` | Print the fields this command returns, then exit |

## Related

| Name                                                          | Description       |
| ------------------------------------------------------------- | ----------------- |
| [`bird api-keys rotate`](/docs/cli/reference/api-keys-rotate) | Rotate an API key |

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
