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

# Create schedule report

> Create an email-only EcoMail Hub scheduled report. Duplicate report type and frequency combinations are rejected per user.



## OpenAPI

````yaml /api/ecomailhub.openapi.yaml post /schedule-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:
  /schedule-reports:
    post:
      tags:
        - Reports
      summary: Create schedule report
      description: >-
        Create an email-only EcoMail Hub scheduled report. Duplicate report type
        and frequency combinations are rejected per user.
      operationId: ecomailhubCreateScheduleReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEcomailhubScheduleReportRequest'
            example:
              report_type: notice_responses
              frequency: weekly
              emails: reports@example.com,admin@example.com
      responses:
        '201':
          description: Schedule report created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EcomailhubScheduleReportResponse'
              example:
                message: Schedule report created.
                data:
                  id: 42
                  report_type:
                    value: notice_responses
                    label: Notice Responses
                    requires_date_range: true
                  frequency:
                    value: weekly
                    label: Weekly
                  emails:
                    - reports@example.com
                    - admin@example.com
                  pause: false
                  last_sent_at: null
                  created_at: '2026-07-05T12:00:00.000000Z'
                  updated_at: '2026-07-05T12:00:00.000000Z'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    StoreEcomailhubScheduleReportRequest:
      type: object
      required:
        - report_type
        - frequency
        - emails
      properties:
        report_type:
          type: string
          enum:
            - creditor_profiles
            - notice_responses
            - consumer_profiles
        frequency:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        emails:
          type: string
          description: >-
            Comma-separated recipient emails. The API trims, lowercases,
            de-duplicates, validates, and limits the list to five recipients.
          example: reports@example.com,admin@example.com
    EcomailhubScheduleReportResponse:
      allOf:
        - $ref: '#/components/schemas/MessageResponse'
        - $ref: '#/components/schemas/EcomailhubScheduleReportDataResponse'
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    EcomailhubScheduleReportDataResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/EcomailhubScheduleReport'
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    EcomailhubScheduleReport:
      type: object
      required:
        - id
        - report_type
        - frequency
        - emails
        - pause
        - last_sent_at
        - created_at
        - updated_at
      properties:
        id:
          type: integer
          example: 42
        report_type:
          $ref: '#/components/schemas/EcomailhubReportTypeOption'
        frequency:
          $ref: '#/components/schemas/EcomailhubScheduleReportFrequencyOption'
        emails:
          type: array
          items:
            type: string
            format: email
          example:
            - reports@example.com
            - admin@example.com
        pause:
          type: boolean
          example: false
        last_sent_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-07-05T12:00:00.000000Z'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-07-05T12:00:00.000000Z'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-07-05T12:05:00.000000Z'
    EcomailhubReportTypeOption:
      type: object
      required:
        - value
        - label
        - requires_date_range
      properties:
        value:
          type: string
          enum:
            - creditor_profiles
            - notice_responses
            - consumer_profiles
        label:
          type: string
          enum:
            - Creditor Profiles
            - Notice Responses
            - Consumer Profiles
        requires_date_range:
          type: boolean
          example: true
    EcomailhubScheduleReportFrequencyOption:
      type: object
      required:
        - value
        - label
      properties:
        value:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        label:
          type: string
          enum:
            - Daily
            - Weekly
            - Monthly
  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

````