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

# Log in

> Authenticates with email and password. Returns user and organization info and sets a session cookie. Rate-limited to prevent brute-force attacks.



## OpenAPI

````yaml /openapi.json post /api/auth/login
openapi: 3.0.0
info:
  title: AI Presentations API
  version: 1.0.0
  description: >-
    REST API for AI Presentations — an AI-powered presentation platform with
    narrated slides, live Q&A, and deck management.


    **Authentication**: Most endpoints require a session cookie obtained from
    `POST /api/auth/login`. Presentation playback endpoints (`/api/qa`,
    `/api/narration/*`) also accept a `presentationId` for unauthenticated
    viewer access.
  contact:
    name: Demand IQ
    url: https://demand-iq.com
servers:
  - url: https://app.demand-iq.com
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Decks
    description: Manage presentation decks
  - name: Slides
    description: Manage slides within a deck
  - name: FAQs
    description: Manage pre-built Q&A pairs
  - name: Branding
    description: Colors, logo, and call-to-action configuration
  - name: Q&A
    description: Live question answering and Q&A settings
  - name: Narration
    description: Text-to-speech synthesis
  - name: Presentations
    description: Create and manage personalized presentation instances
  - name: Generation
    description: AI-powered content generation from slide images
  - name: Images
    description: Image upload and management
  - name: Voices
    description: Available TTS voices
  - name: Utility
    description: Health check and diagnostics
  - name: Authentication
    description: Session-based login, logout, and identity
  - name: Company
    description: Organization contact info and knowledge base
  - name: Notifications
    description: Event subscriptions and delivery log
  - name: Contracts
    description: Contract template import and e-signature
  - name: Fonts
    description: Available Google Fonts for branding
  - name: Roof Measurements
    description: Request and track automated roof measurements
  - name: Actions
    description: Voice/text command detection for presentation control
  - name: Appointments
    description: Appointment scheduling for presentation viewers
  - name: Activity
    description: Recent presentation activity feed
  - name: Onboarding
    description: >-
      Per-user product onboarding milestones (ENG-641). Milestone endpoints are
      idempotent and are called by the app UI — they should not be treated as
      tenant-integration surface.
paths:
  /api/auth/login:
    post:
      tags:
        - Authentication
      summary: Log in
      description: >-
        Authenticates with email and password. Returns user and organization
        info and sets a session cookie. Rate-limited to prevent brute-force
        attacks.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - password
              properties:
                email:
                  type: string
                  format: email
                  example: rep@acmesolar.com
                password:
                  type: string
                  format: password
      responses:
        '200':
          description: Login successful. A `session` cookie is set on the response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $ref: '#/components/schemas/User'
                  organization:
                    $ref: '#/components/schemas/Organization'
        '400':
          description: >-
            Missing email or password, a request body that is not valid JSON, or
            a body that is valid JSON but not an object. The `error` field
            distinguishes the cases: `Request body must be valid JSON`, `Request
            body must be a JSON object`, or a message naming the missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit exceeded. Only failed credential attempts count toward
            the limit; requests rejected with a 400 for a malformed body do not.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          format: email
        name:
          type: string
      required:
        - id
        - email
        - name
    Organization:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        isLibraryAuthor:
          type: boolean
          description: Whether this organization can publish shared library templates.
        welcomeSeenAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Timestamp when the org first exited the welcome wizard (saved or
            skipped the confirm-info step). `null` for organizations that have
            never completed the wizard.
      required:
        - id
        - name
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error

````