Create an API key
- Scope
- platform:keys:add Admin-issued keys only.
- Idempotency
- Requires an
Idempotency-Keyheader. Reusing the key within 24 hours returns the original response instead of creating a second record.
Request bodyapplication/json
| Field | Type | Description |
|---|---|---|
| namerequired | string | 1 to 120 characters |
| scopesrequired | array of string | at least 1 item |
| rateCapacity | integer | Token-bucket burst size for this key.1 to 100000 |
| rateRefill | number | Sustained requests/second refill rate for this key.0.1 to 10000 |
| expiresInDays | integer | Omit for a key that never expires.1 to 3650 |
Request body of addKey
- namerequired
- Type
- string
- Description
- 1 to 120 characters
- scopesrequired
- Type
- array of string
- Description
- at least 1 item
- rateCapacity
- Type
- integer
- Description
- Token-bucket burst size for this key.1 to 100000
- rateRefill
- Type
- number
- Description
- Sustained requests/second refill rate for this key.0.1 to 10000
- expiresInDays
- Type
- integer
- Description
- Omit for a key that never expires.1 to 3650
Response 200Key created — the secret in this response is shown exactly once
| Field | Type | Description |
|---|---|---|
| datarequired | CreatedApiKey | |
| idrequired | string, uuid | |
| prefixrequired | string | Greppable display prefix, never the secret. |
| namerequired | string | 1 to 120 characters |
| scopesrequired | array of string | |
| statusrequired | string | one of "active", "revoked" |
| createdAtrequired | string, date-time | |
| expiresAtrequired | string, date-time, or null | Set during rotation: the old key's grace-window end. |
| rateCapacityrequired | integer, or null | Token-bucket burst size for this key.1 to 100000 |
| rateRefillrequired | number, or null | Sustained requests/second refill rate for this key.0.1 to 10000 |
| accountIdrequired | string, uuid, or null | Owning RSX ID account for developer self-issued keys; null for admin-issued keys. |
| secretrequired | string | Shown once, at creation. Store it now, because it is not retrievable. |
Response of addKey
- datarequired
- Type
- CreatedApiKey
- Description
- idrequired
- Type
- string, uuid
- Description
- prefixrequired
- Type
- string
- Description
- Greppable display prefix, never the secret.
- namerequired
- Type
- string
- Description
- 1 to 120 characters
- scopesrequired
- Type
- array of string
- Description
- statusrequired
- Type
- string
- Description
- one of "active", "revoked"
- createdAtrequired
- Type
- string, date-time
- Description
- expiresAtrequired
- Type
- string, date-time, or null
- Description
- Set during rotation: the old key's grace-window end.
- rateCapacityrequired
- Type
- integer, or null
- Description
- Token-bucket burst size for this key.1 to 100000
- rateRefillrequired
- Type
- number, or null
- Description
- Sustained requests/second refill rate for this key.0.1 to 10000
- accountIdrequired
- Type
- string, uuid, or null
- Description
- Owning RSX ID account for developer self-issued keys; null for admin-issued keys.
- secretrequired
- Type
- string
- Description
- Shown once, at creation. Store it now, because it is not retrievable.
Example
curl -X POST https://api.rsx.group/platform/v1/keys/add \
-H "Authorization: Bearer rsx_live_..." \
-H "Idempotency-Key: 5b8f2d1a-0c7e-4b1f-9a6d-3e2f1c0b9a8d" \
-H "Content-Type: application/json" \
-d '{
"name": "ci-deploy",
"scopes": [
"example:widgets:*"
],
"rateCapacity": 120,
"rateRefill": 20,
"expiresInDays": 90
}'{
"data": {
"id": "0198f2b1-6c2a-7c9e-9d3a-1e2f3a4b5c6d",
"prefix": "rsx_live_a1b2c3d4",
"name": "ci-deploy",
"scopes": [
"example:widgets:*"
],
"status": "active",
"createdAt": "2026-07-18T12:00:00Z",
"expiresAt": null,
"rateCapacity": 120,
"rateRefill": 20,
"accountId": null,
"secret": "rsx_live_a1b2c3d4e5f6..."
}
}