> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an admin key

> With a bearer key for your own org, or — once, for a new org — bootstrapSecret (the server's ADMIN_BOOTSTRAP_SECRET) and no bearer. The key is returned once.

With a bearer key for your own org, or — once, for a new org — `bootstrapSecret` (the server's `ADMIN_BOOTSTRAP_SECRET`) and no bearer. The key is returned once.

### Request body

`AdminKeyCreate`

<ParamField body="orgId" type="string" required />

<ParamField body="label" type="string" />

<ParamField body="bootstrapSecret" type="string">
  Only when minting the first key for a new org, with no bearer
</ParamField>

### Response

`AdminKey`

<ResponseField name="id" type="string" />

<ResponseField name="key" type="string">
  Returned once, on creation
</ResponseField>

<ResponseField name="orgId" type="string" />

<ResponseField name="label" type="string" />

### Status codes

| Code  | Meaning |
| ----- | ------- |
| `200` | OK      |
| `400` | Error   |
| `401` | Error   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.example.com/api/admin/keys' \
    --header 'Content-Type: application/json' \
    --data '{
    "orgId": "string",
    "label": "Replacement tent pole set",
    "bootstrapSecret": "YOUR_API_KEY"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "key": "string",
    "orgId": "string",
    "label": "Replacement tent pole set"
  }
  ```
</ResponseExample>
