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

# Update a campaign



## OpenAPI

````yaml /openapi.json patch /public/v1/campaigns/{id}
openapi: 3.0.0
info:
  title: Hostreach API
  description: >-
    Public REST API for Hostreach.


    Authenticate with an API key via the `X-Api-Key` header or `Authorization:
    Bearer <key>` header.


    Generate API keys from **Settings › Workspace › Acceso API** in the
    dashboard.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hostreach.io/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local
security:
  - apiKey: []
tags:
  - name: Identity
    description: Current workspace and usage
  - name: Platforms
    description: Supported real-estate portals and filter schemas
  - name: Extractions
    description: Lead extraction jobs
  - name: Leads
    description: Lead management
  - name: Campaigns
    description: Campaign management
  - name: Messaging
    description: Inbox and WhatsApp conversations
  - name: Templates
    description: WhatsApp message templates
  - name: Accounts
    description: WhatsApp accounts
  - name: Valuations
    description: Property valuations
  - name: Fichas
    description: Property listing sheets
  - name: Scheduling
    description: Calendar and appointments
  - name: Webhooks
    description: Event subscriptions
paths:
  /public/v1/campaigns/{id}:
    patch:
      tags:
        - Campaigns
      summary: Update a campaign
      operationId: PublicCampaignsController_updateCampaign
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignDto'
      responses:
        '200':
          description: ''
      security:
        - bearerApiKey: []
        - apiKey: []
components:
  schemas:
    UpdateCampaignDto:
      type: object
      properties:
        name:
          type: string
          description: New campaign name.
          maxLength: 255
          example: Valencia Q3 2026
        mode:
          type: string
          description: >-
            `extract_only`: scrape only. `extract_and_contact`: scrape + send
            WhatsApp sequence. Forced to `extract_and_contact` for csv_import
            and widget.
          enum:
            - extract_only
            - extract_and_contact
          example: extract_and_contact
        platform:
          type: string
          description: Change the platform (portal source) for this campaign.
          enum:
            - idealista
            - fotocasa
            - metrocuadrado
            - inmuebles24
            - zonaprop
            - widget
            - csv_import
          example: fotocasa
        contactMode:
          type: string
          description: >-
            Outreach channel. `whatsapp` requires a connected WhatsApp Business
            account.
          enum:
            - whatsapp
            - whatsapp-no-api
          example: whatsapp
        segmentation:
          type: object
          description: >-
            Platform-specific segmentation object.


            - Portal: `{ filters: <portal-filter-object>, expectedResults: 50
            }`.

            - CSV import: `{ batchSize: 10 }` (integer 1–25, required before
            going running).

            - Widget: leave empty.
          example:
            filters:
              operation: rent
            expectedResults: 50
        settings:
          description: Scheduling and AI messaging settings.
          allOf:
            - dfa9809b-7fe8-4761-b9e1-edacb4418f8e
        allUrlsChecked:
          type: boolean
          description: Mark incremental sync as completed for this campaign run.
          example: false
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key (hr_live_... or hr_test_...). Generate from Settings › Workspace
        › Acceso API.

````