Command: issue a project key with a project role (requires manager; session only). The secret is present only in THIS response; expiry max. 2 years.
POST
/projects/{projectId}/api-keys/create
const url = 'https://example.com/api/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/api-keys/create';const options = { method: 'POST', headers: {cookie: 'dnse_session=<dnse_session>', 'Content-Type': 'application/json'}, body: '{"name":"example","role":"manager","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/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/api-keys/create \ --header 'Content-Type: application/json' \ --cookie dnse_session=<dnse_session> \ --data '{ "name": "example", "role": "manager", "expiresAt": "example" }'Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Path Parameters
Abschnitt betitelt „Path Parameters“projectId
required
string format: uuid
Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Media typeapplication/json
object
name
required
string
role
required
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"}