---
title: "Create a Realtime app key"
method: POST
path: "/v1/realtime/apps/{realtime_app_id}/keys"
tags: ["realtime-apps"]
---

# Create a Realtime app key

`POST /v1/realtime/apps/{realtime_app_id}/keys`

## Request

- Base URL: `https://us1.platform.bird.com`
- URL: `https://us1.platform.bird.com/v1/realtime/apps/{realtime_app_id}/keys`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `bird_session`

Adds a new key to the app and returns it with its secret. Store the secret when you receive it because later responses do not include it. Use this together with revoke for zero-downtime rotation: add a key, roll it out across your clients, then revoke the old key.

## Headers

- `Idempotency-Key` string
- `X-Workspace-Id` string
- `X-Organization-Id` string

## Response `201`

Key created. Includes the one-time secret.

- RealtimeAppKey
  - `id` string, required
  - `key` string, required: The public app key clients use to connect.
  - `secret` string: The key secret, used for server-side request signing. Returned only when the key is created, and never shown again: store it securely. If lost, create a new key and revoke this one.
  - `revoked_at` string, date-time, nullable, required: When the key was revoked, or `null` if still active.
  - `created_at` string, date-time, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Insufficient permissions
- `404`: Resource not found
- `422`: The request has invalid field values, violates a business rule, or carries a query parameter the endpoint does not declare. Field validation errors use `type: validation_error` and include the affected fields in `details`. Business-rule errors identify the failed rule in `type`.
- `429`: Rate limit exceeded
- `500`: Internal server error
- `503`: The service is temporarily unavailable. If `Retry-After` is present, wait for that delay before retrying; otherwise, retry with exponential backoff. Reuse the same idempotency key and request when retrying a mutation.

---

[API](https://skmtc.dev/messagebird/apis/bird-api.md) · [All operations](https://skmtc.dev/messagebird/apis/bird-api/llms.txt) · [OpenAPI document](https://skmtc.dev/messagebird/apis/bird-api/revisions/3e2a50466454?raw)
