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

# User login

> Authenticates a user and returns a JWT token.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/auth/login
openapi: 3.0.0
info:
  title: PlugToPay API
  description: API to make payments easy in multiple gateways.
  version: 1.0.0
servers:
  - url: http://localhost:7701
    description: Test Server
security: []
paths:
  /api/v1/auth/login:
    post:
      tags:
        - Auth
      summary: User login
      description: Authenticates a user and returns a JWT token.
      operationId: a5d42e538c8c6ceeba95318199c6db4c
      parameters:
        - $ref: '#/components/parameters/XClientId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - email
                - password
              properties:
                email:
                  type: string
                  format: email
                  example: john@example.com
                password:
                  type: string
                  format: password
                  example: secret123
              type: object
      responses:
        '200':
          description: Login successful
          content:
            application/json:
              schema:
                properties:
                  token:
                    type: string
                    example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
                  token_type:
                    type: string
                    example: Bearer
                  expires_at:
                    type: string
                    format: date-time
                    example: '2026-05-27T12:00:00+00:00'
                  user:
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: John Doe
                      email:
                        type: string
                        example: john@example.com
                      company_id:
                        type: integer
                        example: 1
                    type: object
                type: object
        '401':
          description: Invalid credentials
        '422':
          description: Validation Error
components:
  parameters:
    XClientId:
      name: x-client-id
      in: header
      description: Client identifier for the company in the request.
      required: true
      schema:
        type: string
        example: client_abc123

````