> ## 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.

# Generate report

> Generate a one-time EcoMail Hub CSV report for creditor profiles, notice responses, or consumer profiles. Empty reports return a validation error instead of a blank CSV.



## OpenAPI

````yaml /api/ecomailhub.openapi.yaml post /generate-reports
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:
  /generate-reports:
    post:
      tags:
        - Reports
      summary: Generate report
      description: >-
        Generate a one-time EcoMail Hub CSV report for creditor profiles, notice
        responses, or consumer profiles. Empty reports return a validation error
        instead of a blank CSV.
      operationId: ecomailhubGenerateReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateEcomailhubReportRequest'
            example:
              report_type: notice_responses
              start_date: '2026-01-01'
              end_date: '2026-01-31'
      responses:
        '200':
          description: Report CSV returned.
          headers:
            Content-Disposition:
              schema:
                type: string
              description: >-
                Attachment filename matching the selected report type, for
                example notice_responses_YYYY_MM_DD_HH_MM_SS.csv.
          content:
            text/csv:
              schema:
                type: string
              examples:
                notice_responses:
                  summary: Notice responses CSV
                  value: >
                    "Consumer First Name","Consumer Last
                    Name","SSN","DOB","Consumer Address 1","Consumer Address
                    2","Consumer City","Consumer State","Consumer Zip","Consumer
                    Communication Profile Email","Consumer Communication Profile
                    Phone","Consumer Response Date","Account Name","Original
                    Account#","Balance","Offer Type","Company Name","Company
                    Address 1","Company Address 2","Company City","Company
                    State","Company Zip","Company Phone","Company URL","Company
                    Email","Company Profile Status","Notice Status","Creditor
                    Response Status","Company Contact 1 First Name","Company
                    Contact 1 Last Name","Company Contact 1 Email","Company
                    Contact 1 Phone","Company Contact 2 First Name","Company
                    Contact 2 Last Name","Company Contact 2 Email","Company
                    Contact 2 Phone","Company Contact 3 First Name","Company
                    Contact 3 Last Name","Company Contact 3 Email","Company
                    Contact 3 Phone"

                    Donna,Weaver,3332,"Jan 12, 1969","99 Consumer Ave","Unit
                    B",Miami,FL,33101,donna@example.test,"(555) 333-2222","Jan
                    03, 2026","Sadguru Shopping
                    Center",5678-2222,$651.13,2,"Prospect Sender","200 Prospect
                    Rd","Floor 2",Denver,CO,80202,"(555)
                    987-6543",https://prospect.example.test,profile@prospect.example.test,"Yn
                    Prospect",Pending,Pending,Carl,Contact,carl@prospect.example.test,"(555)
                    444-5555",,,,,,,,
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateEcomailhubReportRequest:
      type: object
      required:
        - report_type
        - start_date
        - end_date
      properties:
        report_type:
          type: string
          enum:
            - creditor_profiles
            - notice_responses
            - consumer_profiles
        start_date:
          type: string
          format: date
          description: Inclusive report start date. Must not be in the future.
          example: '2026-01-01'
        end_date:
          type: string
          format: date
          description: >-
            Inclusive report end date. Must be on or after start_date, not in
            the future, and within two months of start_date.
          example: '2026-01-31'
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            message: Unauthenticated.
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum

````