viakite
Dashboard

API/API keys/Replace a key with a new one

Replace a key with a new one

POST/v1/orgs/{org}/keys/{key}/rotate

The old key keeps working for 24 hours.

Secret keyNeeds keys.createapi.vk.viabio.me

Path parameters

orgstringrequired
The organization's id (org_…).
keystringrequired
The key's id (key_…).

Responses

The new key, with key set.

idstringrequired
A prefixed ULID; the prefix names the kind (prj_… a project, org_… an organization).
org_idstringrequired
A prefixed ULID; the prefix names the kind (prj_… a project, org_… an organization).
namestringrequired
typestringrequired
publicsecret
modestringrequired
livetest
regionstringrequired
prefixstringrequired
The start of the key, safe to show.
keystring
The whole key; always for a public key, for a secret key only in the answer to create and rotate.
scopesstring[]required
Permissions of a secret key; none on a public key.
project_idsstring[]required
The projects the key reaches; none means every project.
created_by_idstringrequired
last_used_atstring · date-time | nullrequired
expires_atstring · date-time | nullrequired
Set on a rotated key, which works until then.
created_atstring · date-timerequired
A time in UTC, ISO 8601.
updated_atstring · date-timerequired
A time in UTC, ISO 8601.
Example response
1{
2 "id": "key_01JD8Q2M4W9XK3T7B5",
3 "org_id": "org_01JD8Q2M4W9XK3T7B5",
4 "name": "Production",
5 "type": "public",
6 "mode": "live",
7 "region": "us",
8 "prefix": "sk_live_us_ab12",
9 "key": "key_01JD8Q2M4W9XK3T7B5",
10 "scopes": [
11 "string"
12 ],
13 "project_ids": [
14 "prj_01JD8Q2M4W9XK3T7B5"
15 ],
16 "created_by_id": "acc_01JD8Q2M4W9XK3T7B5",
17 "last_used_at": "2026-11-21T09:30:00Z",
18 "expires_at": "2026-11-21T09:30:00Z",
19 "created_at": "2026-11-21T09:30:00Z",
20 "updated_at": "2026-11-21T09:30:00Z"
21}

Errors

Every error has the same shape: error.code, a message for people and details.

StatusCode
404not_found