---
title: "Authenticate and create a session"
method: POST
path: "/login"
tags: ["auth"]
---

# Authenticate and create a session

`POST /login`

## Request body

- LoginRequest
  - `username` string, required
  - `password` string, required
  - `totp_code` string

## Response `200`

Session created

- AuthSession
  - `authenticated` boolean, required
  - `username` string, required
  - `name` string
  - `email` string
  - `role` string
  - `capabilities` string[], required
  - `mfa_complete` boolean
  - `csrf_token` string
  - `ttl_seconds` integer

---

[API](https://skmtc.dev/sphireinc/apis/foundry-api.md) · [All operations](https://skmtc.dev/sphireinc/apis/foundry-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sphireinc/foundry-api/revisions/3696c13096d0/schema)
