Toggle user

POST /api/service/users/{id}

Deactivate or reactivate a user.

Note that admin users cannot be deactivated — they must first be made non-admin users by changing the role of the user.

Path parameters

  • id string Required

    Unique identifier (GUID) of the user to deactivate or reactivate.

Body Required

Object defining the action to be performed on the user.

  • enabled boolean

    When false, the user will be deactivated. When true, the user will be reactivated.

Responses

  • 200 object

    User was successfully deactivated or reactivated.

    • id string

      Unique identifier for the user.

    • username string

      Unique username for the user.

    • firstName string | null

      First name of the user.

    • lastName string | null

      Surname of the user.

    • email string

      Email address of the user.

    • emailVerified boolean | null

      When true, the user's email has been verified.

    • enabled boolean | null

      When true, the user is enabled and allowed to log in to Atlan. When false, the user will be prevented from logging in to Atlan.

  • 403 object

    User was unable to be deactivated or activated.

    • code integer

      Unique code for the type of error that occurred.

    • error string

      High-level description of the error.

    • message string

      More detailed message regarding the error that occurred.

POST /api/service/users/{id}
curl \
 -X POST https://tenant.atlan.com/api/service/users/02aaddf5-b9be-4433-9bfa-4a7d9a7ae4f5 \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"enabled":false}'
Request example
{
  "enabled": false
}
Response example (200)
{
  "id": "02aaddf5-b9be-4433-9bfa-4a7d9a7ae4f5",
  "createdTimestamp": 1654602973842,
  "username": "jsmith",
  "enabled": false,
  "totp": false,
  "emailVerified": true,
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jsmith@example.com",
  "disableableCredentialTypes": [],
  "requiredActions": [],
  "access": {
    "impersonate": true,
    "manage": true,
    "manageGroupMembership": true,
    "mapRoles": true,
    "view": true
  }
}
Response example (403)
{
  "code": 403,
  "error": "Forbidden",
  "message": "admin cannot disable fellow admins",
  "requestId": "d9iF3CFi9hLaafRo3I2hxA9GyfGvnAXN"
}