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

# Change a campaign

> Changes what you send of a campaign's settings; null clears a setting. A published campaign can be changed only with campaigns:publish too (a 403 otherwise), and a change it can't send with returns 422.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/campaigns/{campaign_id}
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/campaigns/{campaign_id}:
    patch:
      tags:
        - campaigns
      summary: Change a campaign
      description: >-
        Changes what you send of a campaign's settings; null clears a setting. A
        published campaign can be changed only with campaigns:publish too (a 403
        otherwise), and a change it can't send with returns 422.
      operationId: campaigns_update
      parameters:
        - description: The campaign's id, from GET /v1/campaigns
          in: path
          name: campaign_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                audience_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: A contact view, from GET /v1/campaigns/audiences
                  title: Audience Id
                bcc_emails:
                  anyOf:
                    - items:
                        maxLength: 320
                        minLength: 3
                        pattern: ^[^@\s,]+@[^@\s,]+$
                        type: string
                      maxItems: 50
                      type: array
                    - type: 'null'
                  default: null
                  title: Bcc Emails
                bcc_roles:
                  anyOf:
                    - items:
                        $ref: '#/components/schemas/RoleRef'
                      maxItems: 20
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    An account role, from GET /v1/campaigns/roles: for each
                    recipient, the person in that role on the recipient's
                    account
                  title: Bcc Roles
                cc_emails:
                  anyOf:
                    - items:
                        maxLength: 320
                        minLength: 3
                        pattern: ^[^@\s,]+@[^@\s,]+$
                        type: string
                      maxItems: 50
                      type: array
                    - type: 'null'
                  default: null
                  title: Cc Emails
                cc_roles:
                  anyOf:
                    - items:
                        $ref: '#/components/schemas/RoleRef'
                      maxItems: 20
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    An account role, from GET /v1/campaigns/roles: for each
                    recipient, the person in that role on the recipient's
                    account
                  title: Cc Roles
                description:
                  anyOf:
                    - maxLength: 2000
                      type: string
                    - type: 'null'
                  default: null
                  title: Description
                end_date:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                  default: null
                  description: When it stops sending
                  title: End Date
                name:
                  default: null
                  description: Unique in the workspace
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
                reminder_days:
                  anyOf:
                    - maximum: 365
                      minimum: 1
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    Survey campaigns: days before a contact who hasn't answered
                    gets the survey again
                  title: Reminder Days
                send_hour:
                  anyOf:
                    - maximum: 23
                      minimum: 0
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    The hour (0-23) sends start each day, in send_timezone. Set
                    both, or neither (any hour)
                  title: Send Hour
                send_timezone:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: An IANA time zone, such as Europe/London
                  title: Send Timezone
                sender_role:
                  anyOf:
                    - $ref: '#/components/schemas/RoleRef'
                    - type: 'null'
                  default: null
                  description: >-
                    Send from the person in this role on each recipient's
                    account, instead of the template's or survey's sender. A
                    recipient whose account has no one in the role gets the
                    template's or survey's sender
                skip_weekends:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Skip Weekends
                start_date:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                  default: null
                  description: When it starts sending
                  title: Start Date
                survey_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: 'Survey campaigns: the survey, from GET /v1/surveys'
                  title: Survey Id
                template_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: 'Email campaigns: a published email template'
                  title: Template Id
                type:
                  default: null
                  description: >-
                    email sends an email template; survey sends a survey's
                    email, with the recipient's link to the survey
                  enum:
                    - email
                    - survey
                  title: Type
                  type: string
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    RoleRef:
      properties:
        field_id:
          description: >-
            An account role, from GET /v1/campaigns/roles: for each recipient,
            the person in that role on the recipient's account
          title: Field Id
          type: string
      required:
        - field_id
      title: RoleRef
      type: object
    Campaign:
      properties:
        audience_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Who it''s sent to: a contact view, from GET /v1/campaigns/audiences'
          title: Audience Id
        bcc_emails:
          items:
            type: string
          title: Bcc Emails
          type: array
        bcc_roles:
          items:
            $ref: '#/components/schemas/Role'
          title: Bcc Roles
          type: array
        cc_emails:
          items:
            type: string
          title: Cc Emails
          type: array
        cc_roles:
          items:
            $ref: '#/components/schemas/Role'
          title: Cc Roles
          type: array
        created_at:
          format: date-time
          title: Created At
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        end_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: End Date
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        reminder_days:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Survey campaigns: days before a contact who hasn't answered gets the
            survey again
          title: Reminder Days
        send_hour:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            The hour (0-23) sends start each day, in send_timezone. Set both, or
            neither (any hour)
          title: Send Hour
        send_timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Send Timezone
        sender_role:
          anyOf:
            - $ref: '#/components/schemas/Role'
            - type: 'null'
          description: >-
            Send from the person in this role on each recipient's account,
            instead of the template's or survey's sender. A recipient whose
            account has no one in the role gets the template's or survey's
            sender
        skip_weekends:
          title: Skip Weekends
          type: boolean
        start_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Start Date
        state:
          description: >-
            draft or published. A published campaign sends each hour, between
            its start and end dates, to the contacts in its audience it has not
            reached
          enum:
            - draft
            - published
          title: State
          type: string
        survey_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Survey campaigns: the survey, from GET /v1/surveys'
          title: Survey Id
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Email campaigns: the email template, from GET /v1/templates'
          title: Template Id
        type:
          description: >-
            email sends an email template; survey sends a survey's email, with
            the recipient's link to the survey
          enum:
            - email
            - survey
          title: Type
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
      required:
        - id
        - name
        - type
        - description
        - state
        - start_date
        - end_date
        - survey_id
        - template_id
        - audience_id
        - sender_role
        - cc_emails
        - bcc_emails
        - cc_roles
        - bcc_roles
        - reminder_days
        - skip_weekends
        - send_hour
        - send_timezone
        - created_at
        - updated_at
      title: Campaign
      type: object
    Role:
      properties:
        field_id:
          description: The role's account field id
          title: Field Id
          type: string
        name:
          title: Name
          type: string
      required:
        - field_id
        - name
      title: Role
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.