---
title: "Create key"
description: "Create an API key. The full secret is shown once."
section: "API reference"
url: https://dravo.dev/docs/api/api-keys/create
---
# Create key

The full secret is returned once in this response and never again. Store it
securely.

#### `POST /v1/api-keys`

Create an API key. The full secret is shown once in the response and never again.

**Auth:** Dashboard JWT only

| Field | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | string | yes | 1 to 80 chars. |
| `environment` | body | string | no | live \| test (default live). |

Request:

```json
{
  "name": "Production",
  "environment": "live"
}
```

Response `201`: Created (secret shown once).

```json
{
  "id": "key_1",
  "name": "Production",
  "key": "dra_live_8f2c…",
  "environment": "live"
}
```
