PUThttps://api.spotinst.io/setup/account/{ACCOUNT_ID}/user/

Change the users’ permissions for an account (only accounts under the creator’s own organization are allowed). Creator’s organization ID is taken from the personal token attached to the API call.

URL Parameters

Parameter Type Description
ACCOUNT_ID String

The Spotinst accountId to attach the user to

Request - Update user permissions for editor role

Headers
Copied!
Downloaded!
{
    "Authorization": "Bearer ${token}",
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "userId": "u-1234",
    "permissionStrategy": "ROLE_BASED",
    "role": "editor"
}
Request - Update user permission with access policies

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "userId": "u-1234",
    "permissionStrategy": "POLICY_BASED",
    "policyIds": ["pol-c3e30574", "pol-c3e30575"]
}
Request - Update user permission for viewer role

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "userId": "u-1234",
    "role": "viewer"
}

Body Attributes


Attribute Type Description
userEmail * String

One of userEmail / userId is required. identify user by its email address

Example: test@gmail.com
userId * String

One of userEmail / userId is required. identify user by its user ID

permissionStrategy String

Set the user permissions type, by role or by access policy. Valid values: "ROLE_BASED", "POLICY_BASED"

Default: ROLE_BASED
role String

Valid values: "viewer", "editor". Required on permissionStrategy = ROLE_BASED

policyIds Array<String>

Set list of access policies IDs. Required on permissionStrategy = POLICY_BASED

Response - 200

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}