# Read an issue's events

Read an issue's latest event in full, step through its other events, and fetch one event by its id.

An event is kept as the SDK sent it, with its stack trace source-mapped, for the project's
retention. Replace _issue-id_ with the issue's short id or number, _project-id_ with the project's
id and _event-id_ with an event id (32 hexadecimal characters).

## Prerequisites

- Permission for `errors:GetEvents` on the project. Without it, an issue's page says "You can see
  this issue but not its events." and its **Events** tab says "Reading events needs
  errors:GetEvents on the project."
- In the console, also `errors:ListIssues` on the project to open an issue (without it the issue is
  not found).

## Read the events

**Console**
1. Open the issue. The **Details** tab shows its latest event: **Event id**, **Happened**,
   **Environment**, **Release**, **Transaction**, **SDK**, **Trace**, **Profile** and **Stored**,
   the **Stack trace** (the outermost exception first, its frames newest first), **Breadcrumbs**,
   **Tags**, **User** and the **Raw event**. **Request**, **Additional data** and **Attachments**
   appear when the event carries them.
2. (Optional) Turn on **Only my code** to hide library frames.
3. (Optional) Choose **Oldest**, **Older**, **Newer** or **Latest** to step through the issue's
   events.
4. (Optional) Open the **Events** tab for the issue's latest 500 events, then choose one.

Under **Trace**, the trace id opens the event's trace when the SDK sent one (see
[View traces and transactions](view-traces-and-transactions.md)); under **Profile**,
**Flame graph** opens the flame graph of the transaction it happened in, when that transaction
was profiled.

**CLI**
```sh
dcloud errors events latest issue-id
dcloud errors events list issue-id --limit 50
dcloud errors events get project-id event-id
```

**API**
```http
GET /errors/api/issues/issue-id/events/latest
```

```http
GET /errors/api/issues/issue-id/events?limit=50
```

```http
GET /errors/api/projects/project-id/events/event-id
```

`latest` and `get` answer `row` (the event's fields), `event` (the event as the SDK sent it) and
`attachments`. `list` answers the events newest first, without their payload, 25 per page by
default (`limit` 1–100); pass the last `receivedAt` as `before` for the next page. Without
`errors:GetEvents` each answers `403`; an issue or event that does not exist answers `404`.

## Result

An issue whose events are all past the project's retention says "No stored event for this issue."
In the API, `latest` then answers `404`.

## Related

- [Find and triage issues](triage-issues.md)
- [Upload source maps](upload-source-maps.md)
- `errors.events.latest` · `dcloud errors events get`
