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

# Modifie un brouillon ou une campagne programmée



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/campaigns/{campaignId}
openapi: 3.1.0
info:
  title: API DexNotify
  version: '1'
  description: >-
    SMS, e-mail, WhatsApp, notifications push, contacts et campagnes, par une
    seule API. Authentification par clé API dans l’en-tête `x-api-key`.
servers:
  - url: https://api.dexnotify.com
    description: Production et staging
security:
  - api-key: []
tags:
  - name: SMS
  - name: E-mail
  - name: WhatsApp
  - name: Contacts
  - name: Listes de contacts
  - name: Campagnes
  - name: Modèles e-mail
  - name: Automatisations
  - name: Notifications push
  - name: Campagnes push
  - name: Journal des messages
  - name: In-app
  - name: Live Activities
  - name: Utilisateurs et appareils
  - name: Segments
  - name: Modèles push
  - name: Événements
  - name: Statistiques
paths:
  /api/v1/campaigns/{campaignId}:
    patch:
      tags:
        - Campagnes push
      summary: Modifie un brouillon ou une campagne programmée
      operationId: CampaignsController_update_v1
      parameters:
        - name: campaignId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 2
                  maxLength: 120
                labels:
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 40
                platforms:
                  anyOf:
                    - minItems: 1
                      maxItems: 3
                      type: array
                      items:
                        type: string
                        enum:
                          - android
                          - ios
                          - web
                    - type: 'null'
                push:
                  anyOf:
                    - type: object
                      properties:
                        priority:
                          type: string
                          enum:
                            - normal
                            - high
                        ttlSeconds:
                          type: integer
                          minimum: 0
                          maximum: 2419200
                        collapseId:
                          type: string
                          minLength: 1
                          maxLength: 64
                        ios:
                          type: object
                          properties:
                            sound:
                              type: string
                              minLength: 1
                              maxLength: 64
                            badgeCount:
                              type: integer
                              minimum: 0
                              maximum: 9999
                            interruptionLevel:
                              type: string
                              enum:
                                - passive
                                - active
                                - time-sensitive
                            threadId:
                              type: string
                              minLength: 1
                              maxLength: 64
                            relevanceScore:
                              type: number
                              minimum: 0
                              maximum: 1
                        android:
                          type: object
                          properties:
                            channelId:
                              type: string
                              minLength: 1
                              maxLength: 64
                            sound:
                              type: string
                              minLength: 1
                              maxLength: 64
                            color:
                              type: string
                              pattern: ^#[0-9a-fA-F]{6}$
                            smallIcon:
                              type: string
                              minLength: 1
                              maxLength: 64
                        web:
                          type: object
                          properties:
                            icon:
                              type: string
                              format: uri
                            requireInteraction:
                              type: boolean
                    - type: 'null'
                applicationIds:
                  minItems: 1
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    pattern: ^(?:[0-9a-fA-F]{24}|[A-Z0-9]{1,16}-[0-9]{6})$
                segmentId:
                  anyOf:
                    - type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    - type: 'null'
                excludedSegmentIds:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[0-9a-fA-F]{24}$
                templateId:
                  anyOf:
                    - type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    - type: 'null'
                content:
                  anyOf:
                    - type: object
                      properties:
                        title:
                          type: string
                          minLength: 1
                          maxLength: 120
                        subtitle:
                          type: string
                          minLength: 1
                          maxLength: 120
                        body:
                          type: string
                          minLength: 1
                          maxLength: 1000
                        imageUrl:
                          type: string
                          format: uri
                        deeplink:
                          type: string
                          minLength: 1
                          maxLength: 500
                        webUrl:
                          type: string
                          format: uri
                        data:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                      required:
                        - title
                        - body
                    - type: 'null'
                scheduledAt:
                  anyOf:
                    - type: string
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    - type: 'null'
                abTest:
                  anyOf:
                    - type: object
                      properties:
                        variants:
                          minItems: 2
                          maxItems: 4
                          type: array
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 8
                              label:
                                type: string
                                minLength: 2
                                maxLength: 120
                              share:
                                type: integer
                                minimum: 1
                                maximum: 99
                              templateId:
                                type: string
                                pattern: ^[0-9a-fA-F]{24}$
                              content:
                                type: object
                                properties:
                                  title:
                                    type: string
                                    minLength: 1
                                    maxLength: 120
                                  subtitle:
                                    type: string
                                    minLength: 1
                                    maxLength: 120
                                  body:
                                    type: string
                                    minLength: 1
                                    maxLength: 1000
                                  imageUrl:
                                    type: string
                                    format: uri
                                  deeplink:
                                    type: string
                                    minLength: 1
                                    maxLength: 500
                                  webUrl:
                                    type: string
                                    format: uri
                                  data:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                required:
                                  - title
                                  - body
                            required:
                              - key
                              - label
                              - share
                        metric:
                          default: click_rate
                          type: string
                          enum:
                            - click_rate
                            - open_rate
                        decideAfterHours:
                          default: 6
                          type: integer
                          minimum: 1
                          maximum: 168
                      required:
                        - variants
                    - type: 'null'
                conversionGoal:
                  anyOf:
                    - type: object
                      properties:
                        event:
                          type: string
                          minLength: 1
                          maxLength: 120
                        attributionWindowHours:
                          type: integer
                          minimum: 1
                          maximum: 720
                      required:
                        - event
                        - attributionWindowHours
                    - type: 'null'
                delivery:
                  type: object
                  properties:
                    priority:
                      type: string
                      enum:
                        - normal
                        - high
                    throughputPerMinute:
                      type: integer
                      minimum: 1
                      maximum: 1000000
                    frequencyCap:
                      type: object
                      properties:
                        max:
                          type: integer
                          minimum: 1
                          maximum: 100
                        perHours:
                          type: integer
                          minimum: 1
                          maximum: 720
                      required:
                        - max
                        - perHours
                    expiresAfterHours:
                      type: integer
                      minimum: 1
                      maximum: 720
                    timezoneMode:
                      default: user_local
                      type: string
                      enum:
                        - user_local
                        - project
                  required:
                    - throughputPerMinute
                    - expiresAfterHours
      responses:
        '409':
          description: Campagne déjà passée à l’envoi ou conclue
      security:
        - api-key: []
components:
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Clé API du projet, créée dans le dashboard (Développeurs › Clés API et
        SDK). Une clé `dxn_prod_` vise la production, une clé `dxn_stag_` le
        staging.

````

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