PATCH /apikeys/{id}
Update an API key
Updates an API key with the specified ID. Only account administrators can update API keys, and API keys cannot update other API keys.
Authentication Required
Authorization: Bearer {token}
header string This header is required to access this endpoint
Required Parameters
x-account-id
header string Account ID for the request
id
path string The ID of the API key to update
Request Body
{ "description": "string", "flatPermissionsList": [ "string" ]}{ "description": "string", "expiresAt": "string", "flatPermissionsList": [ "string" ]}Try it out
Loading...
Output:
Responses
Description
API key updated successfully
{ "success": false}Description
Bad Request - Invalid permissions provided
Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have the required permissions
Description
ApiKey not found
{ "error": "API key not found"}Description
Internal server error
References
#/components/parameters/xAccountIdHeader
in: headername: x-account-idschema: type: stringdescription: Account ID for the requestrequired: trueexample: "2311"|export type xAccountIdHeader = any; // Schema type not fully supported#/components/schemas/ApiKeyInput
type: objectrequired: - description - flatPermissionsListproperties: description: type: string description: Description of the API key expiresAt: type: string format: date-time nullable: true description: ISO date-time string when the API key expires, or null/empty for no expiration flatPermissionsList: type: array example: - readApplications - writeApplications items: type: string description: List of permission IDs to assign to the API key>export interface ApiKeyInput { /** Description of the API key */ description: string; /** ISO date-time string when the API key expires, or null/empty for no expiration */ expiresAt?: Date; /** List of permission IDs to assign to the API key */ flatPermissionsList: string[];}Route Source Code
Check out the source code for this route entrypoint here: /apikeys/[id]/route.ts
Or the swagger.yaml spec this documentation was generated from:
/apikeys/swagger.yaml