Organization admins are able to manage users and groups within the organization. To do so a bearer token with admin scope needs to be obtained and passed in with API requests.

A user can be created by POSTing to the /users endpoint. By default, the user does not belong to any workspaces.

POST /users
{
  "email":"mreynolds@mammothstudios.com",
  "first_name":"Matthew",
  "last_name":"Reynolds"
}
201 Created
{
  "created_at":"2016-01-15T00:02:01.644Z",
  "deactivated":false,
  "default_workspace_choice":"last_used",
  "default_workspace_id":null,
  "email":"mreynolds@mammothstudios.com",
  "first_name":"Matthew",
  "home_file_id":null,
  "home_node_id":null,
  "id":"15",
  "last_login_at":null,
  "last_name":"Reynolds",
  "name":"Matthew Reynolds",
  "organization_admin":false,
  "running_operation_count":0,
  "stopped_operation_count":0,
  "updated_at":"2016-01-15T00:02:01.644Z"
}

In order for newly created users to use files, they need to be in at least one workspace. To add a user to a workspace, create a workspace membership for the user.

POST /workspace_memberships
{
  "member_id":"15",
  "member_type":"user",
  "workspace_id":"1"
}
202 Accepted
{
  "id":"138",
  "manager":false,
  "member_id":"15",
  "member_type":"user",
  "running_operation_count":1,
  "stopped_operation_count":0,
  "workspace_id":"1"
}

Adding a user to a workspace involves the creation of a home folder. As this process may take some time, a 202 Accepted may be returned instead of a 201 Created as the process continues asynchronously. Note that running_operation_count will also be nonzero if this is the case.

These operations can be accessed under the workspace_membership resource.

GET /workspace_memberships/138/operations
200 OK
[
  {
    "created_at":"2016-01-15T17:28:15.000Z",
    "id":"147",
    "status":"success",
    "type":"workspace_membership.create",
    "updated_at":"2016-01-15T17:32:37.000Z",
    "user_id":"4",
    "workspace_membership_id":"138"
  }
]

Once a user has been added to at least one workspace, the user's default workspace can be set.

PUT /users/15
{
  "default_workspace_id":"1"
}
204 No Content

A group can be created by POSTing to the /groups endpoint. When the group is created, it initially contains no users.

POST /groups
{
  "description":"Mammoth Studios marketing team",
  "name":"Marketing",
}
201 Created
{
  "created_at":"2016-01-15T00:21:54.103Z",
  "description":"Mammoth Studios marketing team",
  "id":"39",
  "name":"Marketing",
  "running_operation_count":0,
  "stopped_operation_count":0,
  "updated_at":"2016-01-15T00:21:54.103Z"
}

In order to add an existing user to an existing group, a POST request should be made to the /group_memberships endpoint.

POST /group_memberships
{
  "group_id":"39",
  "member_id":"15",
  "member_type":"user",
}
201 Created
{
  "group_id":"39",
  "id":"380",
  "member_id":"15",
  "member_type":"user",
  "running_operation_count":0,
  "stopped_operation_count":0
}

Similarly, groups can be added to other groups by specifying member_type as group and giving the child group's ID as member_id.

To remove a member from the group, make a delete request with the member's group_membership id.

DELETE /group_memberships/380
204 No Content
Video player

Video

×

Reset your Password Password resets are handled on the Support Site

×