> For the complete documentation index, see [llms.txt](https://docs.mobiusflow.com/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mobiusflow.com/help/mobiusflow-v3/mobiusflow-historian-websocket.md).

# MobiusFlow Historian Websocket

Usage of MobiusFlow Historian Websocket

The Historian websocket is a data interface which runs on top of the MobiusFlow Historian Data API on all MobiusFlow Historians.&#x20;

The websocket allows you to listen to real-time incoming data updates on MobiusFlow historian. This avoids the requirement to query recent historical data via the Historian Data API to extract the most recent data.

Before using the Historian Websocket we recommend you're familiar with the following:

* [Historian](/help/mobiusflow-v3/mobiusflow-historian.md)
* [Historian API](/help/mobiusflow-v3/mobiusflow-historian-data-api-v3.md)

## Connection Endpoint

Websocket connection endpoint exists on the MobiusFlow Historian Data API:

```
(GET)
/api/engine/v3/ws/connect
```

On initial connection, no authorization is required. This means you do not need to include any token within the request body or headers.

## Authorization

Once the initial websocket connection is made, the server will expect a follow up authorization message within 30 seconds in the following format:

```json
{
    "topic": "authorize",
    "payload": "8e100e7bef9898963477f2c8a89eeed"
}
```

Where the the payload is a valid [api key generated via MobiusFlow View](#creating-an-api-key).&#x20;

If no authorization call is received by the server, the connection will be dropped. Following successful authorization, the websocket will automatically push all data updates.

### Creating an API Key

To add this, click your user tag within MobiusFlow View, then click **Manage Data API Keys**:

<figure><img src="https://241296614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQoV8xVJhcESUhdKQWDcm%2Fuploads%2FnbJDI8eU3lGuYNsUxb9c%2Fimage.png?alt=media&amp;token=04213069-92c1-4d38-9825-1ff8446c9a6f" alt=""><figcaption></figcaption></figure>

Then within Data API Key Management, click **Add Key**:

<figure><img src="https://241296614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQoV8xVJhcESUhdKQWDcm%2Fuploads%2FGFt7pZHFESbv6lkUOra6%2Fimage.png?alt=media&amp;token=83c67a5a-478b-4230-acba-550ca2278cf4" alt=""><figcaption></figcaption></figure>

Once you create a key, ensure you copy it for usage as it will not be revealed again.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.mobiusflow.com/help/mobiusflow-v3/mobiusflow-historian-websocket.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
