---
title: auth.md
agent_auth:
  audience: ai-agent
  skill: https://esimcover.com/auth.md
  register_uri: https://esimcover.com/api/auth/register
  token_uri: https://esimcover.com/api/auth/login
  identity_types_supported:
    - anonymous
  anonymous:
    credential_types_supported:
      - none
    claim_uri: https://esimcover.com/api/destinations
    description: >-
      The whole catalogue (destinations, packages, products) and every read-only
      telemetry endpoint is open. No credential is needed and no agent identity
      is required.
  methods:
    - id: email_password_account
      summary: >-
        Agents that need their activity attributed to a persistent account can
        register an email + password account and use the returned bearer token.
      register_uri: https://esimcover.com/api/auth/register
      token_uri: https://esimcover.com/api/auth/login
      credential_types_supported:
        - bearer
      token_lifetime_seconds: 604800
      rate_limits:
        register: 5 per minute per IP
        login: 10 per minute per IP
  oauth:
    supported: partial
    note: >-
      eSIM Cover does not run a full OAuth 2.0 / OIDC authorization server.
      Discovery metadata IS published (/.well-known/openid-configuration,
      /.well-known/oauth-authorization-server, /.well-known/oauth-protected-resource)
      describing the email+password -> opaque bearer token flow as an RFC 6749
      password grant. There is no JWT, no jwks_uri and no id_token - do not
      expect RS256 verification. Machine-readable auth doc: this file.
---

# auth.md

Authentication guide for AI agents and automated clients calling
`https://esimcover.com/api`.

Machine-readable companions: [OpenAPI 3.1 description](https://esimcover.com/openapi.json)
and [RFC 9727 API catalog](https://esimcover.com/.well-known/api-catalog).

## 1. Start here: most of the API needs nothing

These endpoints are open, unauthenticated, and safe for agents to call directly:

| Endpoint | What it returns |
| --- | --- |
| `GET /api/destinations` | Every destination we sell eSIMs for (slug, name, descriptions) |
| `GET /api/packages` | Every purchasable package with price, data amount, validity |
| `GET /api/products` | Same catalogue, grouped for the storefront |
| `GET /api/healthz` | Liveness probe |
| `GET /api/public/dest-popularity` | Destination heat map (90-day views + paid orders x50) |
| `GET /api/public/guide-popularity` | Guide article clicks, last 30 days |
| `GET /api/public/dest-related?slug=japan` | Destinations co-viewed with a destination |
| `GET /api/public/source-resolve?name=aitrip360` | Resolve a partner traffic source |

Please identify yourself with a descriptive `User-Agent` and keep request rates
modest. `/api/` is limited at the edge to roughly 10 requests per second burst 20;
sustained crawling beyond that will be throttled.

## 2. When a credential is useful

The write-side telemetry beacons
(`POST /api/public/search-report`, `/api/public/behavior-report`) work
anonymously, but if you send a bearer token their events are attributed to your
account instead of an anonymous visitor id. That is the only thing a token buys
you today.

Registering is straightforward and does not require email confirmation before
the token can be used.

### Register

```http
POST /api/auth/register HTTP/1.1
Host: esimcover.com
Content-Type: application/json

{"email": "agent@example.com", "password": "at-least-6-chars", "fullName": "Research Agent"}
```

```json
{ "token": "YWdlbnRAZXhhbXBsZS5jb206MTc2MDI5NzYwMDphYjEyY2QzZGU1Zjcw", "user": { "id": 42, "email": "agent@example.com", "fullName": "Research Agent" } }
```

Limits: 5 registrations per minute per IP; password must be at least 6
characters; duplicate emails return `400 {"error":"Email already registered"}`.

### Log in later

```http
POST /api/auth/login HTTP/1.1
Host: esimcover.com
Content-Type: application/json

{"email": "agent@example.com", "password": "at-least-6-chars"}
```

Same response shape. `401` for bad credentials, `403` if the account is locked,
`429` if you exceed 10 attempts per minute per IP.

## 3. Using the token

Send it as a standard bearer credential on any request:

```http
Authorization: Bearer <token>
```

The token is an opaque string: base64 of `email:expiry_unix:hmac`, where the
HMAC is SHA-256 truncated to 16 hex characters. It is **not** a JWT - do not
parse or re-sign it, just store and replay it verbatim. It expires **7 days**
after issue and cannot be refreshed; call `/api/auth/login` again to get a new
one.

## 4. What a token does not do

- It does **not** authorize purchases. Checkout is a browser-side Stripe flow;
  there is no order-creation or payment endpoint in this API.
- It does **not** expose order history, eSIM activation, or account management.
  Those live in the signed-in web UI only.
- It is **not** an OAuth 2.0 access token. eSIM Cover does not run an OAuth 2.0
  or OpenID Connect authorization server, so
  `/.well-known/oauth-authorization-server`, `/.well-known/openid-configuration`
  and `/.well-known/oauth-protected-resource` are deliberately not published -
  there is no authorization server behind them to talk to.

## 5. Content for agents, without scraping

- `https://esimcover.com/llms.txt` - orienting notes, page index, price list.
- `https://esimcover.com/llms-full.txt` - expanded catalogue with per-package pricing.
- Any guide page accepts content negotiation: request it with
  `Accept: text/markdown` and you get a clean Markdown document (frontmatter +
  article body + JSON-LD) instead of HTML.

## 6. Contact

Questions about agent access: use the [contact form](https://esimcover.com/en/contact-us).
