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

# API introduction

> Explore the Foil API: base URLs, the v1 REST surface for sessions, fingerprints, Gate, and organizations, plus conventions shared by every endpoint.

Foil's public API covers four product surfaces:

* **[Sessions](/api-reference/sessions)** — durable session result readback for backend verification and audit.
* **[Fingerprints](/api-reference/fingerprints)** — durable visitor fingerprint readback for cross-session correlation.
* **[Gate](/api-reference/gate-registry)** — the Gate registry, agentic signup, agent tokens, and dashboard login sessions.
* **[Organizations](/api-reference/organizations)** — organization, membership, and API key lifecycle.

## Base URLs

Managed Foil uses separate hosts for the CDN-hosted browser agent and the REST API.

```text theme={"dark"}
Browser agent: https://cdn.usefoil.com/t.js
API base:      https://api.usefoil.com
```

Every public endpoint lives under `/v1/`. See [Versioning](/api-reference/versioning) for how the API evolves.

## Cross-cutting conventions

A handful of concerns apply to every endpoint. They have dedicated pages so they're easy to link to and easy to keep accurate:

<CardGroup cols={2}>
  <Card title="Authentication" icon="lock-keyhole" href="/api-reference/authentication">
    Key types, scopes, and lifecycle. Start here.
  </Card>

  <Card title="Errors" icon="triangle-alert" href="/api-reference/errors">
    Error envelope shape, status codes, retry semantics.
  </Card>

  <Card title="Pagination" icon="list-ordered" href="/api-reference/pagination">
    Cursor-based pagination on every list endpoint.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/api-reference/rate-limits">
    Organization defaults, response headers, retry strategy.
  </Card>

  <Card title="Versioning" icon="git-branch" href="/api-reference/versioning">
    What's additive, what's breaking, and how to pin.
  </Card>

  <Card title="Security and privacy" icon="lock" href="/privacy-and-data">
    Crypto, infrastructure, and what you should disclose.
  </Card>
</CardGroup>

## Endpoint groups

<CardGroup cols={2}>
  <Card title="Sessions" icon="monitor" href="/api-reference/sessions">
    Read the latest durable session result from your backend with a secret key.
  </Card>

  <Card title="Visitor fingerprints" icon="fingerprint" href="/api-reference/fingerprints">
    Inspect durable visitor fingerprints with a secret key.
  </Card>

  <Card title="Gate" icon="door-open" href="/api-reference/gate-registry">
    Browse the Gate registry, manage services, create signup sessions, verify agent tokens, consume login codes.
  </Card>

  <Card title="Organizations" icon="users" href="/api-reference/organizations">
    Create organizations, provision key pairs, and rotate or revoke keys.
  </Card>
</CardGroup>
