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.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETList Api Keys
      • POSTCreate Api Key
      • GETGet Api Key
      • DELDelete Api Key
      • PATCHUpdate Api Key
      • PATCHRotate Api Key
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceapi-keys

Update Api Key

PATCH
/api/v1/api-keys/:key_id
PATCH
/api/v1/api-keys/:key_id
$curl -X PATCH https://api.onepin.ai/api/v1/api-keys/key_id \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "data": {
3 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4 "workspace_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
5 "created_by": "1c9e6679-7425-40de-944b-e07fc1f90b12",
6 "name": "Marketing API Key",
7 "key_type": "read-only",
8 "key_prefix": "mkapi",
9 "key_suffix": "9f8d7c",
10 "scopes": [
11 "workflows:read",
12 "voices:read",
13 "templates:read"
14 ],
15 "active": true,
16 "last_used_at": "2024-04-20T14:22:00Z",
17 "rate_limit_per_min": 100,
18 "revoked_at": "2024-05-01T00:00:00Z",
19 "created_at": "2024-01-15T09:30:00Z",
20 "updated_at": "2024-04-25T12:00:00Z",
21 "preview": "mkapi-xxxxxx-9f8d7c"
22 },
23 "meta": {
24 "request_id": "req_123e4567-e89b-12d3-a456-426614174000",
25 "timestamp": "2024-04-25T12:00:00Z"
26 }
27}

Update API-key metadata, scopes, rate limit, or active state.

Was this page helpful?
Previous

Rotate Api Key

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token

Path parameters

key_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects an object.
namestring or nullOptional1-120 characters
scopeslist of enums or nullOptional
rate_limit_per_mininteger or nullOptional
activeboolean or nullOptional

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error