Update selected API keys

All keys must belong to the authenticated organization. Every change is audited in the same transaction. A management key cannot disable, enable or delete management keys, its own included (403).

POST https://tokenlane.de/api/keys/bulk

Authorizations

[ [ { "name": "Authorization", "description": "Organization management key: Authorization: Bearer sk-tl-v1-…. Existing sk-eu- keys remain valid. Required scopes are listed in x-scopes; gateway inference keys cannot authorize management operations.", "type": "http bearer", "location": "", "scopes": [] } ] ]

curl

curl --request POST \
  --url 'https://tokenlane.de/api/keys/bulk' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Origin: https://tokenlane.de' \
  --header 'Content-Type: application/json' \
  --data '{
  "ids": [
    "key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  ],
  "action": "disable"
}'

node

const response = await fetch("https://tokenlane.de/api/keys/bulk", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
    "Origin": "https://tokenlane.de",
    "Content-Type": "application/json",
  },
  body: `{
  "ids": [
    "key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  ],
  "action": "disable"
}`,
});
console.log(await response.text());

python

import os
import urllib.request

body = (r'''{
  "ids": [
    "key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  ],
  "action": "disable"
}''').encode("utf-8")

request = urllib.request.Request(
    "https://tokenlane.de/api/keys/bulk",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["TOKENLANE_API_KEY"],
        "Origin": "https://tokenlane.de",
        "Content-Type": "application/json",
    },
    data=body,
)

with urllib.request.urlopen(request) as response:
    print(response.read().decode("utf-8"))

vercel

// This operation uses HTTP directly.
const response = await fetch("https://tokenlane.de/api/keys/bulk", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
    "Origin": "https://tokenlane.de",
    "Content-Type": "application/json",
  },
  body: `{
  "ids": [
    "key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  ],
  "action": "disable"
}`,
});
console.log(await response.text());

Body: application/json

{
  "ids": [
    "key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  ],
  "action": "disable"
}

s18: object

{"additionalProperties":"false"}

  • ids (required): s79

s79: array

{"minItems":"1","maxItems":"200"}

s158: string

Selected key ID

{}

"key_01k7tm3w8vfz6b2r4m9q5xyz7c"
  • action (required): s80

s80: string

"disable", "enable", "delete"

{}

Response 200: application/json

Request successful

{
  "updated": 0
}

s19: object

{}

  • updated (required): s55

s55: integer

{}

Response 400: application/json

Bad request (validation error, invalid input)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

s11: object

{}

  • requestId (optional): s56

s56: string

Server correlation ID for an internal error. Also returned in X-Request-Id.

uuid

{}

  • status (required): s57

s57: number

HTTP status code

{}

400
  • code (required): s58

s58: string

Error code

{}

"VALIDATION_ERROR"
  • message (required): s59

s59: string

Error message

{}

"Request validation failed"
  • remedy_hint (optional): s60

s60: string

A safe, actionable remedy from the error catalog.

{}

  • details (optional): s61

s61: array

Detailed validation errors

{}

s154: object

{}

  • path (required): s179

s179: string

Field path

{}

"title"
  • message (required): s180

s180: string

Field error message

{}

"Required"

Response 401: application/json

Authentication required (missing or invalid credentials)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 403: application/json

Insufficient scope (authenticated but not authorized)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 404: application/json

Resource not found

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 409: application/json

Conflict with the current state (e.g. a name that already exists)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 500: application/json

Internal server error

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}