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

# Disable user

## Integration Notes

1. **What Happens**: The user is marked as disabled in the database, their roles are downgraded to `member`, and their Cognito account is disabled.
2. **Authorization**: Requires `update:user` scope.
3. **Idempotent**: If the user is already disabled, the endpoint returns 200 with a message indicating the user is already disabled.

## Request

No request body is required. Simply send a request to the endpoint with the organization and user IDs in the path.

```bash theme={null}
PUT /v1/organizations/{organizationId}/users/{userId}/disable
```

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "statusCode": 200,
  "message": "User disabled successfully",
  "data": {
    "user_id": "a7748dfd-ceb2-4b17-8380-425c304f5ae7"
  },
  "timestamp": "2024-01-15T10:30:00.000Z",
  "requestId": "req_1705312200000_abc123"
}
```

### Already Disabled (200 OK)

```json theme={null}
{
  "success": true,
  "statusCode": 200,
  "message": "User is already disabled",
  "data": {
    "user_id": "a7748dfd-ceb2-4b17-8380-425c304f5ae7"
  },
  "timestamp": "2024-01-15T10:30:00.000Z",
  "requestId": "req_1705312200000_abc123"
}
```

## Response Fields

### Success Response Data

| Field     | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| `user_id` | string | Parchment's unique user identifier |

### Common Response Fields

All responses include these standard fields:

| Field        | Type    | Description                             |
| ------------ | ------- | --------------------------------------- |
| `success`    | boolean | Indicates if the request was successful |
| `statusCode` | number  | HTTP status code                        |
| `timestamp`  | string  | ISO 8601 timestamp of the response      |
| `requestId`  | string  | Unique identifier for debugging         |

## Status Codes

| Code  | Status                | Description                                          |
| ----- | --------------------- | ---------------------------------------------------- |
| `200` | OK                    | User successfully disabled (or already disabled)     |
| `401` | Unauthorized          | Authentication required or token invalid             |
| `403` | Forbidden             | Insufficient permissions (missing delete:user scope) |
| `404` | Not Found             | User not found                                       |
| `500` | Internal Server Error | Unexpected server error                              |
