POST
/api/v1/tokens
API-Token erzeugen; der Klartext wird nur in dieser Antwort geliefert
Anfrage#
POSIX-Shell · curl
curl --fail-with-body --request POST \
"$ADBR_API_URL/api/v1/tokens" \
-H "Authorization: Bearer $ADBR_API_TOKEN" \
-H "Content-Type: application/json" \
--data @request.jsonVerwende lokale Adresse und Token aus API & MCP. Ersetze Pfadplatzhalter wie {id} durch tatsächliche IDs. Erstelle request.json anhand des folgenden Körperschemas, bevor du den Befehl ausführst.
Authentifizierung und Rechte#
Authentifizierung: Bearer-Token
Scopes: admin
Alle aufgeführten Scopes sind erforderlich; admin erfüllt Scope-Prüfungen. Kontorechte, Anfrageinhalt, Tresorzustand und Ressourcenrechte können weitere Voraussetzungen setzen.
Parameter#
Keine Pfad- oder Query-Parameter deklariert.
Anfragekörper#
Erforderlich.
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
name | string | Ja | |
kind | union | Nein | |
scope_set | union | Nein | |
scopes | array | Nein | |
expires_at | integer | null | Nein |
Vollständiges Körperschema
OpenAPI JSON
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"kind": {
"anyOf": [
{
"type": "string",
"enum": [
"native"
]
},
{
"type": "string",
"enum": [
"mcp"
]
},
{
"type": "string",
"enum": [
"compat"
]
}
]
},
"scope_set": {
"anyOf": [
{
"type": "string",
"enum": [
"full"
]
},
{
"type": "string",
"enum": [
"scripts"
]
},
{
"type": "string",
"enum": [
"mcp"
]
}
]
},
"scopes": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"profiles:read"
]
},
{
"type": "string",
"enum": [
"profiles:write"
]
},
{
"type": "string",
"enum": [
"profiles:delete"
]
},
{
"type": "string",
"enum": [
"runtime:control"
]
},
{
"type": "string",
"enum": [
"proxies:read"
]
},
{
"type": "string",
"enum": [
"proxies:write"
]
},
{
"type": "string",
"enum": [
"secrets:read"
]
},
{
"type": "string",
"enum": [
"secrets:totp"
]
},
{
"type": "string",
"enum": [
"cookies:read"
]
},
{
"type": "string",
"enum": [
"cookies:write"
]
},
{
"type": "string",
"enum": [
"extensions:write"
]
},
{
"type": "string",
"enum": [
"kernels:manage"
]
},
{
"type": "string",
"enum": [
"trash:manage"
]
},
{
"type": "string",
"enum": [
"rpa:run"
]
},
{
"type": "string",
"enum": [
"rpa:write"
]
},
{
"type": "string",
"enum": [
"sync:control"
]
},
{
"type": "string",
"enum": [
"settings:write"
]
},
{
"type": "string",
"enum": [
"audit:read"
]
},
{
"type": "string",
"enum": [
"admin"
]
}
]
},
"minItems": 1,
"uniqueItems": true
},
"expires_at": {
"type": [
"integer",
"null"
],
"minimum": 0
}
},
"additionalProperties": false
}
}
}
}Antworten#
201 · Standardantwort
OpenAPI JSON
{
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"token",
"info"
],
"properties": {
"token": {
"type": "string"
},
"info": {
"type": "object",
"required": [
"id",
"name",
"kind",
"token_hint",
"scopes",
"created_at",
"last_used_at",
"expires_at",
"revoked_at"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"kind": {
"type": "string"
},
"token_hint": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"created_at": {
"type": "integer"
},
"last_used_at": {
"type": [
"null",
"integer"
]
},
"expires_at": {
"type": [
"null",
"integer"
]
},
"revoked_at": {
"type": [
"null",
"integer"
]
}
}
}
}
}
}
}
}default · HTTP-Fehlerhülle. Status und error.code bezeichnen den Fehler.
OpenAPI JSON
{
"description": "HTTP error envelope. The status and error.code identify the failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}Allgemeine Authentifizierungs- und Transportfehler können zusätzlich zu den dokumentierten Antworten auftreten.
OpenAPI-Definition#
Vollständige Operationsdefinition
OpenAPI JSON
{
"summary": "API-Token erzeugen; der Klartext wird nur in dieser Antwort geliefert",
"tags": [
"Tokens"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"kind": {
"anyOf": [
{
"type": "string",
"enum": [
"native"
]
},
{
"type": "string",
"enum": [
"mcp"
]
},
{
"type": "string",
"enum": [
"compat"
]
}
]
},
"scope_set": {
"anyOf": [
{
"type": "string",
"enum": [
"full"
]
},
{
"type": "string",
"enum": [
"scripts"
]
},
{
"type": "string",
"enum": [
"mcp"
]
}
]
},
"scopes": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"profiles:read"
]
},
{
"type": "string",
"enum": [
"profiles:write"
]
},
{
"type": "string",
"enum": [
"profiles:delete"
]
},
{
"type": "string",
"enum": [
"runtime:control"
]
},
{
"type": "string",
"enum": [
"proxies:read"
]
},
{
"type": "string",
"enum": [
"proxies:write"
]
},
{
"type": "string",
"enum": [
"secrets:read"
]
},
{
"type": "string",
"enum": [
"secrets:totp"
]
},
{
"type": "string",
"enum": [
"cookies:read"
]
},
{
"type": "string",
"enum": [
"cookies:write"
]
},
{
"type": "string",
"enum": [
"extensions:write"
]
},
{
"type": "string",
"enum": [
"kernels:manage"
]
},
{
"type": "string",
"enum": [
"trash:manage"
]
},
{
"type": "string",
"enum": [
"rpa:run"
]
},
{
"type": "string",
"enum": [
"rpa:write"
]
},
{
"type": "string",
"enum": [
"sync:control"
]
},
{
"type": "string",
"enum": [
"settings:write"
]
},
{
"type": "string",
"enum": [
"audit:read"
]
},
{
"type": "string",
"enum": [
"admin"
]
}
]
},
"minItems": 1,
"uniqueItems": true
},
"expires_at": {
"type": [
"integer",
"null"
],
"minimum": 0
}
},
"additionalProperties": false
}
}
}
},
"x-required-scopes": [
"admin"
],
"responses": {
"201": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"token",
"info"
],
"properties": {
"token": {
"type": "string"
},
"info": {
"type": "object",
"required": [
"id",
"name",
"kind",
"token_hint",
"scopes",
"created_at",
"last_used_at",
"expires_at",
"revoked_at"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"kind": {
"type": "string"
},
"token_hint": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"created_at": {
"type": "integer"
},
"last_used_at": {
"type": [
"null",
"integer"
]
},
"expires_at": {
"type": [
"null",
"integer"
]
},
"revoked_at": {
"type": [
"null",
"integer"
]
}
}
}
}
}
}
}
},
"default": {
"description": "HTTP error envelope. The status and error.code identify the failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}