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

# API map

> Curated map of Database, EventFrame, Cohort, and related APIs.

Curated map of the public API. Prefer the types below.

## Start here

| Type                   | Role                                          | How you get it                   |
| ---------------------- | --------------------------------------------- | -------------------------------- |
| **Database**           | Bound connector + domains (`db.diagnosis`, …) | `eb.connect(..., connector=...)` |
| **EventFrame**         | Everyday event queries                        | `db.diagnosis`                   |
| **Cohort**             | Study entry / include / exclude / attrition   | `eb.Cohort(...)`                 |
| **Table** / **Column** | Custom predicates                             | `db.diagnosis.as_table()`        |

Guides: [Quickstart](/quickstart) · [Which API?](/which-api)

## Criteria (Cohort)

* `db.enrollment.covering_index(...)`
* `db.demographic.age_at_index(...)` / `.sex(...)` / `.race(...)`
* `db.death.recorded(...)`
* Coded rules: `cohort.include(db.diagnosis.matching(...), window=...)`

Plain-English glossary: [Which API?](/which-api).

## Connectors and connection

| API                                                                                       | Role                                           |
| ----------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `eb.connect`                                                                              | Engine, or `Database` when `connector=` is set |
| `eb.register_connector` / `list_connectors` / `unregister_connector` / `clear_connectors` | Connector registry                             |
| Connector YAML models                                                                     | Validated against Sentinel CDM v8.2.2          |

See [Connectors](/connectors).

## Errors

Public errors live under the `EncodeboxError` hierarchy in `encodebox.render.errors`.

## Legacy (deprecated)

Still importable; each call warns. Prefer EventFrame / Cohort.

| Legacy module            | Replaces with                               |
| ------------------------ | ------------------------------------------- |
| `api.events`             | `EventFrame` (shims in `encodebox._compat`) |
| `api.inclusion_criteria` | `Cohort.include` / `.exclude`               |
| `api.cohort_attrition`   | `Cohort.attrition`                          |
| `api.rwe_study`          | `Cohort`                                    |
| other `api.*`            | See [Migration](/migration)                 |

## Advanced / internals

Rarely needed day-to-day:

* `encodebox.coerce.to_ir` — lower objects to IR
* `encodebox.render` — repr / explain / diagram helpers
* `encodebox.frame.verbs` — verb implementations (use `EventFrame` instead)
