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

# Update Campaign

> Updates a Specific Campaign

NOTE: When updating a campaign with A/B testing enabled,  the version_b status param (1 or 2) must be included to ensure that parameters shared by A and B  versions are updated in both campaigns (schedule_date, segments, automation, automation_end, push_ttl, auto_hide, tz_delivery, status). When updating the status of a campaign with A/B testing enabled, both the status param and the version_b status param must be set.



## OpenAPI

````yaml /api-reference/push-openapi.json put /prod/campaign/{id}
openapi: 3.1.0
info:
  title: push-notifications
  version: '1.1'
servers:
  - url: https://api.aimtell.com
security:
  - sec0: []
tags:
  - name: One-Off Notifications
    description: Send individual push notifications
  - name: Welcome Notifications
    description: Welcome notification campaigns
  - name: Triggered Campaigns
    description: Event-triggered push notification campaigns
  - name: RSS Campaigns
    description: RSS feed-based push notification campaigns
  - name: Manual Campaigns
    description: Manually created push notification campaigns
  - name: API Campaigns
    description: API-triggered push notification campaigns
paths:
  /prod/campaign/{id}:
    put:
      tags:
        - Manual Campaigns
      summary: Update Campaign
      description: >-
        Updates a Specific Campaign


        NOTE: When updating a campaign with A/B testing enabled,  the version_b
        status param (1 or 2) must be included to ensure that parameters shared
        by A and B  versions are updated in both campaigns (schedule_date,
        segments, automation, automation_end, push_ttl, auto_hide, tz_delivery,
        status). When updating the status of a campaign with A/B testing
        enabled, both the status param and the version_b status param must be
        set.
      operationId: update-campaign
      parameters:
        - name: id
          in: path
          description: Campaign ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of Campaign
                title:
                  type: string
                  description: Push Title
                body:
                  type: string
                  description: Push Body
                link:
                  type: string
                  description: Push Link
                schedule_date:
                  type: string
                  description: DateTime (i.e. 2017-08-25 21:16:50)
                  format: date
                segments:
                  type: string
                  description: Segments
                automation:
                  type: string
                  description: Automation (d = daily, w = weekly, m = monthly, n = none)
                automation_end:
                  type: string
                  description: Automation End Date (e.g. 2017-08-25 17:00:00)
                  format: date
                push_ttl:
                  type: integer
                  description: Expiration Time (in seconds)
                auto_hide:
                  type: integer
                  description: Auto Hide (in seconds)
                collapse_key:
                  type: string
                  description: >-
                    replace visible notifications on a subscribers device
                    replace visible notifications on a subscribers device (e.g.
                    breaking_news)
                tz_delivery:
                  type: integer
                  description: >-
                    deliver based on user's timezone (set 0 for false, 1 for
                    true)
                customIcon:
                  type: string
                  description: 'url of custom icon to use (recommended size: 250x250)'
                customImage:
                  type: string
                  description: 'url of custom image to use (recommended size: 300x500)'
                status:
                  type: integer
                  description: set 1 for draft, 2 for scheduled
                  default: 1
                version_b:
                  type: object
                  description: (optional) Version B for A/B test campaign
                  properties:
                    status:
                      type: integer
                      description: set 1 for draft, 2 for scheduled (must match version a)
                    title:
                      type: string
                      description: (version b) push title
                    body:
                      type: string
                      description: (version b) push body
                    link:
                      type: string
                      description: (version b) push link
                    customIcon:
                      type: string
                      description: >-
                        (version b)  string url of custom icon to use
                        (recommended size: 250x250)
                    customImage:
                      type: string
                      description: >-
                        (version b) url of custom image to use (recommended
                        size: 300x500)
                    actions:
                      type: object
                      description: action buttons
                      properties:
                        a01:
                          type: object
                          properties:
                            title:
                              type: string
                              description: Text of action button
                            link:
                              type: string
                              description: Link/URL of action when clicked
                        a02:
                          type: object
                          properties:
                            title:
                              type: string
                              description: Text of action button
                            link:
                              type: string
                              description: Link/URL of action when clicked
                conversion_trigger:
                  type: object
                  properties:
                    eventCategory:
                      type: string
                      description: Category of event
                    eventAction:
                      type: string
                      description: Action of event
                actions:
                  type: object
                  description: action buttons
                  properties:
                    a01:
                      type: object
                      properties:
                        title:
                          type: string
                          description: Text of action button
                        link:
                          type: string
                          description: Link/URL of action when clicked
                    a02:
                      type: object
                      properties:
                        title:
                          type: string
                          description: Text of action button
                        link:
                          type: string
                          description: Link/URL of action when clicked
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    result: success
                    campaignId: '133321'
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    result: error
                    message: 'Error #136.'
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value:
                    result: error
                    message: Please specify a valid auth_token.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      name: X-Authorization-Api-Key
      in: header
      x-default: ''

````