Viewrium Docs
Objects

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

iduuidrequired

Unique identifier.

org_iduuidoptionalnullable

The organization the key is bound to.

key_typeKeyTyperequired

secret (sk_, server-side) or publishable (pk_, safe in browser code).

One of "publishable", "secret"

key_prefixstringrequired

The key's first characters (e.g. sk_live_abc1), for telling keys apart.

namestringoptionalnullable

A label you gave the key.

scopesstring[]optional

What the key may do: products:read, products:write, usage:read, webhooks:manage, beacon:write. Empty means everything its key type allows.

Default []

last_used_atdatetimeoptionalnullable

When the key last authenticated a request. Null if it never has.

revoked_atdatetimeoptionalnullable

When the key was revoked. Null while it is active.

created_atdatetimerequired

When it was created.

keystringoptionalnullable

The 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.

iduuidrequired

Unique identifier.

org_iduuidoptionalnullable

The organization the key is bound to.

key_typeKeyTyperequired

secret (sk_, server-side) or publishable (pk_, safe in browser code).

One of "publishable", "secret"

key_prefixstringrequired

The key's first characters (e.g. sk_live_abc1), for telling keys apart.

namestringoptionalnullable

A label you gave the key.

scopesstring[]optional

What the key may do: products:read, products:write, usage:read, webhooks:manage, beacon:write. Empty means everything its key type allows.

Default []

last_used_atdatetimeoptionalnullable

When the key last authenticated a request. Null if it never has.

revoked_atdatetimeoptionalnullable

When the key was revoked. Null while it is active.

created_atdatetimerequired

When it was created.

keystringrequired

The full key. For a secret key this is the only time it is ever returned: store it now.

ApiKeyListResponse

JavaScript: ApiKeyList · Python: viewrium.ApiKeyListResponse

dataApiKeyResponse[]required

The organization's keys.

On this page