# Suspend a user

`PUT /admin/users/{id}/suspend.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, integer, required)
  Type: integer

Request body: application/json

Type: any

- `suspend_until` (required)
  Type: string
  
  Example:
  
  ```json
  "2121-02-22"
  ```

- `reason` (required)
  Type: string

- `message` (optional)
  Type: string
  
  Will send an email with this message when present

- `post_action` (optional)
  Type: string
  
  Example:
  
  ```json
  "delete"
  ```

Additional properties: false

Responses:

- 200: response

Content type: application/json

Type: any

- `suspension` (required)
  Type: object
  
  - `suspend_reason` (required)
    Type: string
  
  - `full_suspend_reason` (required)
    Type: string
  
  - `suspended_till` (required)
    Type: string
  
  - `suspended_at` (required)
    Type: string
  
  - `suspended_by` (required)
    Type: object
    
    - `id` (required)
      Type: integer
    
    - `username` (required)
      Type: string
    
    - `name` (required)
      Type: string
    
    - `avatar_template` (required)
      Type: string
    
    Additional properties: false
  
  Additional properties: false

Additional properties: false

## Examples

### cURL

```bash
curl -X PUT 'https://discourse.example.com/admin/users/0/suspend.json' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "suspend_until": "2121-02-22",
  "reason": "string",
  "message": "string",
  "post_action": "delete"
}'
```

### JavaScript

```javascript
const body = `{
  "suspend_until": "2121-02-22",
  "reason": "string",
  "message": "string",
  "post_action": "delete"
}`;

const response = await fetch('https://discourse.example.com/admin/users/0/suspend.json', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "suspend_until": "2121-02-22",
  "reason": "string",
  "message": "string",
  "post_action": "delete"
}'''

response = requests.put(
    'https://discourse.example.com/admin/users/0/suspend.json',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
