Profile
Personal Access Tokens List
https://api.linode.com/v4/profile/tokens
Returns a paginated list of Personal Access Tokens currently active for your User.
Request Samples
- Shell
- CLI
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/profile/tokens
Response Samples
- 200
- default
{
"data": [
{
"id": "",
"created": "2018-01-01T00:01:01.000Z",
"label": "linode-cli",
"token": "abcdefghijklmnop",
"expiry": "2018-01-01T13:46:32",
"scopes": "*"
}
],
"page": 1,
"pages": 1,
"results": 1
}
Responses
200: A paginated list of active tokens.
This token's unique ID, which can be used to revoke it.
The date and time this token was created.
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.
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.
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.
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.
The current page.
The total number of pages.
The total number of results.
default: Error
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.
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 Create
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.
Request Body Schema
When this token should be valid until. If omitted, the new token will be valid until it is manually revoked.
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.
The access scopes to grant to the created token. These cannot be changed after creation, and may not exceed the scopes of the acting token.
If omitted or entered with a wildcard character (*
), the new token will have the same scopes as the acting token.
Multiple scopes are separated by a space character ().
For example, linodes:read_write account:read_only
.
Request Samples
- Shell
- CLI
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
- 200
- default
{
"token": "abcdefghijklmnop",
"created": "2018-01-01T00:01:01.000Z",
"expiry": "2018-01-01T13:46:32",
"id": 1234,
"label": "linode-cli",
"scopes": "*"
}
Responses
200: Token created successfully.
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.
The date and time this token was created.
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.
This token's unique ID, which can be used to revoke it.
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.
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
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.
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.