> ## Documentation Index
> Fetch the complete documentation index at: https://docs-attestly.code4source.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sources

> The reference datasets your rulesets and queries match against.

A **source** is a curated dataset — typically a register of polygons
or a list of subject identifiers — used as the right-hand side of a
match. Examples:

* `funai_tis` — official indigenous land registry
* `ibama_embargos` — environmental-violation embargoes
* `icmbio_ucs_federais` — federal conservation areas
* `ofac_sdn` — US OFAC Specially Designated Nationals list
* `sicar_br` — Rural Environmental Registry

## Listing what's available

```bash theme={null}
GET /v1/sources
```

Returns metadata for every source your Organization can reach — name,
kind, country coverage, and last refresh timestamp.

Filter by kind:

```bash theme={null}
GET /v1/sources?kind=subject_register
```

Three kinds exist:

* **`leaf`** — a regular spatial source.
* **`group`** — a virtual collection that expands to several leaves;
  selecting a group is equivalent to querying all of its members.
* **`subject_register`** — non-spatial source keyed by typed
  identifiers (CNPJ, EIN, OFAC SDN). Carries a `supported_schemes`
  list.

## Freshness

Each source carries `collected_at_latest` — the timestamp of its most
recent refresh. We refresh sources on a schedule appropriate to each
upstream's update cadence.

If an upstream is unreachable at query time, the affected check is
marked `failed` and the verdict's `status` becomes `degraded`. Your
request still returns 2xx with the partial result so you can decide
how to handle it.

## Referencing sources

In a ruleset:

```json theme={null}
{
  "sets": {
    "protected_overlap": {
      "source": "icmbio_ucs_federais",
      "joins": [{ "intersects": { "target": "$input" } }]
    }
  }
}
```

In `/v1/intersections` and `/v1/distance`, you can either query
against all sources at once (default) or restrict to a specific one
via `reference_areas_source`.
