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

# Update Push Campaign

> Update content, platforms, audiences, template selection, and platform configuration. Scheduling and launch are not accepted.



## OpenAPI

````yaml api-reference/openapi.json PATCH /push/campaigns/{id}
openapi: 3.0.1
info:
  title: Sendrealm API
  description: >-
    API for email, push, audience resources, domains, campaign drafts,
    templates, events, topics, and automations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sendrealm.com
security:
  - bearerAuth: []
paths:
  /push/campaigns/{id}:
    patch:
      summary: Update a push campaign draft
      description: >-
        Update content, platforms, audiences, template selection, and platform
        configuration. Scheduling and launch are not accepted.
      parameters:
        - $ref: '#/components/parameters/Id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushCampaignUpdate'
      responses:
        '200':
          description: Push campaign draft updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushCampaignResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    PushCampaignUpdate:
      type: object
      minProperties: 1
      properties:
        name:
          type: string
          maxLength: 120
        environment:
          type: string
          enum:
            - production
            - development
        messages:
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: object
            required:
              - code
              - title
              - body
            properties:
              code:
                type: string
              label:
                type: string
              title:
                type: string
                maxLength: 120
              body:
                type: string
                maxLength: 240
              image_url:
                type: string
                format: uri
              launch_url:
                type: string
                maxLength: 2048
        audience:
          type: object
          properties:
            type:
              type: string
              enum:
                - subscribed
                - audiences
            include_audience_ids:
              type: array
              items:
                type: string
                format: uuid
            exclude_audience_ids:
              type: array
              items:
                type: string
                format: uuid
        platforms:
          type: object
          properties:
            android:
              type: boolean
            ios:
              type: boolean
            web:
              type: boolean
        mode:
          type: string
          enum:
            - standard
            - live_activity
        buttons:
          type: array
          maxItems: 3
          items:
            $ref: '#/components/schemas/PushActionButton'
        template_version_id:
          type: string
          format: uuid
          nullable: true
        android_config:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        live_activity_config:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          nullable: true
    PushCampaignResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: integer
          description: HTTP response status code
        data:
          $ref: '#/components/schemas/PushCampaign'
    PushActionButton:
      type: object
      required:
        - id
      additionalProperties: false
      anyOf:
        - type: object
          required:
            - text
        - type: object
          required:
            - title
      properties:
        id:
          type: string
        text:
          type: string
        title:
          type: string
          description: Deprecated alias for text.
        icon:
          type: string
        launch_url:
          type: string
          maxLength: 2048
    JsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
    PushCampaign:
      type: object
      required:
        - id
        - app_id
        - app_name
        - name
        - status
        - channel
        - targeting
        - mode
        - environment
        - messages
        - buttons
        - platforms
        - audience
        - template_version_id
        - android_config
        - live_activity_config
        - is_editable
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        app_id:
          type: string
          nullable: true
        app_name:
          type: string
          nullable: true
        name:
          type: string
        status:
          type: string
        channel:
          type: string
          enum:
            - push
        targeting:
          $ref: '#/components/schemas/JsonObject'
        mode:
          type: string
        environment:
          type: string
        messages:
          type: array
          items:
            $ref: '#/components/schemas/PushCampaignMessage'
        buttons:
          type: array
          items:
            $ref: '#/components/schemas/PushActionButton'
        platforms:
          type: object
          required:
            - android
            - ios
            - web
          properties:
            android:
              type: boolean
            ios:
              type: boolean
            web:
              type: boolean
        audience:
          type: object
          required:
            - type
            - include_audience_ids
            - exclude_audience_ids
          properties:
            type:
              type: string
            include_audience_ids:
              type: array
              items:
                type: string
                format: uuid
            exclude_audience_ids:
              type: array
              items:
                type: string
                format: uuid
        template_version_id:
          type: string
          format: uuid
          nullable: true
        android_config:
          $ref: '#/components/schemas/JsonObject'
        live_activity_config:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/JsonObject'
        is_editable:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              $ref: '#/components/schemas/JsonValue'
            issues:
              type: array
              items:
                $ref: '#/components/schemas/ValidationIssue'
    JsonObject:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
    PushCampaignMessage:
      type: object
      required:
        - code
        - label
        - title
        - body
        - image_url
        - launch_url
      properties:
        code:
          type: string
        label:
          type: string
        title:
          type: string
        body:
          type: string
        image_url:
          type: string
          format: uri
          nullable: true
        launch_url:
          type: string
          nullable: true
    ValidationIssue:
      type: object
      required:
        - code
        - path
        - message
      properties:
        code:
          type: string
        path:
          type: string
          nullable: true
        message:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Resource conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````