The API key object
Every field of an API key, and the full key material a create answers once.
ApiKeyResponse
JavaScript: no alias - an element of the type that holds it · Python: viewrium.ApiKey
iduuidrequiredUnique identifier.
org_iduuidoptionalnullableThe organization the key is bound to.
key_typeKeyTyperequiredsecret (sk_, server-side) or publishable (pk_, safe in browser code).
One of "publishable", "secret"
key_prefixstringrequiredThe key's first characters (e.g. sk_live_abc1), for telling keys apart.
namestringoptionalnullableA label you gave the key.
scopesstring[]optionalWhat the key may do: products:read, products:write, usage:read, webhooks:manage, beacon:write. Empty means everything its key type allows.
Default []
last_used_atdatetimeoptionalnullableWhen the key last authenticated a request. Null if it never has.
revoked_atdatetimeoptionalnullableWhen the key was revoked. Null while it is active.
created_atdatetimerequiredWhen it was created.
keystringoptionalnullableThe full key, for a publishable key only (it ships in storefront code, so it stays readable). Always null for a secret key, whose material is shown only at creation.
ApiKeyCreateResponse
JavaScript: ApiKeyCreated · Python: viewrium.ApiKeyCreateResponse
A newly created API key. key holds the full key material: for a secret key this is the only time it is returned, so store it now.
iduuidrequiredUnique identifier.
org_iduuidoptionalnullableThe organization the key is bound to.
key_typeKeyTyperequiredsecret (sk_, server-side) or publishable (pk_, safe in browser code).
One of "publishable", "secret"
key_prefixstringrequiredThe key's first characters (e.g. sk_live_abc1), for telling keys apart.
namestringoptionalnullableA label you gave the key.
scopesstring[]optionalWhat the key may do: products:read, products:write, usage:read, webhooks:manage, beacon:write. Empty means everything its key type allows.
Default []
last_used_atdatetimeoptionalnullableWhen the key last authenticated a request. Null if it never has.
revoked_atdatetimeoptionalnullableWhen the key was revoked. Null while it is active.
created_atdatetimerequiredWhen it was created.
keystringrequiredThe full key. For a secret key this is the only time it is ever returned: store it now.
ApiKeyListResponse
JavaScript: ApiKeyList · Python: viewrium.ApiKeyListResponse
The organization's keys.