linkThe token object
Keygen authenticates your API requests using tokens. Below you will find
the various attributes for the token resource, as well as the token resource's
relationships. The actual token
string is hashed before being stored in our
databases, thus is only available directly after generating/regenerating a token.
Tokens with an expiry will automatically be deleted 90 days after their expiry,
unless renewed.
linkAttributes
linkdata.attributes.kind
stringread onlyThe kind of token, based on its bearer.
Options
activation-token
: A license token with permission to activate and deactivate the machines for a given license.product-token
: An internal administrative token with permission to manage the entire product and its resources, usually for server-side use.user-token
: A normal user of one or more of your products, with limited permission to manage their own resources.support-token
: An internal administrative user of your Keygen account, with a limited subset of permissions.sales-token
: An internal administrative user of your Keygen account, with a limited subset of permissions.developer-token
: An internal administrative user of your Keygen account, with permission to manage most resources.admin-token
: An internal administrative user of your Keygen account, with permission to manage the entire account.
linkdata.attributes.token
stringread onlyThe raw token of the token. This attribute is only available to read directly after token generation. This is the value you will use to authenticate with when sending requests to our API.
linkdata.attributes.name
stringAn optional name for the token. This can be used to easily identify tokens at a glance.
linkdata.attributes.expiry
timestamp (iso8601)read onlyThe timestamp for when the token expires. Requests using an expired token will be rejected.
linkdata.attributes.maxActivations
integerThe maximum amount of machine activations this token may perform. This attribute is only applicable to license tokens.
linkdata.attributes.activations
integerread onlyThe number of machine activations that have been performed by this token. This attribute is only applicable to license tokens.
linkdata.attributes.maxDeactivations
integerThe maximum amount of machine deactivations this token may perform. This attribute is only applicable to license tokens.
linkdata.attributes.deactivations
integerread onlyThe number of machine deactivations that have been performed by this token. This attribute is only applicable to license tokens.
linkRelationships
linkdata.relationships.environment
individualent onlyThese relationships are only available for accounts on an Ent tier.The environment that the token belongs to.
Example object
{ "data": { "id": "6a7562be-b302-43d2-a550-30d6026247aa", "type": "tokens", "attributes": { "kind": "user-token", "token": "user-57c1cdc2a084f0ebd46850e5742b1f0bca47d1ca5f5262f6c5969fec8dbd530dv3", "expiry": "2022-03-15T19:27:50.440Z", "created": "2017-01-02T20:26:53.464Z", "updated": "2017-01-02T20:26:53.464Z" }, "relationships": { "account": { "links": { "related": "/v1/accounts/<account>" }, "data": { "type": "accounts", "id": "<account>" } }, "bearer": { "links": { "related": "/v1/accounts/<account>/users/a5a154d2-f026-40fa-bc8d-a7e3ca415298" }, "data": { "type": "users", "id": "a5a154d2-f026-40fa-bc8d-a7e3ca415298" } } } }}