---
title: "Poll Cli Event"
method: GET
path: "/api/webhooks/cli-session/events"
tags: ["cli-sessions"]
---

# Poll Cli Event

`GET /api/webhooks/cli-session/events`

## Request

- Base URL: `https://zsign.io` (the document declares no server; this is the origin it was published from)
- URL: `https://zsign.io/api/webhooks/cli-session/events`
- Auth: HTTP bearer

Long-poll for the oldest unacked event; 204 when none arrives in time.

`async def` with every DB call in a threadpool, NOT a plain `def`: a sync
route would occupy one of the threadpool's workers for the whole wait,
and -- worse -- hold its pooled DB connection the entire time. The engine
is sized pool_size=5, max_overflow=10 (core/database.py), so fifteen
simultaneous listeners would starve every other request in the process.
Between polls the session is rolled back, which returns its connection to
the pool and starts a fresh READ COMMITTED snapshot, so newly committed
events actually become visible.

## Query parameters

- `wait` integer

## Headers

- `X-ZSign-Listener-Id` string

## Response `200`

Successful Response

- CliEventResponse
  - `event_id` string, uuid, required
  - `type` string, required
  - `payload` object, required

## Other responses

- `204`: No event within the wait window
- `422`: Validation Error

---

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