NylorunDocsBeta
Management APIKeys

Create or rotate an application key

PUT
/v1/tenant/keys/{keyId}

Issues a new application key named keyId and returns it this once. An application key of that name is replaced: the old one stops authenticating at once. A management key, studio and bootstrap are refused.

Authorization

managementKey
headerAuthorizationBearer <token>

A management key of the Tenant (role management): it reaches the Management API (/v1/tenant/*) and /v1/me, as itself, never for a subject. Issued only on the Tenant's machine (nylorun-operate keys put <id> --role management) or from NYLORUN_MANAGEMENT_KEY_FILE. Never accepted from a browser (Origin).

Path Parameters

keyId*string

The key's name: ^[a-z][a-z0-9-]{0,31}$, never studio or bootstrap

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Response Body

The new key, shown once

application/json
  1. response
id*string
Length1 <= length
role*string
Length1 <= length
createdAt*string
Length1 <= length
key*string
Match^[0-9a-f]{64}$
rotated*boolean
import { createAdmin } from "@nylorun/admin";const admin = createAdmin();const { key } = await admin.keys.put("backend"); // shown once
{  "id": "string",  "role": "string",  "createdAt": "string",  "key": "string",  "rotated": true}