Share this page

# PUT and POST: Activate or deactivate a user

This topic provides instructions for using activating and deactivating users using the REST API.

In this topic:

## 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:

- Site. The on-premises site admin activates the users on the site level. This is done in the site admin context:

  `http[s]://<server>:<port>/admin/*`

- 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>/*`

Tip: You can deactivate all users in all share spaces by deactivated the users at the site level. If a user is not activated at the site, the user cannot be activated in any shared spaces.

## 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. 1 means the user is deactivated. 0 means the user is activated. 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: 1 means the user is deactivated. 0 means the user is activated. 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. 1 means that either the user is deactivated at the site, or ssp_user_activation_status for the shared space is set to 1. Therefore the user is deactivated. 0 means that the user is both activated at the site context and the ssp_user_activation_status for the shared space is set to 0. Therefore the user is activated. 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

The following examples shows how to activate and deactivate users.

### Site: Use PUT to deactivate an existing activated user

Request:

    PUT .../admin/users/

    {

       "data": [

          {

            "activity_level":0,

            "id":"2013"

          }

       ]

    }

Response:

The response is 200 OK.

### Shared space: Use PUT to deactivate an existing activated user

Request:

    PUT .../api/shared_spaces/<space_id>/users/

    {
                   "ssp_user_activation_status": false,
                   "id": "1003"
    }

Response:

The response is 200 OK.

### Workspace: Use PUT to activate a deactivated user

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

- Users

https://admhelp.microfocus.com Software Delivery Management 8942
Tips to improve your search results... OpenText™ Software Delivery Management Help Center OpenText™ Software Delivery Management Help 26.3 All View Local Help Center View Online Help Center Version: