Update API key

PATCH/v1/keys/{hash}

Update an existing API key owned by the authenticated user.

Use the hash returned by GET /v1/key, GET /v1/keys, or POST /v1/keys. The raw API key string is not accepted as the path identifier.

Authentication

Authorization Bearer

Use either a Token360 API key (sk-token360-...) or a signed-in user JWT.

Path Parameters

hashstringrequired

API key hash identifier.

Request Body

namestring

New API key name. Blank values are ignored.

disabledboolean

true disables the key. false enables it only when it has not expired.

limitnumber | null

USD spend limit. Send null to clear the existing limit.

limit_resetstring | null

Optional reset interval: daily, weekly, monthly, or null for lifetime. Resets at midnight UTC; weeks are Mon–Sun.

Response

dataobject

Updated API key details.

data.hashstring

Hash identifier used by management endpoints.

data.namestring

API key name.

data.labelstring

Human-readable label. Matches name.

data.disabledboolean

True when the key status is not ACTIVE or expires_at is in the past.

data.workspace_idstring

Workspace code for the key.

data.creator_user_idstring | null

Owner user ID.

data.created_atstring

Create timestamp in UTC ISO-8601 format.

data.updated_atstring | null

Last update timestamp.

data.expires_atstring | null

UTC expiration timestamp, or null.

data.usagenumber

Total Token360 credit usage in USD.

data.usage_dailynumber

Credits used in the current UTC day.

data.usage_weeklynumber

Credits used in the current UTC week (Mon–Sun).

data.usage_monthlynumber

Credits used in the current UTC month.

data.limitnumber | null

Configured USD spend limit, or null if unlimited.

data.limit_remainingnumber | null

Remaining credits in the current limit window, or null if unlimited.

data.limit_resetstring | null

daily | weekly | monthly | null (lifetime).

data.is_free_tierboolean

Currently false.

data.is_management_keyboolean

Currently true for these management responses.

data.is_provisioning_keyboolean

Currently false.

data.rate_limitobject

Per-minute request limit metadata.

Solicitar

Shell
1curl -X PATCH https://api.token360.ai/v1/keys/f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 \
2  -H "Authorization: Bearer sk-token360-inf-..." \
3  -H "Content-Type: application/json" \
4  -d '{
5    "name": "Updated API Key Name",
6    "disabled": false
7  }'

Respuesta

JSON
1{
2  "data": {
3    "hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
4    "name": "Updated API Key Name",
5    "label": "Updated API Key Name",
6    "disabled": false,
7    "workspace_id": "DEFAULT",
8    "creator_user_id": "42",
9    "created_at": "2026-06-04T00:00:00Z",
10    "updated_at": "2026-06-04T01:00:00Z",
11    "expires_at": null,
12    "usage": 12.34,
13    "usage_daily": 0,
14    "usage_weekly": 0,
15    "usage_monthly": 0,
16    "limit": null,
17    "limit_remaining": null,
18    "limit_reset": null,
19    "is_free_tier": false,
20    "is_management_key": true,
21    "is_provisioning_key": false,
22    "rate_limit": {
23      "interval": "minute",
24      "note": "Token-360 per-minute request limit",
25      "requests": 1000
26    }
27  }
28}
¿Ha sido de ayuda?