> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787435561773.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Log in with email and password



## OpenAPI

````yaml /openapi.yaml post /api/v1/auth/login
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/auth/login:
    post:
      tags:
        - Auth
      summary: Log in with email and password
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                password:
                  type: string
                otp_code:
                  type: string
                  nullable: true
                  description: TOTP code if MFA is enabled
                device:
                  type: object
                  properties:
                    device_id:
                      type: string
                    device_name:
                      type: string
                    device_type:
                      type: string
                    os_version:
                      type: string
                    app_version:
                      type: string
                  required:
                    - device_id
                    - device_name
                    - device_type
                    - os_version
                    - app_version
              required:
                - email
                - password
                - device
        required: true
      responses:
        '200':
          description: login successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  refresh_token:
                    type: string
                  token_type:
                    type: string
                  expires_in:
                    type: integer
                  created_at:
                    type: integer
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      email:
                        type: string
                      first_name:
                        type: string
                      last_name:
                        type: string
                      ui_layout:
                        type: string
                        enum:
                          - dashboard
                          - intro
                      ai_enabled:
                        type: boolean
        '401':
          description: invalid credentials or MFA required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)

````