<!-- https://developers.silktide.com/v1/concepts/context | Concepts -->

# Context

A report has a **context**: what it reports on. Its type is `contextTypeId`, and the details are in `context`. The two you will meet most:

| `contextTypeId` | Reports on |
| --- | --- |
| `website` | One website, or one section of it. |
| `websites` | Several websites, chosen by tags or by a list. |

Report templates and report schedules carry a context the same way, and a report made from a template starts with the template's type. Reports can also have the types `account` (the whole account) and `property` (Analytics), and an empty type for reports that need no context.

## Website

```json
{ "websiteId": 3, "sectionId": 0 }
```

| Field | What it is |
| --- | --- |
| `websiteId` | The website. Required. |
| `sectionId` | One of its sections. Defaults to `0`, the whole website. See [Websites and sections](https://developers.silktide.com/v1/concepts/websites-and-sections.md). |

## Websites

The websites are chosen by `criteria`. With no criteria, the context is every website the API key's user can see.

Every website and section with both the `pre-production` and `wordpress` tags:

```json
{ "criteria": { "tagIds": ["pre-production", "wordpress"], "tagOperator": "and" } }
```

These websites and sections, by [subsite id](https://developers.silktide.com/v1/concepts/websites-and-sections.md#subsite-ids):

```json
{ "criteria": { "subsiteIds": ["2-0", "3-0", "3-2"] } }
```

| Field | What it is |
| --- | --- |
| `tagIds` | Websites and sections with these [tags](https://developers.silktide.com/v1/platform/tags.md). |
| `tagOperator` | `or` (the default) for any of the tags, `and` for all of them. |
| `subsiteIds` | These websites and sections. When you send both, `subsiteIds` wins and `tagIds` is ignored. |

Tags pick websites and sections as they are tagged when the report is read, so a report on a tag follows the websites as you tag and untag them.

## Widgets with a context of their own

A report is made of widgets, and each one reports on the report's context. A widget can instead be locked to a context of its own, such as one website: then it reports on that website whatever the report's context is. Silktide shows these widgets with a padlock.
