# Capture the event cursor for one app

Capture the current event cursor for one app before reading its snapshots, then replay from it. Cursors are bound to the organization, the app and the threadId, runId and types filters.

`GET /api/platform/v1/apps/{appId}/events/head`

Required permission: `thread:read`.

## Parameters

| Name | In | Type | Required | Description |

| --- | --- | --- | --- | --- |

| `threadId` | query | `string` | No | Only this thread's events. |

| `runId` | query | `string` | No | Only this run's events. |

| `types` | query | `string` | No | Comma-separated event types, at most 30. Reuse identical filters with a returned cursor. |

| `appId` | path | `string` | Yes | — |

## Example request

```bash
curl --request GET \
  --url https://api.hoplite.sh/api/platform/v1/apps/appId/events/head \
  --header "X-Api-Key: $HOPLITE_API_KEY"
```

## 200 response

Success

Content type: `application/json`. Response type: `object`.

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `ok` | `boolean` | Yes | true | — |
| `cursor` | `string` | Yes | — | — |

```json

```

## Status codes

- `200` — Success

- `400` — Invalid request

- `401` — Authentication required

- `403` — Permission, app scope or entitlement denied

- `404` — App, source or thread not found

- `409` — Idempotency conflict or request in progress

- `410` — Event cursor expired

- `413` — Request too large

- `503` — Source storage or execution unavailable