---
title: "User login"
method: POST
path: "/auth/login"
tags: ["Auth"]
---

# User login

`POST /auth/login`

## Request

- The document declares no server URL.
- Auth: none declared

Authenticate with username and password to receive a JWT token.

## Request body

- PkgServerLoginRequest
  - `environment_id` integer
  - `password` string
  - `server_id` string: For backward compatibility
  - `username` string

## Response `200`

OK

- PkgServerLoginResponse
  - `access_token` string
  - `user` PkgServerUserSummary
    - `id` integer
    - `role` string
    - `username` string

## Other responses

- `401`: Unauthorized

---

[API](https://skmtc.dev/pullbase/apis/pull-base-api.md) - [All operations](https://skmtc.dev/pullbase/apis/pull-base-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pullbase/apis/pull-base-api/revisions/edf8355bf78c?raw)
