---
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
- `500` — Internal error - credentials were accepted but the access token could not be issued (for example, the user account was deleted while authentication was in progress). No token is returned and the login has to be repeated.

---

[API](https://skmtc.net/netxms/apis/netxms-api.md) · [All operations](https://skmtc.net/netxms/apis/netxms-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netxms/netxms-api/versions/14d93e5115dd/schema)
