---
title: "Deactivates an account: it can no longer sign in and stops counting as a seat."
method: POST
path: "/api/v1/users/{id}/deactivate"
tags: ["Users"]
---

# Deactivates an account: it can no longer sign in and stops counting as a seat.

`POST /api/v1/users/{id}/deactivate`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/users/{id}/deactivate`
- Auth: HTTP bearer

Requires `ManageUsers` and an `Idempotency-Key`; no body. Same rules as
`PATCH { "isActive": false }` - an Organization Admin needs a removal request instead. Already
inactive → 200 unchanged. Example:
`POST /api/v1/users/8f0c3c1e-2b6d-4c55-9a51-0d3f3c1b7e21/deactivate`.

## Path parameters

- `id` string, required

## Response `200`

The account after the change.

- UserDetailDto: An account of the calling organization, as returned by the user-administration endpoints (`GET /api/v1/users/{id}`, `POST /api/v1/users`, `PATCH /api/v1/users/{id}`). Never carries a password, hash or security stamp.
  - `id` string: User id (string GUID). Example: `"8f0c3c1e-2b6d-4c55-9a51-0d3f3c1b7e21"`.
  - `email` string, nullable: Login e-mail address. Example: `"sam@example.com"`.
  - `firstName` string, nullable: First name. Example: `"Sam"`.
  - `lastName` string, nullable: Last name. Example: `"Carter"`.
  - `displayName` string: Display name, e.g. `"Sam Carter"`; falls back to the e-mail address when no name is recorded.
  - `isActive` boolean: False when the account is deactivated (it cannot sign in and holds no seat).
  - `role` string, nullable: Highest standard role the account holds — `OrganizationAdmin`, `Manager` or `User` (`SystemAdmin` for platform staff); null when it holds only custom roles.
  - `customRoleIds` integer[]: Ids of the custom roles the account holds (see `/api/v1/roles`). Empty when none.
  - `permissions` string[]: Effective permissions from all of the account's roles, in catalog order. Example: `["ViewInventory", "ViewJobs"]`.

## Other responses

- `400`: Missing `Idempotency-Key`.
- `401`: Unauthorized
- `403`: A hierarchy rule refused it (an Organization Admin needs a removal request).
- `404`: No such user in this organization.
- `409`: The key's creator is unknown on this server, or it would remove the organization's last active Organization Admin.
- `429`: Too Many Requests
- `502`: The sync server answered with an unexpected error.
- `503`: This server cannot reach the sync server; nothing was changed.

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
