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

# User Authentication Login

`POST /api/v1/login`

Authenticate user credentials and obtain access token for ReelAPI.

Returns JWT access token along with user information for authentication and authorization.

## Response Information
- **access_token**: JWT Bearer token for API authentication
- **token_type**: Token type (always "bearer")
- **user_role**: User's assigned role (operator, admin, or sys_admin)
- **username**: Authenticated username for display and identification

## Token Details
- **Type**: Bearer token for Authorization header
- **Lifespan**: 24 hours from generation
- **Usage Pattern**: `Authorization: Bearer <access_token>`

## Frontend Usage
Use the `user_role` field to control UI element visibility and provide role-appropriate user experiences.

## Response `200`

JWT access token and user information for authenticated API access

- UserLoginResponse — Response containing JWT access token and user information for authenticated API access. Provides the authentication token, type information, and user role needed for subsequent API requests and frontend permission handling.
  - `access_token` string, JWT token, required — JWT access token for API authentication. **Token Usage**: Include in Authorization header as `Bearer <access_token>` **Lifespan**: Valid for 24 hours from generation (system configured) **Format**: Standard JWT with cryptographic signature **Security**: Contains user identification and role information **Authorization Header Format**: ``` Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ``` **Token Expiration**: Tokens expire after 1440 minutes
  - `token_type` 'bearer', required — Authentication token type identifier. **Standard Value**: "bearer" - indicates Bearer token authentication **Usage**: Specifies how to include token in Authorization header **OAuth2 Compliance**: Follows OAuth2 Bearer token specification
  - `user_role` 'operator' | 'admin' | 'sys_admin', required — User role for frontend permission handling and UX optimization. **Available Roles:** - **operator** - Standard reel operation and monitoring permissions - **admin** - Full system administration and configuration permissions - **sys_admin** - System administrator with all permissions including serial number updates **Frontend Usage**: Use this role to show/hide UI elements and provide appropriate user experience **Permission Hierarchy**: sys_admin > admin > operator **UX Benefit**: Prevents users from seeing controls they cannot use
  - `username` string, required — Username of the authenticated user. **Usage**: Display in UI, user identification, logging **Security**: Safe to display in frontend interfaces **Consistency**: Matches username used for login request

## Other responses

- `401` — Authentication failed
- `422` — Invalid request format
- `500` — Internal server error

---

[API](https://skmtc.net/reach-systems-tech/apis/reelapi-v1.md) · [All operations](https://skmtc.net/reach-systems-tech/apis/reelapi-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/reach-systems-tech/reelapi-v1/versions/1dd366a9c6a3/schema)
