> ## 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 brand api key

> Create brand api key

### Path parameters

<ParamField path="brand_id" type="string (uuid)" required />

### Request body

`object`

<ParamField body="label" type="string">
  Defaults to '\<slug> key'
</ParamField>

### Response

`object`

<ResponseField name="token" type="string" required>
  Plaintext `sk_live_…` token — shown once; only its hash is persisted
</ResponseField>

<ResponseField name="key" type="object" required>
  API key record (never contains the token)

  <Expandable title="key">
    <ResponseField name="id" type="string (uuid)" required />

    <ResponseField name="tenant_id" type="string (uuid)" />

    <ResponseField name="is_global" type="boolean" required />

    <ResponseField name="brand_slugs" type="string[]" required />

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

    <ResponseField name="subject" type="string" required />

    <ResponseField name="token_prefix" type="string" required />

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

    <ResponseField name="created_at" type="string (date-time)" required />

    <ResponseField name="last_used_at" type="string (date-time)" />

    <ResponseField name="revoked_at" type="string (date-time)" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning          |
| ----- | ---------------- |
| `201` | Key created.     |
| `400` | Validation error |
| `401` | Unauthorized     |
| `404` | Not found        |
| `429` | Rate limited     |
| `500` | Internal error   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.workstream.stateset.com/v1/brands/{brand_id}/api-keys' \
    --header "x-api-key: $STATESET_TEMPORAL_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
    "label": "Replacement tent pole set"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "token": "YOUR_API_KEY",
    "key": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "tenant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "is_global": true,
      "brand_slugs": [
        "acme-outdoors"
      ],
      "label": "Replacement tent pole set",
      "subject": "Replacement tent pole set",
      "token_prefix": "YOUR_API_KEY",
      "created_by": "string",
      "created_at": "2026-08-31T14:22:05Z",
      "last_used_at": "2026-08-31T14:22:05Z",
      "revoked_at": "2026-08-31T14:22:05Z"
    }
  }
  ```
</ResponseExample>
