:::endpoint PUT /v1/admin/tickets/{ticket}/assign

Who on the team holds the ticket: an agent, a [team](/docs/api/admin/support-teams),
both, or nobody. Only the fields you send change, so the agent and the team can
be set apart. Send one as null to clear it. A ticket given to a team counts as
"mine" for everybody on it.

Giving a ticket that waits for the team to somebody new tells them with the
bell. The trader never hears who holds their ticket.

The agents and teams to pick from are the [options](/docs/api/admin/ticket-options).

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

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

## Request

| Field      | Description |
| ---------- | ----------- |
| `admin_id` | The `id` of one of the firm's agents, or null for no agent. Left out, the agent stays |
| `team_id`  | The `id` of one of the firm's teams, or null for no team. Left out, the team stays |

```bash
curl -X PUT "https://api.proppertrading.com/v1/admin/tickets/tkt_cbqjrnz84cq45ca7/assign" \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Propper-Workspace: acme" \
  -H "Content-Type: application/json" \
  -d '{"admin_id": "usr_afekquw8p97wv6tb", "team_id": "team_cmhg8847tuqg3mq6"}'
```

## Response

The [ticket](/docs/api/admin/ticket), held now by Sam Carter on the Payouts desk.

## 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`       | `admin_id` is not one of the firm's agents, a trader for instance, or `team_id` is not one of its teams. Nothing changes |