POST /keys
Updated Oct 1, 20261 minute read
Create a key
Mints a Median key pair: the secret root for MEDIAN_KEY, and the browser-safe publishable half the widget ships with. Returned in full exactly once; the database keeps fingerprints. The first key an organization mints also retires any legacy credentials.
Part of Account.
Request body
application/json, optional.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No |
Responses
| Status | Description |
|---|---|
200 | The pair, shown once. Store both now. |
400 | The request is malformed, and the message names the field. |
401 | The bearer token is missing, revoked, or expired. |
403 | The token's person does not hold the role this needs. |
429 | Too many requests. Wait the seconds in Retry-After. Limits depend on the plan. See rate limits. |
200 body
| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | |
key | string | No | |
publicKey | string | No |
Example request
curl -X POST https://api.median.sh/v1/keys \
-H "Authorization: Bearer $BEARER_AUTH" \
-H "content-type: application/json" \
-d '{"name":"production"}'