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

# Login EcoMail Hub user

> Authenticate an existing EcoMail Hub user and return a bearer token. Send `remember: false` to use the shorter refresh-token duration; omitted or `true` uses the remembered duration.



## OpenAPI

````yaml /api/ecomailhub.openapi.yaml post /auth/login
openapi: 3.1.0
info:
  title: YouNegotiate EcoMail Hub API
  version: '2.0'
  description: Stateless API endpoints for EcoMail Hub / EcoPortal users.
servers:
  - url: https://api.ecomailhub.younegotiate.com
    description: Production
security: []
tags:
  - name: System
    description: Public EcoMail Hub domain system and health endpoints.
  - name: Authentication
    description: EcoMail Hub login, logout, password reset, and password change endpoints.
  - name: Profile
    description: Authenticated EcoMail Hub user profile endpoints.
  - name: Dashboard
    description: EcoMail Hub dashboard summary and notice-response bucket endpoints.
  - name: Manage Consumers
    description: >-
      EcoMail Hub consumer identity grouping and notice-response count
      endpoints.
  - name: Manage Creditors
    description: >-
      EcoMail Hub creditor profile and company-only member profile table
      endpoints.
  - name: Import Creditor Profiles
    description: EcoMail Hub creditor profile CSV import endpoints.
  - name: Manage Notice Response
    description: >-
      EcoMail Hub top-level notice-response review, reassignment, and close
      endpoints.
  - name: Manage Users
    description: EcoMail Hub user account management endpoints.
  - name: Reports
    description: EcoMail Hub one-time and scheduled CSV report endpoints.
  - name: Communications
    description: EcoMail Hub communication template editor endpoints.
paths:
  /auth/login:
    post:
      tags:
        - Authentication
      summary: Login EcoMail Hub user
      description: >-
        Authenticate an existing EcoMail Hub user and return a bearer token.
        Send `remember: false` to use the shorter refresh-token duration;
        omitted or `true` uses the remembered duration.
      operationId: ecomailhubLogin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginEcomailhubRequest'
            example:
              email: maya@example.com
              password: Password123!
              recaptcha: recaptcha-token
              device_name: EcoMail Hub
              remember: true
      responses:
        '200':
          description: EcoMail Hub user logged in.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthTokenResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    LoginEcomailhubRequest:
      type: object
      required:
        - email
        - password
        - recaptcha
      properties:
        email:
          type: string
          format: email
          maxLength: 255
        password:
          type: string
          format: password
        recaptcha:
          type: string
        device_name:
          type: string
          maxLength: 255
        remember:
          type: boolean
          default: true
          description: >-
            When false, issue the refresh token with the standard non-remembered
            TTL. Omitted or true uses the remembered refresh-token TTL.
    AuthTokenResponse:
      type: object
      required:
        - message
        - data
        - meta
      properties:
        message:
          type: string
          example: Logged in.
        data:
          $ref: '#/components/schemas/EcomailhubUser'
        meta:
          type: object
          required:
            - access_token
            - refresh_token
            - token_type
            - access_token_expires_at
            - refresh_token_expires_at
          properties:
            access_token:
              type: string
            refresh_token:
              type: string
              description: >-
                Plaintext refresh token returned once. Store securely and send
                to POST /auth/refresh.
            token_type:
              type: string
              example: Bearer
            access_token_expires_at:
              type:
                - string
                - 'null'
              format: date-time
              description: >-
                Access token expiry timestamp when an expiry is assigned;
                otherwise null.
            refresh_token_expires_at:
              type: string
              format: date-time
    EcomailhubUser:
      type: object
      required:
        - id
        - name
        - email
      properties:
        id:
          type: integer
          example: 12
        name:
          type: string
          example: Maya Patel
        email:
          type: string
          format: email
          example: maya@example.com
        email_verified_at:
          type: string
          format: date-time
          nullable: true
        phone_no:
          type: string
          nullable: true
          example: (900) 509-0050
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  responses:
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            message: The given data was invalid.
            errors:
              email:
                - The email field is required.
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            message: Too Many Attempts.

````