# Create an API key Creates a new API key for programmatic access, assigning it a role that defines its permissions. Request: name - Human-readable label for the API key. expiresAt - Optional expiry timestamp. If omitted the key does not expire. roleId - Role to assign to the API key's associated service account, determining what operations the key is authorized to perform. Response: id - Assigned API key ID. name - Key display name. keyHint - Last 4 characters of the key, for identification purposes. expiresAt - Expiry timestamp if one was set. key - The full plaintext API key. This is the only time the full key is returned; it is stored hashed and cannot be retrieved again. Endpoint: POST /api/v1/api-key/create-api-key Version: 3.0 Security: bearerAuth ## Request fields (application/json): - `name` (string) Rule data fields - `expiresAt` (object) - `expiresAt.seconds` (integer) - `expiresAt.nanos` (integer) - `roleId` (string) Rule data fields ## Response 200 fields (application/json): - `id` (string) Rule data fields - `name` (string) Rule data fields - `keyHint` (string) Rule data fields - `expiresAt` (object) - `expiresAt.seconds` (integer) - `expiresAt.nanos` (integer) - `key` (string) Rule data fields ## Response 400 fields (application/json): - `message` (string) ## Response 401 fields (application/json): - `message` (string) ## Response 403 fields (application/json): - `message` (string) ## Response 404 fields (application/json): - `message` (string) ## Response 409 fields (application/json): - `message` (string) ## Response 429 fields (application/json): - `message` (string) ## Response 499 fields (application/json): - `message` (string) ## Response 500 fields (application/json): - `message` (string) ## Response 501 fields (application/json): - `message` (string) ## Response 503 fields (application/json): - `message` (string) ## Response 504 fields (application/json): - `message` (string)