service-accounts

Issue an API key to a service account.

Mints a new sb_api_* key for the service account and returns its secret in api_key. The secret is shown only in this response; store it now, since no later call returns it.

A key does what the service account's role allows and takes no scope of its own; a body that names scope is refused. It lasts 365 days unless expires_in_days says otherwise, and never expires only when expires_in_days is explicitly null.

Requires the serviceAccountKeys.create permission, which only the admin and owner roles hold. Personal access tokens and federated tokens are refused whatever their role.

post/organizations/{organizationId}/service-accounts/{serviceAccountId}/keys

Request

  • Base URL
    https://api.shorebird.dev/api/v1
  • Auth
    • HTTP bearer
    • or HTTP bearer

Request body

namestring required

The key's name. Surrounding whitespace is trimmed; what remains must be 1 to 64 characters.

expires_in_daysinteger nullable

How many days the key lasts, from 1 to 365. Omitted means 365. An explicit null issues a key that never expires.

Response

The new key, including its secret.

api_keystring required

The key's secret, an sb_api_* token to send as a bearer token. Returned only here: store it now, since no later call returns it.

idinteger required

The key's ID.

namestring required

The key's name.

created_atstring date-time required

When the key was issued.

last_used_atstring date-time nullable required

When the key was last used; null for a new key.

expires_atstring date-time nullable required

When the key expires, or null if it never does.

scopesstring[] required

The key's scopes by wire name, ["api"].

Changes

No recorded changes to this operation across all 1 revision of this API.