# POST /v2/stream/ticket

Group: WebSocket

Issues a one-time ticket for opening a connection, valid for 30 seconds. The call is authenticated, rate-limited and counted against your usage exactly like any other /v2 request, and it takes no request body.

Plans: Requires Business or Enterprise; on a lower plan the ticket request returns 403 ws_not_available. The tracking:{id} channel needs Enterprise and is refused on Business with channel_forbidden.

## Response

- `data`: `{ ticket: string; url: string; expiresInSeconds: number }`

## Errors

- 403 ws_not_available — WebSocket access is not part of your plan

Plus the common errors (https://datasportsapi.com/markdown/docs.md#errors).

## Request

cURL:

```bash
curl -X POST -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/v2/stream/ticket"
```

## Example response

```json
$ curl -X POST -H "Authorization: Bearer sk_live_…" https://api.datasportsapi.com/v2/stream/ticket

{ "data": { "ticket": "8373e1…", "url": "wss://api.datasportsapi.com/?ticket=8373e1…", "expiresInSeconds": 30 } }
```

---

Base URL: https://api.datasportsapi.com. Authenticate each /v2 call with the header `Authorization: Bearer <key>` (secret keys begin with `sk_live_`).
HTML: https://datasportsapi.com/docs/websocket/stream-ticket/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
