# Concepts

> The seven objects: portal, connection, connect window, challenge, operation, run and event.

Seven words. Each means one thing, and the API, the console, the events and these docs use the same one.

| Object | What it is | Id |
|---|---|---|
| **Portal** | A website your users sign in to that has no API. We build and keep a connector for each one. [List them](https://sidelatch.com/docs/api#ref-get-v1-portals). | `demo_carrier` |
| **Connection** | One user's login to one portal, stored encrypted and kept signed in. It is `connected` or `reconnect_needed`, with a `reason`. | `conn_...` |
| **Connect window** | Our sign-in window, opened over your page by `link.js` with a single-use link token. The password goes from the user to us and never through your code. | link token |
| **Challenge** | A step the portal asks for during sign-in: a code, a choice, a phone approval, security questions or a CAPTCHA. The user answers it. [Format and limits](https://sidelatch.com/docs/guides/connect-window#challenges). | `challenge.type` |
| **Operation** | A named read or write a portal offers, with typed params and a typed result. Every portal of a kind offers the same ones. | `list_policies` |
| **Run** | One execution of an operation on a connection: what was asked, how it ended, how long it took and the steps taken. [Every call makes one](https://sidelatch.com/docs/concepts#runs). | `run_...` |
| **Event** | Something that happened: a connection changed, a sign-in needed a step, an async run finished. Listed by the API and sent to your webhook. [All types](https://sidelatch.com/docs/events#events). | `evt_...` |

Every list is newest first and takes `limit` (up to 100) and `cursor`; it returns `data`, `has_more` and `next_cursor`. Every response carries a `Sidelatch-Request-Id` header. Send us that id when something looks wrong.

## Reading data

Call [`run`](https://sidelatch.com/docs/api#ref-post-v1-connections-conn-id-run) with an operation name. [`GET /v1/portals`](https://sidelatch.com/docs/api#ref-get-v1-portals) lists each portal's operations and example params. Results are validated before you get them, so a changed portal shows up as an error, never as bad data.

Connectors read the portal's backend calls, not its pages, so a redesign or new layout changes nothing you receive. When the backend itself changes, we notice: each response's shape (field names and types, never values) is fingerprinted. Common backend changes are repaired automatically: a renamed field, a field moved into a sub-object, numbers that start arriving as text ("$450,000"), and a list that starts arriving inside an envelope (`{"data": [...]}`). Each repair is checked against the schema before it is used, and our team is alerted; you keep getting the same shape. A change no repair fits (an endpoint that moved, a new sign-in flow) starts our re-capture pipeline and returns `schema_drift` until the regenerated connector ships.

Sessions are kept warm between calls. If the portal has logged the user out, we sign in again from the vault before running your call.

## Runs

Every call to an operation makes a run, whether it came from the API, an AI agent or one of our own checks. The response carries its `run_id`; look it up for 30 days.

**A run**

```json
{
  "id": "run_5d1e...",
  "object": "run",
  "connection_id": "conn_8f2c41d07a9b4e6f",
  "portal": "demo_carrier",
  "operation": "list_policies",
  "source": "api",
  "mode": "sync",
  "status": "completed",
  "error": null,
  "duration_ms": 412,
  "steps": [
    {
      "step": "session_expired"
    },
    {
      "step": "signed_in",
      "ms": 240
    },
    {
      "step": "portal_request",
      "method": "GET",
      "status": 200,
      "ms": 96
    }
  ],
  "created_at": "2026-11-26T15:04:05Z",
  "finished_at": "2026-11-26T15:04:05Z"
}
```

`status` is `queued`, `running`, `completed` or `failed`; a failed run's `error` is one of the [codes](https://sidelatch.com/docs/errors). `steps` say what we did: reused or restored a session, signed in again, and each request to the portal with its status and time. They hold names, timings and status codes only, never a URL or anything the portal returned.

### Async runs

A normal call answers when the portal does. For a slow operation or a batch, add `"async": true`: you get `202` with a queued run at once. Then wait for the `run.completed` or `run.failed` event, or poll [`GET /v1/runs/{run_id}`](https://sidelatch.com/docs/api#ref-get-v1-runs-run-id), which returns the result in `data` for a day.

### Deadlines

A read that has not finished in two minutes (sign-in included) fails with `timeout`; a write gets five. Nothing is retried for you after a timeout.

---

Sidelatch docs: [Docs](https://sidelatch.com/docs.md) · [Quick start](https://sidelatch.com/docs/quickstart.md) · [Concepts](https://sidelatch.com/docs/concepts.md) · [The connect window](https://sidelatch.com/docs/guides/connect-window.md) · [Webhooks](https://sidelatch.com/docs/guides/webhooks.md) · [MCP for AI agents](https://sidelatch.com/docs/guides/mcp.md) · [Writes](https://sidelatch.com/docs/guides/writes.md) · [Build a portal](https://sidelatch.com/docs/guides/build-a-portal.md) · [Events](https://sidelatch.com/docs/events.md) · [Errors](https://sidelatch.com/docs/errors.md) · [API reference](https://sidelatch.com/docs/api.md)
