Command: issue an administrative key with fine-grained scopes over the four admin levels (admin only; session only).
POST
/admin/api-keys/create
const url = 'https://example.com/api/v1/admin/api-keys/create';const options = { method: 'POST', headers: {cookie: 'dnse_session=<dnse_session>', 'Content-Type': 'application/json'}, body: '{"name":"example","scopes":["users"],"expiresAt":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/admin/api-keys/create \ --header 'Content-Type: application/json' \ --cookie dnse_session=<dnse_session> \ --data '{ "name": "example", "scopes": [ "users" ], "expiresAt": "example" }'Authorizations
Abschnitt betitelt „Authorizations“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Media typeapplication/json
object
name
required
string
scopes
required
Array<string>
expiresAt
RFC 3339 or YYYY-MM-DD; empty = 1 year.
string
Responses
Abschnitt betitelt „Responses“Key created; secret shows exactly once.
Media typeapplication/json
object
id
string format: uuid
name
string
kind
string
projectId
string format: uuid
projectName
Resolved in the admin overview.
string
role
string
scopes
Array<string>
expiresAt
string format: date-time
lastUsedAt
string format: date-time
secret
Present only in the create response — shown exactly once.
string
Example
{ "kind": "project", "role": "manager", "scopes": [ "users" ]}Malformed request.
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}