> ## 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.

# Crée un brouillon

> Crée un brouillon ; son audience est estimée et datée



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/campaigns
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:
    post:
      tags:
        - Campagnes push
      summary: Crée un brouillon ; son audience est estimée et datée
      operationId: CampaignsController_create_v1
      parameters: []
      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:
                  minItems: 1
                  maxItems: 3
                  type: array
                  items:
                    type: string
                    enum:
                      - android
                      - ios
                      - web
                push:
                  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
                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:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                excludedSegmentIds:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[0-9a-fA-F]{24}$
                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
                scheduledAt:
                  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))$
                abTest:
                  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
                conversionGoal:
                  type: object
                  properties:
                    event:
                      type: string
                      minLength: 1
                      maxLength: 120
                    attributionWindowHours:
                      type: integer
                      minimum: 1
                      maximum: 720
                  required:
                    - event
                    - attributionWindowHours
                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
              required:
                - name
                - applicationIds
      responses:
        '201':
          description: Campagne créée en brouillon
      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.