# OpenReplay

> Query OpenReplay session replay and analytics - list projects, search sessions, and read session detail, user sessions, and events.

Lets an agent query your OpenReplay session-replay data: list projects, search recorded sessions with filters, fetch a single session, list a user's sessions, and read a session's event timeline. Most calls take a `project_id` from `openreplay_projects_list`.

## What it can do

| Method | What it does |
| --- | --- |
| `openreplay_projects_list` | List projects - returns the project ids/keys every other call needs. |
| `openreplay_sessions_search` | Search sessions in a project with filters, date range, sort, and pagination. |
| `openreplay_session_get` | Get one session by id (metadata and replay info). |
| `openreplay_user_sessions` | List the sessions for a given userId. |
| `openreplay_session_events` | Get a session's event timeline (clicks, page views, errors, etc.). |
| `openreplay_request` | Generic passthrough to any OpenReplay endpoint for full API coverage. |

## How to get credentials

1. Sign in to your OpenReplay instance (managed cloud at [app.openreplay.com](https://app.openreplay.com), or your self-hosted URL).
2. Open **Preferences → Account**.
3. Copy the **Organization API key**.
4. Paste it into FlyMyAI. The key is sent as a raw `Authorization` header (no `Bearer` prefix). If you self-host OpenReplay, also set `OPENREPLAY_BASE_URL` to your instance's API base (for example `https://openreplay.example.com/api`).

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `OPENREPLAY_API_KEY` | OpenReplay → Preferences → Account → Organization API key |
| `OPENREPLAY_BASE_URL` | Optional - self-hosted only. Default `https://api.openreplay.com` for OpenReplay managed cloud |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the key is wrong or you are pointing at the wrong host. Re-copy the Organization API key, and on self-hosted set `OPENREPLAY_BASE_URL`.
- **`404 Not Found` on a sessions call** - the `project_id` is wrong. Call `openreplay_projects_list` first and use one of the returned ids.
- **Self-hosted calls fail with a connection error** - the default base is the managed cloud. Set `OPENREPLAY_BASE_URL` to your own instance's API base.

## Links

- [OpenReplay API reference](https://docs.openreplay.com/en/api/)
- [OpenReplay docs](https://docs.openreplay.com/)
