Getting started

Getting started

This guide helps you make your first authenticated call to the Miles USP /v7 API.

Prerequisites

1. Smoke-test the API

Confirm the /v7 prefix is mounted:

$curl -s https://api.milescaira.com/v7/ping

Expected: a small JSON payload confirming the versioned surface is live.

2. Check health

$curl -s https://api.milescaira.com/v7/health
$curl -s https://api.milescaira.com/v7/health/ready

/v7/health/ready returns 503 when the database or cache is degraded.

3. Authenticate

Most product endpoints require:

1Authorization: Bearer <your-jwt>

Obtain a token via SSO (mobile app / web) or admin phone OTP. Details are in Authentication.

4. Call an endpoint

Example — list account-related routes are under the Account & auth section in the API Reference. Use the API Explorer on any endpoint page to send a live request with your token pre-filled.

Regenerating the OpenAPI contract

The committed spec at docs/openapi.yaml is generated from the FastAPI app:

$source .venv_fastapi/bin/activate
$python tests/contract/generate_openapi_yaml.py

After regenerating, restart fern docs dev to pick up changes.

Local development

$source .venv_fastapi/bin/activate
$uvicorn app.main:app --reload --port 8080

Point the API Explorer server dropdown at Local (http://localhost:8080).