latestOpenAPI 3.1.02026-08-20118232229.3 KB

0e42b0fb26d9

Create API key for service account

Mint a new API key bound to a service account. The full identifier is only returned on this response. Team admin only.

post/service-accounts/{idOrName}/api-keys

Path parameters

idOrNamestring required

The ID or name of the service account this key authenticates as.

The ID or name of the service account this key authenticates as.

Request body

$schemastring uri

A URL to the JSON Schema for this object.

expires_atstring date-time

When the API key expires.

namestring required

Human-readable name for the API key.

scopesstring

Space-separated scopes for the key. Defaults to the SA's role scopes when omitted.

Example request

{
  "$schema": "https://api.tower.dev/v1/schemas/CreateServiceAccountAPIKeyParams.json"
}

Response

Created

$schemastring uri

A URL to the JSON Schema for this object.

Example response

{
  "$schema": "https://api.tower.dev/v1/schemas/CreateServiceAccountAPIKeyResponse.json"
}