:::endpoint POST /v1/admin/support-teams

A new [support team](/docs/api/admin/support-teams): a name, and the agents on
it. The agents to pick from are the `agents` of the
[ticket options](/docs/api/admin/ticket-options).

The members are checked as a whole. One that is not among the firm's agents
refuses the save, rather than being dropped from the team without anyone
noticing.

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

## Request

| Field        | Description |
| ------------ | ----------- |
| `name`       | Up to 100 characters, unique within the firm. Required |
| `member_ids` | The `id` of every agent on the team, up to 200. Required, and may be empty |

```bash
curl -X POST "https://api.proppertrading.com/v1/admin/support-teams" \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Propper-Workspace: acme" \
  -H "Idempotency-Key: 6c8e0a2b-4d6f-4a8c-9e0b-2d4f6a8c0e2b" \
  -H "Content-Type: application/json" \
  -d '{"name": "Platform desk", "member_ids": ["usr_afekquw8p97wv6tb", "usr_58rb28huxg3h5vv3"]}'
```

## Response

`201`, with the team:

```json
{
    "data": {
        "object": "support_team",
        "id": "team_xmwh3fde7wym7xkj",
        "name": "Platform desk",
        "members": [
            {
                "id": "usr_afekquw8p97wv6tb",
                "name": "Sam Carter"
            },
            {
                "id": "usr_58rb28huxg3h5vv3",
                "name": "Waldo Hansen"
            }
        ],
        "open": 0,
        "mine": false
    },
    "meta": {
        "request_id": "req_01m50v19nncp16d8kn6xwejqe6"
    }
}
```

## Errors

| Status | Code                      | Meaning                                                                         |
| ------ | ------------------------- | ------------------------------------------------------------------------------- |
| 400    | `workspace_required`      | Asked by our own staff without naming a firm                                    |
| 400    | `missing_idempotency_key` | A POST without an `Idempotency-Key` header                                      |
| 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 `manage_support_settings`                                               |
| 422    | `validation_failed`       | No `name`, a name the firm already has, no `member_ids`, more than 200, or a member who is not one of the firm's agents |