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

# Login

> Authenticate user and obtain JWT token



## OpenAPI

````yaml POST /api/v1/auth/login
openapi: 3.0.3
info:
  title: LogFleet API
  description: >
    LogFleet is a distributed edge observability platform for fleet management.


    ## Overview

    LogFleet collects logs from distributed edge devices, stores them locally
    with

    configurable retention, extracts metrics for cloud observability platforms,

    and provides on-demand log streaming and remote access.


    ## Authentication

    LogFleet uses two authentication methods:


    - **JWT Bearer Token**: For dashboard and user operations. Obtain via
    `/auth/login`

    - **API Key**: For edge agents. Create via `/api-keys` endpoint


    ## Rate Limits

    - General endpoints: 100 requests/minute

    - Streaming endpoints: 20 requests/minute

    - Edge/metrics endpoints: 1000 requests/minute


    ## Multi-Tenancy

    All resources are scoped to organizations. Users can only access resources

    belonging to their organization.
  version: 1.0.0
  contact:
    name: LogFleet Support
    email: support@logfleet.io
    url: https://logfleet.io
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
  - url: https://api.logfleet.io
    description: Production
  - url: http://localhost:8080
    description: Local development
security: []
tags:
  - name: Authentication
    description: User registration and authentication
  - name: Organization
    description: Organization management
  - name: Agents
    description: Edge agent management
  - name: API Keys
    description: API key management for edge agents
  - name: Dashboard
    description: Dashboard metrics and summaries
  - name: Streaming
    description: Real-time log streaming
  - name: Billing
    description: Plans, quotas, and invoices
  - name: Metric Configs
    description: Custom metric extraction configuration
  - name: Edge API
    description: Edge agent communication endpoints
paths:
  /api/v1/auth/login:
    post:
      tags:
        - Authentication
      summary: Login
      description: Authenticate user and obtain JWT token
      operationId: login
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        '200':
          description: Login successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    LoginRequest:
      type: object
      required:
        - email
        - password
      properties:
        email:
          type: string
          format: email
        password:
          type: string
    AuthResponse:
      type: object
      properties:
        token:
          type: string
          description: JWT token
        expires_in:
          type: integer
          description: Token expiration in seconds
        user:
          $ref: '#/components/schemas/UserResponse'
        organization:
          $ref: '#/components/schemas/OrgResponse'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Additional details
    UserResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        email:
          type: string
          format: email
        name:
          type: string
        role:
          type: string
          enum:
            - admin
            - member
            - viewer
    OrgResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string

````