Profile

Personal Access Token View

get
https://api.linode.com/v4/profile/tokens/{tokenId}

Returns a single Personal Access Token.

Path Parameters

tokenId
Required
integer

The ID of the token to access.

Request Samples

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

Response Samples

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

Responses

200: The requested token.

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.

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.

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.

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.

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.

Personal Access Token Update

put
https://api.linode.com/v4/profile/tokens/{tokenId}

Updates a Personal Access Token.

Path Parameters

tokenId
Required
integer

The ID of the token to access.

Request Body Schema

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.

Request Samples

curl -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    -X PUT -d '{
      "label": "linode-cli"
    }' \
    https://api.linode.com/v4/profile/tokens/123

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

Personal Access Token Revoke

delete
https://api.linode.com/v4/profile/tokens/{tokenId}

Revokes a Personal Access Token. The token will be invalidated immediately, and requests using that token will fail with a 401. It is possible to revoke access to the token making the request to revoke a token, but keep in mind that doing so could lose you access to the api and require you to create a new token through some other means.

Path Parameters

tokenId
Required
integer

The ID of the token to access.

Request Samples

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

Response Samples

{}

Responses

200: Token revoked successfully.

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.