Hanzo
OpenapiO11y

Mints an API key for a service account and answers the key's id and its secret…

Mints an API key for a service account and answers the key's id and its secret — the one time the secret is ever shown.

POST /v1/o11y/service_accounts/{id}/keys

Addresshttps://api.hanzo.ai/v1/o11y/service_accounts/{id}/keys
MethodPOST
OperationCreateServiceAccountKey
AuthAuthorization: Bearer $HANZO_API_KEY

Mints an API key for a service account and answers the key's id and its secret — the one time the secret is ever shown.

ExpiresAt is a unix timestamp in seconds; zero means the key never expires, and a timestamp in the past is refused.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyes
expiresAtbodyintegerExpiresAt is when the key stops working, as a unix timestamp in seconds.
namebodystringName is the key's name: a lowercase letter followed by lowercase letters, digits or hyphens, at most 80 characters.

Response

StatusBodyMeaning
201o11y.O11yAPIKeyCreateOutcreated

201 body — 4 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yAPIKeySecret
data.idbodystringID is the key id.
data.keybodystringKey is the secret the service account authenticates with.
statusbodystringStatus is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y service_accounts keys create <id>

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page