Generate a new API key
Creates a new API key with the specified permissions. The full key secret is only returned once in this response - store it securely.
Authorization
Bearer JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.
In: header
Path Parameters
The tenant identifier
The API key configuration
Gets or sets the name of the API key. This helps in identifying the purpose of the key.
Gets or sets the number of days before the API key expires.
If set to null, the key will never expire.
If set to a positive integer, the key will expire after the specified number of days.
int32Specifies the type/origin of an API key.
The value tags how the key was created, which the dashboard uses to group + filter the API-keys table (e.g. "show only CLI sessions"). Wire form is UPPER_SNAKE per project convention.
"UNSPECIFIED" | "USER" | "CLI" | "SYSTEM" | "SERVICE_ACCOUNT"Explicit scope list. Each entry must be a known scope from Fruxon.Model.Tokens.TokenScopes.AllScopes; unknown values cause the request to 400 with the offending strings listed. Combined (unioned) with the expansion of Fruxon.Model.Tokens.GenerateTokenRequest.Preset when both are supplied — that lets callers say "the runner preset plus one extra scope I need" without having to enumerate the whole preset by hand.
Named preset (sugar for a scope list). One of runner,
builder, read-only, admin. Expanded at
mint time; the preset name itself is never stored — only the
expanded scope array — so a preset definition change tomorrow
doesn't retroactively widen permissions on keys minted today.
Response Body
curl -X POST "https://api.fruxon.com/v1/tenants/string/tokens:generate" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"name": "string",
"token": "string",
"keyPrefix": "string",
"scopes": [
"string"
],
"createdAt": 0,
"expiresAt": 0,
"type": "USER",
"createdBy": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}