Moonborn — API · api-keys
Rename an API key
PATCH/v1/api-keys/{id}scope · Bearer (API key or session JWT)
Path parameters
| Field | Type | Description |
|---|---|---|
| idreq | string | API key id (UUID). |
Request body
| Field | Type | Description |
|---|---|---|
| namereq | string |
Responses
200Updated summary.
Body
| Field | Type | Description |
|---|---|---|
| idreq | string | |
| prefixreq | string | |
| namereq | string | |
| scopesreq | string · "*" | "read:personas" | "write:personas" | "read:chat" | "write:chat" | "read:marketplace" | "write:marketplace" | "read:billing" | "read:audit" | "read:webhooks" | "write:webhooks" | "read:config" | "write:config"[] | |
| orgIdreq | string | |
| workspaceIdreq | string | |
| createdByreq | string | |
| createdAtreq | string | |
| expiresAtreq | string | |
| lastUsedAtreq | string | |
| rotatedAtreq | string | |
| revokedAtreq | string | |
| statusreq | string · "active" | "rotated" | "revoked" | "expired" |
400Validation error.
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string | |
| error.details | object |
401Unauthenticated.
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string | |
| error.details | object |
403Forbidden.
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string | |
| error.details | object |
404Key not found.
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string | |
| error.details | object |
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>",
)