Uygulamayı aç
Moonborn — API · api-keys

Rename an API key

PATCH/v1/api-keys/{id}scope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringAPI key id (UUID).
Request body
FieldTypeDescription
namereqstring

Responses

200Updated summary.
Body
FieldTypeDescription
idreqstring
prefixreqstring
namereqstring
scopesreqstring · "*" | "read:personas" | "write:personas" | "read:chat" | "write:chat" | "read:marketplace" | "write:marketplace" | "read:billing" | "read:audit" | "read:webhooks" | "write:webhooks" | "read:config" | "write:config"[]
orgIdreqstring
workspaceIdreqstring
createdByreqstring
createdAtreqstring
expiresAtreqstring
lastUsedAtreqstring
rotatedAtreqstring
revokedAtreqstring
statusreqstring · "active" | "rotated" | "revoked" | "expired"
400Validation error.
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
error.detailsobject
401Unauthenticated.
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
error.detailsobject
403Forbidden.
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
error.detailsobject
404Key not found.
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
error.detailsobject

Examples

cURL
curl -X PATCH https://api.moonborn.co/v1/api-keys/<id> \
  -H "Authorization: Bearer $MOONBORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "<string>"
    }'
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.api_keys.renameApiKey({
  id: '<id>',
  name: "<string>",
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.api_keys.rename_api_key(
    id="<id>",
    name="<string>",
)