> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocoondata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# <access-service>/api/v1/users/{userId}

## URL structure&#x20;

```text theme={null}
https://access-service.xy-company.com/api/v1/users/{userId}
```

where `{userId}` is the ID of a Covata user account.

## Supported methods and overview&#x20;

* `PUT` - used to:

  * enable or disable two-factor authentication (2FA) on a [Safe Share administrator](/3.3/admin-platform/administering-platform-administrator-users.md#enabling-or-disabling-2fa-for-a-platform-administrator) account (specified by `userId`) \

    *OR*
  * reconfigure 2FA for a Covata user account specified by `userId`, which is either:

    * a [Safe Share administrator](/3.3/admin-platform/administering-platform-administrator-users.md#re-configuring-2fa-for-a-platform-administrator) or
    * a member of any [organization](/3.3/admin-org/administering-users-within-an-organisation.md#re-configuring-2fa-for-an-organisation-user-account).

## Detailed description&#x20;

This API endpoint serves a number of purposes:

* Enables or disables 2FA on a Safe Share administrator account (specified by `userId`).
* Reconfigures 2FA for a Covata user account (specified by `userId`) which is either:

  * a Safe Share administrator (by another Safe Share administrator [access token is submitted in the request to this endpoint](/3.3/api/access-service-api-v1-users-userid.md#access-service-api-v1-users-userid-supported-roles-and-conditions)), or
  * a member of an organization (by an Organization administrator whose access token is submitted in the request to this endpoint).

> [!NOTE]
>
> For more information about retrieving Covata user account IDs, see [\<access-service>/api/v1/users](/3.3/api/access-service-api-v1-users.md) and [\<access-service>/api/v1/organisations/\{orgGroupId}/users](/3.3/api/access-service-api-v1-organisations-orggroupid-users.md).

## Supported roles and conditions&#x20;

This API endpoint supports requests utilizing Covata user accounts with the following roles (as described in the [Safe Share Administrator's](/3.3/admin-platform/administering-platform-administrator-users.md#platform-administrators-and-user-roles) and [Organization Administrator's](/3.3/admin-org/administering-users-within-an-organisation.md#an-organisation-users-roles) Guides):

* [Safe Share administrator](/3.3/admin-platform/administering-platform-administrator-users.md#platform-administrator-role)
* [Organization administrator](/3.3/admin-org/administering-users-within-an-organisation.md#organisation-administrator-role) - when this user is a member of the same organization that the Covata user (specified by `{userId}` in the request's URL) is also a member of.

The Covata Platform's resources available to a Covata user meeting the criteria above is determined by the access token submitted in the [header](/3.3/api/access-service-api-v1-users-userid.md#access-service-api-v1-users-userid-required-headers) of requests to this endpoint.

## Required headers&#x20;

The appropriate access token as the `Bearer` token:

* `Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...`

The following header is required if the body of the request has a JSON object:

* `Content-Type: application/json`

## Required parameters&#x20;

The following parameter must be sent in the **body** of the PUT request, each as individual member of a **JSON object**:

* **mfaEnabled** ( *for Safe Share administrator users only* ) - A boolean value of `true` to enable 2FA on the Covata user account represented by `userId` in the request's URL or `false` to disable 2FA on this account.
* **generateNewAuthenticatorKey** - A boolean value of `true` to reconfigure 2FA for the Covata user represented by `userId` in the URL. \

  **Example (request to enable 2FA on a Covata user account):**

  ```json theme={null}
  {
      "mfaEnabled": true
  }
  ```

  **Example (request to reconfigure 2FA on a user account):**

  ```json theme={null}
  {
      "generateNewAuthenticatorKey": true
  }
  ```

## Returns&#x20;

If the request succeeded, then an HTTP response status `200 OK` is returned.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.