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

# Team coverage

> Which event types or whole categories of your catalog a team answers.

A team covers specific event types of your [catalog](/api-reference/event-types.md), or whole categories (every type in the category, including types added later). Only teams that cover the type of an event are candidates for its dispatch; a team that covers nothing is never a candidate. Coverage is set per team, within the team's vertical.

## Authentication

Session token (`Authorization: Bearer <token>`).

| Operation | Permission | Tenant roles with it |
| - | - | - |
| Read coverage | `teams:view` | `company_admin`, `company_tech`, `operational_supervisor`, `corporate_client` |
| Set coverage | `teams:manage` | `company_admin`, `company_tech` |

> [!WARNING]
>
> The integration API key (`x-wede-api-key`) has no `teams:*` permission. Calls with an API key return `403 forbidden`.

## Read coverage

```http theme={null}
GET /v1/teams/{id}/coverage
```

```bash theme={null}
curl https://api.wede.pt/v1/teams/259edc6e-95f3-42ba-bac5-263cfe51ebc0/coverage \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
```

```json Response 200 theme={null}
{
  "data": [
    { "category_id": "1c7d2a0e-5b3f-4e8a-9d61-2f4b7c9e0a13", "event_type_id": null },
    { "category_id": "2d8e3b1f-6c4a-4f9b-8e72-3a5c8d0f1b24", "event_type_id": "6f8a0c2e-4b6d-4f1a-8c3e-5a7c9e1b3d5f" }
  ]
}
```

An item with `event_type_id: null` covers the whole category; an item with an `event_type_id` covers that type only.

## Set coverage

```http theme={null}
PUT /v1/teams/{id}/coverage
```

Replaces the team's coverage with the items you send.

**items** `object[]` *required*

Up to 200 items, each with `category_id` (a category of the team's vertical) and, to cover one type only, `event_type_id` (a type of that category). Omit `event_type_id`, or send `null`, to cover the whole category.

```bash theme={null}
curl -X PUT https://api.wede.pt/v1/teams/259edc6e-95f3-42ba-bac5-263cfe51ebc0/coverage \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "items": [ { "category_id": "1c7d2a0e-5b3f-4e8a-9d61-2f4b7c9e0a13" } ] }'
```

Returns `200` with `{ "data": [ ... ] }`, the stored coverage. The change is written to the audit log.

The equipment and qualifications a type calls for are not part of coverage: a covering team that lacks them is still a candidate, with a lower score (see [Dispatch score](/api-reference/teams/score.md)). Give teams their equipment with [Team equipment](/api-reference/teams/equipment.md).

## Errors

| Status | `error` | When |
| - | - | - |
| `400` | `validation_error` | `items` is missing or malformed. |
| `401` | `unauthorized` | Missing, invalid or expired credentials. |
| `403` | `forbidden` | Your role lacks the permission, or you used an API key. |
| `404` | `not_found` | The team is not a team of your tenant. |
| `422` | `unknown_category` | A `category_id` is not a category of the team's vertical. |
| `422` | `unknown_event_type` | An `event_type_id` is not a type of that category. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.