# HTTP API

> Every route the server serves: the app API, the browser routes, the server's own routes, and the admin API.

From `server/openapi.json` in tensile-tools/tensile-auth at commit `e66760d` (v0.4.1-7-ge66760d). The HTML page is https://auth.tensile.tools/docs/reference/api.

Every route the tensile-auth server serves for apps: the app API under /v1/, which the app's backend calls with its app key, and the browser routes under /auth/, which the app proxies.

## The four groups

- [App API](/docs/reference/api/app.md), under `/v1/`: 9 routes. The app's backend calls these routes with its app key. The SDK wraps them: `check` is `POST /v1/check`.

- [Browser routes](/docs/reference/api/browser.md), under `/auth/`: 49 routes. The browser client and the elements call these routes on the app's own origin, and the app's proxy forwards them to the server. Refusals are RFC 9457 problems.

- [Server routes](/docs/reference/api/server.md), under `/auth/`: 15 routes. The server adds these routes under `/auth/`: agents and tokens for the signed-in person, agent claims, OAuth consent, device approval, and secret-scanning alerts.

- [Admin API](/docs/reference/api/admin.md), under `/admin/v1/`: 18 routes. Administrators call these routes with a session that has a second factor. Changes from a stale session, an agent, or a token are refused.

## Authentication

- App key, in the `Tensile-App-Key` header.
- A session token, as `Authorization: Bearer`. A session token, human or agent. A browser can send the session cookie instead.
- The `__Host-session` cookie.

## Problems

Every refusal is an RFC 9457 problem, as `application/problem+json`. Branch on `code`, and show `title` and `fix` to people. Every code is in the [error catalog](/docs/reference/errors.md).
