const apiInstance = new Fastly.UserApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
createUser | POST /user | Create a user |
deleteUser | DELETE /user/{user_id} | Delete a user |
getCurrentUser | GET /current_user | Get the current user |
getUser | GET /user/{user_id} | Get a user |
requestPasswordReset | POST /user/{user_login}/password/request_reset | Request a password reset |
updateUser | PUT /user/{user_id} | Update a user |
updateUserPassword | POST /current_user/password | Update the user's password |
createUser({ , [login, ][name, ][limit_services, ][locked, ][require_new_password, ][role, ][two_factor_auth_enabled, ][two_factor_setup_required] })
Create a user.
const options = {
login: "login_example",
name: "name_example",
limit_services: true,
locked: true,
require_new_password: true,
role: new Fastly.RoleUser(),
two_factor_auth_enabled: true,
two_factor_setup_required: true,
};
apiInstance.createUser(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
login | String | [optional] | |
name | String | The real life name of the user. | [optional] |
limit_services | Boolean | Indicates that the user has limited access to the customer's services. | [optional] |
locked | Boolean | Indicates whether the is account is locked for editing or not. | [optional] |
require_new_password | Boolean | Indicates if a new password is required at next login. | [optional] |
role | RoleUser | [optional] | |
two_factor_auth_enabled | Boolean | Indicates if 2FA is enabled on the user. | [optional] |
two_factor_setup_required | Boolean | Indicates if 2FA is required by the user's customer account. | [optional] |
deleteUser({ user_id })
Delete a user.
const options = {
user_id: "user_id_example", // required
};
apiInstance.deleteUser(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Alphanumeric string identifying the user. |
getCurrentUser()
Get the logged in user.
apiInstance.getCurrentUser()
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
This endpoint does not need any parameters.
getUser({ user_id })
Get a specific user.
const options = {
user_id: "user_id_example", // required
};
apiInstance.getUser(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Alphanumeric string identifying the user. |
requestPasswordReset({ user_login })
Requests a password reset for the specified user.
const options = {
user_login: "user_login_example", // required
};
apiInstance.requestPasswordReset(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
user_login | String | The login associated with the user (typically, an email address). |
updateUser({ user_id, [login, ][name, ][limit_services, ][locked, ][require_new_password, ][role, ][two_factor_auth_enabled, ][two_factor_setup_required] })
Update a user. Only users with the role of superuser
can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Two-factor attributes are not editable via this endpoint.
const options = {
user_id: "user_id_example", // required
login: "login_example",
name: "name_example",
limit_services: true,
locked: true,
require_new_password: true,
role: new Fastly.RoleUser(),
two_factor_auth_enabled: true,
two_factor_setup_required: true,
};
apiInstance.updateUser(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Alphanumeric string identifying the user. | |
login | String | [optional] | |
name | String | The real life name of the user. | [optional] |
limit_services | Boolean | Indicates that the user has limited access to the customer's services. | [optional] |
locked | Boolean | Indicates whether the is account is locked for editing or not. | [optional] |
require_new_password | Boolean | Indicates if a new password is required at next login. | [optional] |
role | RoleUser | [optional] | |
two_factor_auth_enabled | Boolean | Indicates if 2FA is enabled on the user. | [optional] |
two_factor_setup_required | Boolean | Indicates if 2FA is required by the user's customer account. | [optional] |
updateUserPassword({ , [old_password, ][new_password] })
Update the user's password to a new one.
const options = {
old_password: "old_password_example",
new_password: "new_password_example",
};
apiInstance.updateUserPassword(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
old_password | String | The user's current password. | [optional] |
new_password | String | The user's new password. | [optional] |