PUT and POST: Activate or deactivate a user
This topic provides instructions for using activating and deactivating users using the REST API.
Overview
You can use the REST API to activate or deactivate a user.
You can also create a new user with a deactivated status. This could be helpful, for example, when implementing synchronization integrations.
You can activate and deactivate users in the site, shared space, and workspace contexts.
Activate users
To activate users perform the following, depending on your context:
-
Space. Once users are activated for the site by the site admin, space admins can activate users in each shared space. This means that users can be activated for certain shared spaces and deactivated for others. This is done in the shared space context:
http[s]://<server>:<port>/api/shared_spaces/<space_id>/*
-
Workspace. To activate or deactivate users in the workspace context:
http[s]://<server>:<port>/api/shared_spaces/<space_id>/workspaces/<workspace_id>/workspace_users/<workspace_user_id>/*
About the activation fields
The following fields work together to establish whether a user is activated in different contexts.
Activation field | Description and usage |
---|---|
ssp_user_activation_status |
Whether the user is activated in the shared space context.
You can mark a user deactivated in the shared space context, even if the user is activated in the site context. This way, the user can access only the shared spaces for which the user is allowed. |
activity_level |
On the site level:
On the shared space level: This calculated (read-only) field lets you query for activated or deactivated users. The calculation is based on the activation status of the user at the site context, and the value of the ssp_user_activation_status field.
The field is re-calculated each time changes are made in the site to the user's activation status, and the shared space's ssp_user_activation_status. |
Examples
Request
PUT .../admin/users/
{
"data": [
{
"activity_level":0,
"id":"2013"
}
]
}
Response
The response is 200 OK.
Request
PUT .../api/shared_spaces/<space_id>/users/
{ "ssp_user_activation_status": false, "id": "1003" }
Response
The response is 200 OK.
Request
PUT .../api/shared_spaces/1001/workspaces/1002/workspace_users/1003
{ "id":"1003", "ws_user_activation_status": 0 }
Response
The response is 200 OK.
See also: