---
title: "Wait with a cursor for an event (up to 30 seconds)"
method: POST
path: "/api/wait"
---

# Wait with a cursor for an event (up to 30 seconds)

`POST /api/wait`

## Request

- Base URL: `https://openhook.dev`
- URL: `https://openhook.dev/api/wait`
- Auth: none declared

Use since=0 initially, then data.next_since after successful processing. Returns data.request (event or null), data.next_since, and data.timeout. This is an outbound long poll; it does not wake a stopped agent session.

## Request body

- WaitCall
  - `token` string, required
  - `since` integer
  - `timeout_seconds` number

## Response `200`

Successful response. call/wait wrap the result in data; export returns requests.

- Success
  - `success` unknown, required
  - `data` object, required

## Other responses

- `400`: Invalid request
- `401`: Invalid private token
- `403`: Cross-origin request rejected
- `404`: Inbox expired or not found
- `405`: Request could not be completed; read resolution before retrying.
- `413`: Request body exceeds limit
- `429`: Rate or inbox limit reached; honor Retry-After when present
- `500`: Request could not be completed; read resolution before retrying.
- `503`: Request could not be completed; read resolution before retrying.

---

[API](https://skmtc.dev/openhook/apis/openhook-native-api.md) · [All operations](https://skmtc.dev/openhook/apis/openhook-native-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openhook/apis/openhook-native-api/revisions/d0fc1502ffb8?raw)
