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

Add a user to the account and set its permissions on the account. Creator’s organization ID is taken from the personal token attached to the API call.

Parameter Type Description
ACCOUNT_ID * String

The Spotinst accountId to attach the user to

Example: act-124avc
Request - Set user permissions for editor role

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

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

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

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

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

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