user.org.add

The user.org.add command is used to associate a user with an organization and define the permissions the user has within that organization.

Required Org-Admin rights.

TR50 Request


                        {
  "cmd": {
    "command": "user.org.add",
    "params": {
      "userId": "52a1d3db169e1fd03217940d",
      "roles": ["52a1d3db169e1fd032179401", "52a1d3db169e1fd032179402"],
      "orgId": "52fd032179402a1d3db169e1",
      "isOrgAdmin": false,
      "tags": ["tag1", "tag2"]
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

userId

String

Yes

The object Id of the user.

roles

Array

 

Object Ids of roles the user should have.

orgId

String

 

Defaults to the organization of the current session. Requires Super-Ops to override.

isOrgAdmin

Boolean

 

If the user is an Org-Admin.

tags

Array

 

The security tags the user has access to.

TR50 Response

If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.


                        {
  "cmd": {
    "success": true
  }
}