> ## 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, agents, organizations, and webhooks, plus conventions shared by every endpoint.

Foil's public API covers five product surfaces:

* **[Sessions](https://usefoil.com/docs/api-reference/sessions.md)** - session result readback for backend verification and audit.
* **[Fingerprints](https://usefoil.com/docs/api-reference/fingerprints.md)** - visitor fingerprint readback for cross-session correlation.
* **[Agents](https://usefoil.com/docs/api-reference/agents.md)** - proxy IP rotation decisions for agents.
* **[Organizations](https://usefoil.com/docs/api-reference/organizations.md)** - organization and API key lifecycle.
* **[Webhooks and events](https://usefoil.com/docs/webhooks.md)** - webhook endpoint management, signed event delivery, and event history with delivery diagnostics.

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

The REST endpoints live under `/v1/`. The browser and mobile SDKs use a separate set of endpoints under `/v2/collect/`, documented in the [Collect API](https://usefoil.com/docs/api-reference/transport.md) reference. See [Versioning](https://usefoil.com/docs/api-reference/versioning.md) for how the API evolves.

The [OpenAPI spec](https://usefoil.com/docs/api-reference/openapi.json) describes the REST endpoints.

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

> [card] [Authentication](https://usefoil.com/docs/api-reference/authentication.md)
>
> Key types, scopes, and lifecycle. Start here.

> [card] [Errors](https://usefoil.com/docs/api-reference/errors.md)
>
> Error envelope shape, status codes, retry semantics.

> [card] [Pagination](https://usefoil.com/docs/api-reference/pagination.md)
>
> Cursor-based pagination on the sessions, fingerprints, and API keys lists.

> [card] [Rate limits](https://usefoil.com/docs/api-reference/rate-limits.md)
>
> Organization defaults, response headers, retry strategy.

> [card] [Versioning](https://usefoil.com/docs/api-reference/versioning.md)
>
> What's additive, what's breaking, and how to pin.

> [card] [Security and privacy](https://usefoil.com/docs/privacy-and-data.md)
>
> Crypto, infrastructure, and what you should disclose.

## Endpoint groups

> [card] [Sessions](https://usefoil.com/docs/api-reference/sessions.md)
>
> Read the latest stored session result from your backend with a secret key.

> [card] [Visitor fingerprints](https://usefoil.com/docs/api-reference/fingerprints.md)
>
> Inspect visitor fingerprints with a secret key.

> [card] [Agents](https://usefoil.com/docs/api-reference/agents.md)
>
> Check whether an agent should rotate its current proxy IP.

> [card] [Organizations](https://usefoil.com/docs/api-reference/organizations.md)
>
> Create organizations, and create, update, rotate, or revoke API keys for your own organization.

> [card] [Webhooks and events](https://usefoil.com/docs/webhooks.md)
>
> Manage webhook endpoints, verify signed deliveries, and review event history.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.