---
title: "User Login"
method: POST
path: "/v1/login"
tags: ["Authentication"]
---

# User Login

`POST /v1/login`

Authenticate a user and respond with a token.

## Request body

- object
  - `username` string, required
  - `password` string, required
  - `method` string — Choosen 2FA method.
  - `requestId` string — Request ID provided by server in response to 2FA method selection.
  - `challenge` string — 2FA challenge provided by server
  - `response` string — 2FA response provided by client

## Response `201`

Successful login.

- object
  - `token` string — Authentication token.
  - `userId` integer
  - `systemAccessRights` integer
  - `changePassword` boolean — Indicates if password change is required for this user.
  - `graceLogins` integer — Number of grace logins left if password change is required.

## Other responses

- `400` — Bad Request - Invalid request body
- `401` — Unauthorized.
- `403` — Forbidden

---

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