Profile

List Personal Access Tokens

get
https://api.linode.com/v4/profile/tokens

Returns a paginated list of Personal Access Tokens currently active for your User.

Authorizations

Personal Access Token
OAuth: ( account:read_only)

Request Samples

curl -H "Authorization: Bearer $TOKEN" \
    https://api.linode.com/v4/profile/tokens

Response Samples

{
  "data": [
    {
      "id": "",
      "created": "2018-01-01T00:01:01.000Z",
      "label": "linode-cli",
      "expiry": "2018-01-01T13:46:32",
      "scopes": "*",
      "token": "abcdefghijklmnop"
    }
  ],
  "page": 1,
  "pages": 1,
  "results": 1
}

Responses

200: A paginated list of active tokens.

data
array of objects
id
integer

This token's unique ID, which can be used to revoke it.

created
Filterable
string

The date and time this token was created.

label
Filterable
string

This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for.

expiry
string

When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked.

scopes
string

The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure.

token
string

The token used to access the API. When the token is created, the full token is returned here. Otherwise, only the first 16 characters are returned.

page
integer
pages
integer
results
integer

default: Error

errors
array of objects
reason
string

What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.

field
string

The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.

Create Personal Access Token

post
https://api.linode.com/v4/profile/tokens

Creates a Personal Access Token for your User. The raw token will be returned in the response, but will never be returned again afterward so be sure to take note of it. You may create a token with at most the scopes of your current token. The created token will be able to access your Account until the given expiry, or until it is revoked.

Authorizations

Personal Access Token
OAuth: ( account:read_write)

Request Body Schema

expiry
string <date-time>

When this token should be valid until. If omitted, the new token will be valid until it is manually revoked.

label
Filterable
string [1 .. 100] characters

This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for.

scopes
string <oauth-scope>

The scopes to create the token with. These cannot be changed after creation, and may not exceed the scopes of the acting token. If omitted, the new token will have the same scopes as the acting token.

Request Samples

curl -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    -X POST -d '{
      "scopes": "*",
      "expiry": "2018-01-01T13:46:32",
      "label": "linode-cli"
    }' \
    https://api.linode.com/v4/profile/tokens

Response Samples

{
  "id": 1234,
  "label": "linode-cli",
  "created": "2018-01-01T00:01:01.000Z",
  "expiry": "2018-01-01T13:46:32",
  "scopes": "*",
  "token": "abcdefghijklmnop"
}

Responses

200: Token created successfully.

id
integer

This token's unique ID, which can be used to revoke it.

label
Filterable
string [1 .. 100] characters

This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for.

created
Filterable
string <date-time>

The date and time this token was created.

expiry
string <date-time>

When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked.

scopes
string <oauth-scopes>

The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure.

token
string

The token used to access the API. When the token is created, the full token is returned here. Otherwise, only the first 16 characters are returned.

default: Error

errors
array of objects
reason
string

What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.

field
string

The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.