# `MimirAnalytics.Ingest.GatewayPull`
[🔗](https://github.com/cash-mckeeman/mimir/blob/mimir_analytics-v0.8.1/mimir_analytics/lib/mimir_analytics/ingest/gateway_pull.ex#L1)

Pulls the gateway's read-only Observability API (`updated_since` cursor)
and buffers each page as run-record JSONL — the same line shapes the
gateway-export mapper ingests, so the buffer file is the contract wherever
the bytes came from. Plain HTTP + maps only (dependency-direction
invariant).

Routing decisions are not a top-level API field: they ride inside each row's
`turn_events` (as `ai.bizinsights.mimir.routing.decision` CloudEvents, or as
bare `routing_decision` entries on rows predating CloudEvents) and are
lifted out here into their own `routing_decision` buffer lines.

The endpoint below is the contract this module is written against. The
gateway now serves it behind its own read-only credential, so this module is
live-runnable; the cursor it echoes is composite (`<rfc3339>|<uuid>`) and is
passed back verbatim, never parsed here.

Buffer filenames are collision-free by construction (`page_filename/3`) —
the buffer file is the ingest contract, and a name collision would drop a
page silently.

# `pull`

```elixir
@spec pull(keyword()) :: {:ok, %{files: [Path.t()], last_cursor: String.t() | nil}}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
