> For the complete documentation index, see [llms.txt](https://docs.lagoon.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lagoon.finance/developer-hub/lagoon-api.md).

# Lagoon API

The Lagoon API is a single multi-chain GraphQL endpoint that returns indexed vault data — current state, historical state, user positions, the full event stream, and reference data such as chains, assets, curators, and integrators.

```
POST https://api.lagoon.finance/query
Content-Type: application/json
```

Reads are public; no API key is required.

## Quickstart

Confirm connectivity and check indexing health for every chain in one call:

```graphql
{
  _meta {
    lastIndexedBlocks {
      chainId
      number
      hash
      chain { name }
    }
  }
}
```

[**Try in Apollo Sandbox →**](https://api.lagoon.finance/query?document=%7B%0A%20%20_meta%20%7B%0A%20%20%20%20lastIndexedBlocks%20%7B%0A%20%20%20%20%20%20chainId%0A%20%20%20%20%20%20number%0A%20%20%20%20%20%20hash%0A%20%20%20%20%20%20chain%20%7B%20name%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)

Same query as a curl call:

```bash
curl -sS -X POST https://api.lagoon.finance/query \
  -H "Content-Type: application/json" \
  -d '{"query":"{ _meta { lastIndexedBlocks { chainId number hash chain { name } } } }"}'
```

`_meta.lastIndexedBlocks` returns the most recent tracked block per chain. An hourly health-check event guarantees the value advances at least once per hour even on quiet chains — if a chain is more than \~1 hour behind, the indexer is lagging.

{% hint style="success" %}
Open <https://api.lagoon.finance/query> in a browser to launch **Apollo Sandbox**, an interactive schema explorer. Introspection is enabled, so the full schema (types, fields, descriptions) is browsable without any client setup — Sandbox is the authoritative reference for every field name in this documentation. Throughout these docs, "Try in Apollo Sandbox" links open Sandbox with the example query already populated in the Operation panel.
{% endhint %}

## Where to go next

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Common queries</strong></td><td>Recipes for the queries integrators reach for first — list vaults, fetch a vault, get a user's positions, stream events, read historical state, global TVL.</td><td><a href="/pages/GannZWIKDSvQUBTXR8Kj">/pages/GannZWIKDSvQUBTXR8Kj</a></td></tr><tr><td><strong>Conventions</strong></td><td>Pagination, filtering, ordering, scalar formats, and how to query historical data and indexing health.</td><td><a href="/pages/JrWVlj2oyiaAs6XebPlg">/pages/JrWVlj2oyiaAs6XebPlg</a></td></tr><tr><td><strong>Mutations</strong></td><td>The single mutation today — updating off-chain vault metadata with an EIP-712 signature from the vault owner.</td><td><a href="/pages/LGw1iJU0IOjt5wOWFfYI">/pages/LGw1iJU0IOjt5wOWFfYI</a></td></tr><tr><td><strong>Smart Contract Reference</strong></td><td>On-chain counterpart to this API — every external entry point on the v0.6.0 vault implementation.</td><td><a href="/pages/lsDm0AmaUOyDmIJeLii1">/pages/lsDm0AmaUOyDmIJeLii1</a></td></tr></tbody></table>


---

# 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:

```
GET https://docs.lagoon.finance/developer-hub/lagoon-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.
