# Sentry

> Query error monitoring data from Sentry. List the most common error types, inspect individual issues, and break errors down by tags like browser, release, and environment.

Source: https://cotera.co/docs/reference/tools/individual-tools/sentry

---

**Authentication Type:** API Key
**Description:** Query error monitoring data from Sentry. List the most common error types, inspect individual issues, and break errors down by tags like browser, release, and environment.

***

## Authentication

To connect Sentry you'll need:

1. **Auth Token** — create an [organization auth token](https://docs.sentry.io/account/auth-tokens/) in Sentry under **Settings → Auth Tokens** (or use an internal integration token). It needs the `event:read` scope.
2. **Organization Slug** — the slug in your Sentry URL, e.g. `my-org` in `https://my-org.sentry.io`.
3. **Base URL** (optional) — only needed for EU-region orgs (`https://de.sentry.io`) or self-hosted Sentry. Defaults to `https://sentry.io`.

> Cotera also supports Sentry as a **webhook trigger** — workflows can fire when Sentry issues are created or resolved. These tools complement that by letting agents query Sentry on demand.

***

## Issues

In Sentry, an "issue" is a deduplicated group of similar errors — so listing issues is how you get common error types.

### List Issues

List error issues in a Sentry organization. Sort by `freq` to get the most common error types, or `user` for the errors affecting the most users.

**Operation Type:** Query (Read)

**Parameters:**

* **query** `string` (nullable): Sentry search query, e.g. `is:unresolved error.type:TypeError release:1.2.3`. Defaults to `is:unresolved`
* **sort** `string` (nullable): Sort order: `freq` (most frequent), `user` (most users affected), `new`, `date` (default), or `trends`
* **statsPeriod** `string` (nullable): Time window for stats, e.g. `24h` (default) or `14d`
* **project** `string` (nullable): Comma-separated Sentry project IDs to filter by
* **environment** `string` (nullable): Environment name to filter by, e.g. `production`
* **limit** `number` (nullable): Maximum number of issues to return (max 100)

**Returns:**

* **issues** `array of objects`: The matching issues (grouped error types)
  * **id** `string`: The issue ID
  * **shortId** `string` (nullable): Human-readable short ID, e.g. `MY-PROJECT-42`
  * **title** `string`: The error title
  * **culprit** `string` (nullable): The code location that caused the error
  * **level** `string` (nullable): Severity level, e.g. `error`, `warning`, `fatal`
  * **status** `string` (nullable): Issue status, e.g. `unresolved`, `resolved`, `ignored`
  * **count** `number` (nullable): Number of events in this group
  * **userCount** `number` (nullable): Number of users affected
  * **firstSeen** `string` (nullable): When the error was first seen
  * **lastSeen** `string` (nullable): When the error was last seen
  * **permalink** `string` (nullable): Link to the issue in Sentry
  * **projectSlug** `string` (nullable): The project the issue belongs to
  * **errorType** `string` (nullable): The exception type, e.g. `TypeError`
  * **errorValue** `string` (nullable): The exception message

**Example Usage:**

```json
{
  "query": "is:unresolved",
  "sort": "freq",
  "statsPeriod": "14d",
  "environment": "production",
  "limit": 10
}
```

### Get Issue

Get the details of a single Sentry issue.

**Operation Type:** Query (Read)

**Parameters:**

* **issueId** `string` (required): The Sentry issue ID (numeric ID, not the short ID)

**Returns:**

The same fields as a single issue from List Issues (id, shortId, title, culprit, level, status, count, userCount, firstSeen, lastSeen, permalink, projectSlug, errorType, errorValue).

**Example Usage:**

```json
{
  "issueId": "6789012345"
}
```

### Get Issue Tags

Get tag facets for an issue — the most common values for tags like browser, OS, release, and environment among the issue's events.

**Operation Type:** Query (Read)

**Parameters:**

* **issueId** `string` (required): The Sentry issue ID (numeric ID, not the short ID)
* **environment** `string` (nullable): Environment name to filter by, e.g. `production`

**Returns:**

* **tags** `array of objects`: Tag facets for the issue
  * **key** `string`: The tag key, e.g. `browser`, `release`
  * **name** `string` (nullable): Display name for the tag
  * **totalValues** `number` (nullable): Total number of tagged events
  * **topValues** `array of objects`: The most common values for this tag
    * **value** `string`: The tag value, e.g. `Chrome 126.0`
    * **count** `number` (nullable): Number of events with this value

**Example Usage:**

```json
{
  "issueId": "6789012345",
  "environment": "production"
}
```

## Common Use Cases

**Error Triage:**

* Get the top 10 most frequent errors in production over the last two weeks
* Find the errors affecting the most users after a release
* Check whether a newly reported error is a known recurring issue

**Release Monitoring:**

* Compare error frequency before and after a deploy with `statsPeriod`
* Filter issues by `release:x.y.z` to see what a release introduced
* Break an issue down by release tag to find when it started

**Automated Workflows:**

* Pair with the Sentry webhook trigger: when a new issue fires, look up its frequency and tags, then route high-impact errors to Slack or Linear
* Generate weekly error digests summarizing the most common error types
* Enrich support tickets with the Sentry issues matching a customer's errors

