:::endpoint PUT /v1/admin/tickets/{ticket}/ai-block

Blocking takes the `/ai` command away from the trader, so they cannot switch
the assistant back on for this ticket. Use it when somebody keeps flipping the
conversation back to the assistant, or when a case is too delicate for it.

Blocking a ticket the assistant is still answering hands it to the team on the
spot: the assistant goes off, the ticket moves to `awaiting_admin`, and the
trader reads a line in the thread saying so, with the event `ai_blocked`.

Allowing it again only gives the trader the command back. It does not switch
the assistant on. The team's own [request for a reply](/docs/api/admin/ticket-ai)
works either way: the block is about who may call the assistant in.

Answers with the [ticket](/docs/api/admin/ticket), with `ai_blocked` and
`ai_enabled` as they are now.

Needs a firm. Our own staff name one with the `Propper-Workspace` header.

## Request

| Field     | Description |
| --------- | ----------- |
| `blocked` | `true` to block, `false` to allow. Required |

```bash
curl -X PUT "https://api.proppertrading.com/v1/admin/tickets/tkt_cbqjrnz84cq45ca7/ai-block" \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Propper-Workspace: acme" \
  -H "Content-Type: application/json" \
  -d '{"blocked": true}'
```

## Response

The [ticket](/docs/api/admin/ticket), now with `"ai_blocked": true`.

## Errors

| Status | Code                      | Meaning                                                                         |
| ------ | ------------------------- | ------------------------------------------------------------------------------- |
| 400    | `workspace_required`      | Asked by our own staff without naming a firm                                    |
| 401    | `invalid_token`           | Not a token, or the secret does not match                                       |
| 401    | `revoked_token`           | Signed out here or from another device                                          |
| 401    | `expired_token`           | Ninety days without use, or a set expiry passed                                 |
| 403    | `admin_access_required`   | This account no longer helps run the environment                                |
| 403    | `insufficient_scope`      | This device does not hold `admin:write`                                         |
| 403    | `workspace_not_permitted` | The `Propper-Workspace` header names an environment this account cannot act in |
| 403    | `forbidden`               | Without `view_tickets` and `manage_tickets`                                     |
| 404    | `resource_not_found`      | No ticket with that id in this firm                                             |
| 409    | `ticket_ended`            | The ticket was resolved or closed                                               |
| 422    | `validation_failed`       | No `blocked`, or not a boolean                                                  |