For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • GETGet API key permission options
      • GETList API keys
      • POSTCreate API key
      • GETGet aggregate API key analytics
      • GETReveal test key plaintext
      • GETGet API key
      • PUTUpdate API key
      • DELDelete API key
      • POSTRegenerate API key
      • GETGet API key analytics
Dashboard
LogoLogo
Runtype APIAPI Keys

Update API key

PUT
/v1/api-keys/:id
PUT
/v1/api-keys/:id
$curl -X PUT https://api.runtype.com/v1/api-keys/id \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "apiKey": {
3 "id": "api_123e4567-e89b-12d3-a456-426614174000",
4 "name": "Production API Key",
5 "keyPrefix": "prod_",
6 "searchHint": "prod-key-2024",
7 "permissions": [
8 "read:data",
9 "write:data",
10 "manage:users"
11 ],
12 "isActive": true,
13 "expiresAt": "2024-12-31T23:59:59Z",
14 "allowedIps": [
15 "192.168.1.100",
16 "10.0.0.5"
17 ],
18 "updatedAt": "2024-01-15T09:30:00Z"
19 },
20 "timestamp": "2024-01-15T09:30:00Z"
21}

Update fields on an API key. Cannot be called via another API key (test keys return code TEST_KEY_PERMISSION_DENIED with upgradeUrl).

Was this page helpful?
Previous

Delete API key

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

idstringRequired

Request

This endpoint expects an object.
namestringOptional1-255 characters
permissionslist of stringsOptional
isActivebooleanOptional
expiresAtdatetime or nullOptional
allowedIpslist of stringsOptional

Response

Updated API key
apiKeyobject
timestampdatetime

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error