---
title: "Log in and receive a session cookie"
method: POST
path: "/user/login"
tags: ["user"]
---

# Log in and receive a session cookie

`POST /user/login`

Authenticate with username and password.

Accepts JSON body (`{"username": ..., "password": ...}`) or HTML form data.
Returns an httpOnly JWT session cookie valid for 30 days (sliding window).

Pass `?redirect_to=/docs` to redirect after a successful browser form login.

## Query parameters

- `redirect_to` string, nullable — Redirect URL after successful login (relative path only)

## Request body

- object
  - `username` string, required
  - `password` string, password, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-04-13** `76e8f6063728` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/jentic/apis/jentic-control-plane-api/changes/user/login/post.md)

---

[API](https://skmtc.dev/jentic/apis/jentic-control-plane-api.md) · [All operations](https://skmtc.dev/jentic/apis/jentic-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jentic/jentic-control-plane-api/revisions/bd463fcefb14/schema)
