# Websocket API

Use the websocket API for persistent, low-overhead integration traffic.

For frequent live-map location updates, prefer the websocket API over the HTTP v2 endpoint:

* Websocket `unitLocation` updates can be sent every `200ms` minimum. In practice, sending every `250ms` is a safe default.
* HTTP v2 `PATCH /v2/emergency/servers/{serverId}/unit-locations` is rate limited to `12 requests per minute`, which is effectively one request every `5 seconds`.

Current websocket API features include:

* Authenticating once and reusing the session for repeated calls
* Sending frequent `unitLocation` updates for the live map
* Receiving Sonoran CAD `pushEvent` messages for a specific `serverId`, including normal push-event traffic before HTTP listener fallback is used

## Pages

* [Authentication](/cad/api-integration/websocket-api/authentication.md)
* [Unit Locations](/cad/api-integration/websocket-api/unit-locations.md)
* [Push Events](/cad/api-integration/websocket-api/push-events.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonoransoftware.com/cad/api-integration/websocket-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
