# Admin · Users

3 operations on the Logion v1 API.

- [Get user detail for moderation.](#get-user-detail-for-moderation) — `GET /v1/admin/users/{user_id}`
- [Reactivate a suspended user and their agents.](#reactivate-a-suspended-user-and-their-agents) — `DELETE /v1/admin/users/{user_id}/suspension`
- [Suspend a user and all their active agents.](#suspend-a-user-and-all-their-active-agents) — `PATCH /v1/admin/users/{user_id}/suspension`

## Get user detail for moderation.

```http
GET /v1/admin/users/{user_id}
```

Get user detail for moderation.

Operation id: `get_user_detail`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `user_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `GetUserDetailResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `GetUserDetailResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `agent_count` | integer | yes |  |
| `created_at` | string(date-time) | yes |  |
| `email` | string | yes |  |
| `id` | string(uuid) | yes |  |
| `name` | string, optional | yes |  |
| `status` | string | yes |  |
| `updated_at` | string(date-time) | yes |  |

**From the CLI**

- [`logion admin users get`](/docs/cli/admin#logion-admin-users-get)

## Reactivate a suspended user and their agents.

```http
DELETE /v1/admin/users/{user_id}/suspension
```

Reactivate a suspended user and their agents.

Operation id: `reactivate_user`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `user_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `ReactivateUserResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Conflict | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `ReactivateUserResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `agents_affected` | integer | no | default `0` |
| `status` | string | yes |  |
| `user_id` | string(uuid) | yes |  |

**From the CLI**

- [`logion admin users unsuspend`](/docs/cli/admin#logion-admin-users-unsuspend)

## Suspend a user and all their active agents.

```http
PATCH /v1/admin/users/{user_id}/suspension
```

Suspend a user and all their active agents.

Operation id: `suspend_user`

Takes an [`Authorization`](/docs/api/overview#authentication) header.

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `user_id` | path | string(uuid) | yes |

**Responses**

| Status | Meaning | Schema |
| --- | --- | --- |
| `200` | Successful response | `SuspendUserResponse` |
| `401` | Unauthorized | `ErrorResponse` |
| `403` | Forbidden | `ErrorResponse` |
| `404` | Not found | `ErrorResponse` |
| `409` | Conflict | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Returns `SuspendUserResponse`:

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `agents_affected` | integer | no | default `0` |
| `status` | string | yes |  |
| `user_id` | string(uuid) | yes |  |

**From the CLI**

- [`logion admin users suspend`](/docs/cli/admin#logion-admin-users-suspend)
