---
title: "The task's events as Server-Sent Events"
url: https://hexelstudio.com/docs/api/harness/streams/the-task-s-events-as-server-sent-events
---

# The task's events as Server-Sent Events

**GET** `/harness/tasks/{id}/events`

Stored events from `after` (or `Last-Event-ID`), then live ones, until the task is final;
then an `end` event. Each event's `event:` is its type and `data:` a `TaskEvent`; live
`message.delta` and `event.content` chunks are not stored and carry no id. At most 200 open
streams per organization (`429 too_many_streams`).


## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for your organization.

- `X-Workspace-Id: string`

  The workspace the request acts in (`ws_...`). It never grants access by itself.

- `X-Environment-Id: string`

  The environment the request acts in (`env_...`). It never grants access by itself.

## Returns

`200` 

## Errors

- `default` 

## Example

```bash
curl --request GET \
  --url 'https://api.hexelstudio.com/v1/harness/tasks/{id}/events' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'X-Workspace-Id: X_WORKSPACE_ID' \
  --header 'X-Environment-Id: X_ENVIRONMENT_ID'
```
