> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluxend.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate user

> Authenticate a user and return a JWT token



## OpenAPI

````yaml post /users/login
openapi: 3.0.0
info:
  description: >-
    Fluxend is backend as-a-service platform that allows you to build, deploy,
    and scale applications without managing infrastructure.
  title: Fluxend API
  contact:
    name: API Support
    url: http://github.com/fluxend/fluxend
    email: hello@fluxend.app
  version: '1.0'
servers:
  - url: https://api.fluxend.app
security: []
paths:
  /users/login:
    post:
      tags:
        - Users
      summary: Authenticate user
      description: Authenticate a user and return a JWT token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/user.LoginRequest'
        description: Login request
        required: true
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/response.Response'
                  - type: object
                    properties:
                      content:
                        $ref: '#/components/schemas/user.Response'
        '400':
          description: Bad request response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.BadRequestErrorResponse'
        '401':
          description: Unauthorized response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.UnauthorizedErrorResponse'
        '500':
          description: Internal server error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.InternalServerErrorResponse'
components:
  schemas:
    user.LoginRequest:
      type: object
      properties:
        email:
          type: string
        password:
          type: string
    response.Response:
      type: object
      properties:
        content: {}
        errors:
          type: array
          items:
            type: string
        metadata: {}
        success:
          type: boolean
    user.Response:
      type: object
      properties:
        bio:
          type: string
        createdAt:
          type: string
        email:
          type: string
        organizationUuid:
          type: string
        roleId:
          type: integer
        status:
          type: string
        updatedAt:
          type: string
        username:
          type: string
        uuid:
          type: string
    response.BadRequestErrorResponse:
      type: object
      properties:
        content:
          type: string
          example: 'null'
        errors:
          type: array
          items:
            type: string
          example:
            - Invalid input parameter
        success:
          type: boolean
          example: false
    response.UnauthorizedErrorResponse:
      type: object
      properties:
        content:
          type: string
          example: 'null'
        errors:
          type: array
          items:
            type: string
          example:
            - Unauthorized access
        success:
          type: boolean
          example: false
    response.InternalServerErrorResponse:
      type: object
      properties:
        content:
          type: string
          example: 'null'
        errors:
          type: array
          items:
            type: string
          example:
            - Internal server error
        success:
          type: boolean
          example: false

````