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

# Update communication campaign

> Update one EcoMail Hub communication campaign owned by the authenticated user.



## OpenAPI

````yaml /api/ecomailhub.openapi.yaml put /communications/campaigns/{ecoMailHubCampaign}
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:
  /communications/campaigns/{ecoMailHubCampaign}:
    put:
      tags:
        - Communications
      summary: Update communication campaign
      description: >-
        Update one EcoMail Hub communication campaign owned by the authenticated
        user.
      operationId: ecomailhubUpdateCommunicationCampaign
      parameters:
        - name: ecoMailHubCampaign
          in: path
          required: true
          schema:
            type: integer
          description: Communication campaign ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreEcomailhubCommunicationCampaignRequest'
            example:
              template_id: 15
              group_id: 21
              frequency: monthly
              start_date: '2026-07-15'
              end_date: '2026-09-15'
              day_of_month: 15
      responses:
        '200':
          description: Communication campaign updated.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EcomailhubCommunicationCampaignMutationResponse
              example:
                message: Campaign updated successfully.
                data:
                  id: 33
                  template_id: 15
                  group_id: 21
                  template:
                    id: 15
                    name: Welcome Creditor
                  group:
                    id: 21
                    name: Active Members
                  frequency:
                    value: monthly
                    label: Monthly
                  start_date: '2026-07-15'
                  end_date: '2026-09-15'
                  day_of_week: null
                  day_of_month: 15
                  terms: Monthly on the 15th
                  is_run_immediately: false
                  created_at: '2026-07-06T12:00:00.000000Z'
                  updated_at: '2026-07-06T12:05:00.000000Z'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    StoreEcomailhubCommunicationCampaignRequest:
      type: object
      required:
        - template_id
        - group_id
        - frequency
        - start_date
      properties:
        template_id:
          type: integer
          example: 15
        group_id:
          type: integer
          example: 21
        frequency:
          type: string
          enum:
            - once
            - daily
            - weekly
            - monthly
          example: weekly
        start_date:
          type: string
          format: date
          description: Must be tomorrow or later and no more than one year from today.
          example: '2026-07-13'
        end_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Required for daily, weekly, and monthly campaigns. Must be on or
            after start_date and no more than one year after start_date.
          example: '2026-08-13'
        day_of_week:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 6
          description: >-
            Required when frequency is weekly. Uses 0 for Sunday through 6 for
            Saturday.
          example: 1
        day_of_month:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 31
          description: Required when frequency is monthly.
          example: 15
    EcomailhubCommunicationCampaignMutationResponse:
      allOf:
        - $ref: '#/components/schemas/MessageResponse'
        - type: object
          required:
            - data
          properties:
            data:
              $ref: '#/components/schemas/EcomailhubCommunicationCampaign'
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    EcomailhubCommunicationCampaign:
      type: object
      required:
        - id
        - template_id
        - group_id
        - template
        - group
        - frequency
        - start_date
        - end_date
        - day_of_week
        - day_of_month
        - terms
        - is_run_immediately
        - created_at
        - updated_at
      properties:
        id:
          type: integer
          example: 33
        template_id:
          type: integer
          example: 15
        group_id:
          type: integer
          example: 21
        template:
          oneOf:
            - $ref: '#/components/schemas/EcomailhubCommunicationCampaignRelation'
            - type: 'null'
        group:
          oneOf:
            - $ref: '#/components/schemas/EcomailhubCommunicationCampaignRelation'
            - type: 'null'
        frequency:
          $ref: '#/components/schemas/EcomailhubCommunicationCampaignStringOption'
        start_date:
          type:
            - string
            - 'null'
          format: date
          example: '2026-07-13'
        end_date:
          type:
            - string
            - 'null'
          format: date
          example: '2026-08-13'
        day_of_week:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 6
          example: 1
        day_of_month:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 31
          example: null
        terms:
          type: string
          example: Weekly on Monday
        is_run_immediately:
          type: boolean
          example: false
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-07-06T12:00:00.000000Z'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-07-06T12:05:00.000000Z'
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    EcomailhubCommunicationCampaignRelation:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: integer
          example: 15
        name:
          type: string
          example: Welcome Creditor
    EcomailhubCommunicationCampaignStringOption:
      type: object
      required:
        - value
        - label
      properties:
        value:
          type: string
          example: weekly
        label:
          type: string
          example: Weekly
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            message: Unauthenticated.
    NotFound:
      description: Requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
          example:
            message: Not Found.
    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

````