Account

User View

get
https://api.linode.com/v4/account/users/{username}

Returns information about a single User on your Account.

This command can only be accessed by the unrestricted users of an account.

Path Parameters

username
Required
string

The username to look up.

Request Samples

curl -H "Authorization: Bearer $TOKEN" \
    https://api.linode.com/v4/account/users/example_user

Response Samples

{
  "email": "example_user@linode.com",
  "username": "example_user",
  "restricted": true,
  "ssh_keys": [],
  "tfa_enabled": true,
  "verified_phone_number": "+5555555555",
  "password_created": "2018-01-01T01:01:01",
  "last_login": {
    "login_datetime": "2018-01-01T01:01:01",
    "status": "successful"
  }
}

Responses

200: The requested User object

email
string <email>

The email address for the User. Linode sends emails to this address for account management communications. May be used for other communications as configured.

username
Filterable
string [3 .. 32] characters ^[a-zA-Z0-9]((?![_-]{2,})[a-zA-Z0-9-_])+[a-zA-Z0-9]$

The User's username. This is used for logging in, and may also be displayed alongside actions the User performs (for example, in Events or public StackScripts).

restricted
boolean

If true, the User must be granted access to perform actions or access entities on this Account. See User Grants View (GET /account/users/{username}/grants) for details on how to configure grants for a restricted User.

ssh_keys
array of objects

A list of SSH Key labels added by this User.

Users can add keys with the SSH Key Add (POST /profile/sshkeys) command.

These keys are deployed when this User is included in the authorized_users field of the following requests:

tfa_enabled
boolean

A boolean value indicating if the User has Two Factor Authentication (TFA) enabled. See the Create Two Factor Secret (POST /profile/tfa-enable) endpoint to enable TFA.

verified_phone_number
Nullable
string <phone>

The phone number verified for this User Profile with the Phone Number Verify (POST /profile/phone-number/verify) command.

null if this User Profile has no verified phone number.

password_created
Nullable
string <date-time>

The date and time when this User's current password was created.

User passwords are first created during the Account sign-up process, and updated using the Reset Password webpage.

null if this User has not created a password yet.

last_login
Nullable
object

Information for the most recent login attempt for this User.

null if no login attempts have been made since creation of this User.

Access the User Logins List All command for additional login information.

login_datetime
string

The date and time of this User's most recent login attempt.

status
string
Enum: "successful""failed"

The result of the most recent login attempt for this User.

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.

User Update

put
https://api.linode.com/v4/account/users/{username}

Update information about a User on your Account. This can be used to change the restricted status of a User. When making a User restricted, no grants will be configured by default and you must then set up grants in order for the User to access anything on the Account.

This command can only be accessed by the unrestricted users of an account.

Path Parameters

username
Required
string

The username to look up.

Request Body Schema

email
string <email>

The email address for the User. Linode sends emails to this address for account management communications. May be used for other communications as configured.

restricted
boolean

If true, the User must be granted access to perform actions or access entities on this Account. See User Grants View (GET /account/users/{username}/grants) for details on how to configure grants for a restricted User.

username
Filterable
string [3 .. 32] characters ^[a-zA-Z0-9]((?![_-]{2,})[a-zA-Z0-9-_])+[a-zA-Z0-9]$

The User's username. This is used for logging in, and may also be displayed alongside actions the User performs (for example, in Events or public StackScripts).

Request Samples

curl -H "Content-Type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    -X PUT -d '{
        "username": example_user,
        "email": example@linode.com,
        "restricted": true
    }' \
    https://api.linode.com/v4/account/users/example_user

Response Samples

{
  "email": "example_user@linode.com",
  "username": "example_user",
  "restricted": true,
  "ssh_keys": [],
  "tfa_enabled": true,
  "verified_phone_number": "+5555555555",
  "password_created": "2018-01-01T01:01:01",
  "last_login": {
    "login_datetime": "2018-01-01T01:01:01",
    "status": "successful"
  }
}

Responses

200: User updated successfully.

email
string <email>

The email address for the User. Linode sends emails to this address for account management communications. May be used for other communications as configured.

username
Filterable
string [3 .. 32] characters ^[a-zA-Z0-9]((?![_-]{2,})[a-zA-Z0-9-_])+[a-zA-Z0-9]$

The User's username. This is used for logging in, and may also be displayed alongside actions the User performs (for example, in Events or public StackScripts).

restricted
boolean

If true, the User must be granted access to perform actions or access entities on this Account. See User Grants View (GET /account/users/{username}/grants) for details on how to configure grants for a restricted User.

ssh_keys
array of objects

A list of SSH Key labels added by this User.

Users can add keys with the SSH Key Add (POST /profile/sshkeys) command.

These keys are deployed when this User is included in the authorized_users field of the following requests:

tfa_enabled
boolean

A boolean value indicating if the User has Two Factor Authentication (TFA) enabled. See the Create Two Factor Secret (POST /profile/tfa-enable) endpoint to enable TFA.

verified_phone_number
Nullable
string <phone>

The phone number verified for this User Profile with the Phone Number Verify (POST /profile/phone-number/verify) command.

null if this User Profile has no verified phone number.

password_created
Nullable
string <date-time>

The date and time when this User's current password was created.

User passwords are first created during the Account sign-up process, and updated using the Reset Password webpage.

null if this User has not created a password yet.

last_login
Nullable
object

Information for the most recent login attempt for this User.

null if no login attempts have been made since creation of this User.

Access the User Logins List All command for additional login information.

login_datetime
string

The date and time of this User's most recent login attempt.

status
string
Enum: "successful""failed"

The result of the most recent login attempt for this User.

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.

User Delete

delete
https://api.linode.com/v4/account/users/{username}

Deletes a User. The deleted User will be immediately logged out and may no longer log in or perform any actions. All of the User's Grants will be removed.

This command can only be accessed by the unrestricted users of an account.

Path Parameters

username
Required
string

The username to look up.

Request Samples

curl -H "Authorization: Bearer $TOKEN" \
    -X DELETE \
    https://api.linode.com/v4/account/users/example_user

Response Samples

{}

Responses

200: User deleted 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.