---
title: "Credentials login"
method: POST
path: "/pilot/login"
tags: ["Pilot"]
---

# Credentials login

`POST /pilot/login`

Exchange a pilot's username (pilot ID or email) and password for an API key. Returns the full pilot session including the `token` field that the client uses on every subsequent request as a Bearer token.

## Request body

- LoginRequest
  - `username` string, required — The pilot's displayed pilot ID (e.g. `QFA0001`) or their email address.
  - `password` string, password, required — The user's password.

## Response `200`

Credentials accepted.

- PilotSessionWithToken
  - `db_id` integer, required — Internal database ID. Stable across pilot ID changes.
  - `pilot_id` string, required — Display pilot ID (airline ICAO + zero-padded number per VA setting). Example: `QFA0001`.
  - `first_name` string, required
  - `last_name` string, required
  - `email` string, email, required
  - `rank` string, required — Human-readable rank name.
  - `rank_image` string, uri, nullable, required — URL to the pilot's rank insignia image. The Stratos client renders this as a rank badge in the dashboard and pilot-centre plugins. Return `null` if the rank has no image. The phpVMS reference resolves this from the rank's `image_url` column (relative paths are wrapped in your phpVMS public URL automatically).
  - `rank_level` integer, required — Numeric rank tier (0-based) — index into the rank ladder ordered ascending by required hours. Used by the Stratos client for any rank-gated UI behaviour. The phpVMS reference computes this as the count of ranks with fewer required hours than the pilot's current rank, matching phpVMS's own auto-promote ordering.
  - `avatar` string, uri, required — Absolute URL to the pilot's avatar image.
  - `token` string, required — The pilot's API key. Send as `Authorization: Bearer <token>` on every authenticated request.

## Other responses

- `401` — Username or password incorrect.

---

[API](https://skmtc.net/skyvexsoftware/apis/stratos-core-api.md) · [All operations](https://skmtc.net/skyvexsoftware/apis/stratos-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/skyvexsoftware/stratos-core-api/versions/0b7ba98ff0aa/schema)
