> ## 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 message in-app en brouillon



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/in-app-messages
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/in-app-messages:
    post:
      tags:
        - In-app
      summary: Crée un message in-app en brouillon
      operationId: InAppController_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
                audience:
                  type: object
                  properties:
                    segmentId:
                      type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    excludedSegmentIds:
                      default: []
                      maxItems: 10
                      type: array
                      items:
                        type: string
                        pattern: ^[0-9a-fA-F]{24}$
                  required:
                    - segmentId
                editor:
                  type: string
                  enum:
                    - blocks
                    - html
                layout:
                  type: string
                  enum:
                    - top
                    - center
                    - bottom
                    - full
                defaultLocale:
                  type: string
                  minLength: 2
                  maxLength: 10
                  pattern: ^[a-z]{2,3}(-[A-Za-z]{2,4})?$
                contents:
                  type: object
                  propertyNames:
                    type: string
                    minLength: 2
                    maxLength: 10
                    pattern: ^[a-z]{2,3}(-[A-Za-z]{2,4})?$
                  additionalProperties:
                    type: object
                    properties:
                      blocks:
                        maxItems: 20
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,39}$
                                type:
                                  type: string
                                  const: text
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 500
                                variant:
                                  type: string
                                  enum:
                                    - title
                                    - body
                                    - caption
                                align:
                                  type: string
                                  enum:
                                    - start
                                    - center
                                    - end
                                color:
                                  type: string
                                  pattern: ^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$
                              required:
                                - id
                                - type
                                - text
                                - variant
                                - align
                                - color
                            - type: object
                              properties:
                                id:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,39}$
                                type:
                                  type: string
                                  const: image
                                url:
                                  type: string
                                  maxLength: 2000
                                  format: uri
                                alt:
                                  type: string
                                  maxLength: 200
                                aspectRatio:
                                  type: string
                                  enum:
                                    - '16:9'
                                    - '4:3'
                                    - '1:1'
                                    - '3:4'
                                action:
                                  oneOf:
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: close
                                      required:
                                        - kind
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: deeplink
                                        url:
                                          type: string
                                          maxLength: 500
                                          pattern: ^[a-zA-Z][a-zA-Z0-9+.-]*:\S+$
                                      required:
                                        - kind
                                        - url
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: url
                                        url:
                                          type: string
                                          maxLength: 2000
                                          format: uri
                                      required:
                                        - kind
                                        - url
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: tag
                                        key:
                                          type: string
                                        value:
                                          type: string
                                          maxLength: 255
                                      required:
                                        - kind
                                        - key
                                        - value
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: push_prompt
                                      required:
                                        - kind
                              required:
                                - id
                                - type
                                - url
                                - aspectRatio
                            - type: object
                              properties:
                                id:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,39}$
                                type:
                                  type: string
                                  const: button
                                label:
                                  type: string
                                  minLength: 1
                                  maxLength: 60
                                action:
                                  oneOf:
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: close
                                      required:
                                        - kind
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: deeplink
                                        url:
                                          type: string
                                          maxLength: 500
                                          pattern: ^[a-zA-Z][a-zA-Z0-9+.-]*:\S+$
                                      required:
                                        - kind
                                        - url
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: url
                                        url:
                                          type: string
                                          maxLength: 2000
                                          format: uri
                                      required:
                                        - kind
                                        - url
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: tag
                                        key:
                                          type: string
                                        value:
                                          type: string
                                          maxLength: 255
                                      required:
                                        - kind
                                        - key
                                        - value
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: push_prompt
                                      required:
                                        - kind
                                background:
                                  type: string
                                  pattern: ^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$
                                color:
                                  type: string
                                  pattern: ^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$
                                radius:
                                  type: integer
                                  minimum: 0
                                  maximum: 40
                              required:
                                - id
                                - type
                                - label
                                - action
                                - background
                                - color
                                - radius
                            - type: object
                              properties:
                                id:
                                  type: string
                                  pattern: ^[a-z0-9][a-z0-9_-]{0,39}$
                                type:
                                  type: string
                                  const: html
                                html:
                                  type: string
                                  minLength: 1
                                  maxLength: 100000
                                height:
                                  type: integer
                                  minimum: 20
                                  maximum: 2000
                              required:
                                - id
                                - type
                                - html
                      html:
                        type: string
                        minLength: 1
                        maxLength: 100000
                style:
                  type: object
                  properties:
                    background:
                      type: string
                      pattern: ^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$
                    closeButton:
                      type: boolean
                    dismissAfterSeconds:
                      type: integer
                      minimum: 1
                      maximum: 600
                    radius:
                      type: integer
                      minimum: 0
                      maximum: 40
                  required:
                    - background
                    - closeButton
                    - radius
                triggers:
                  type: object
                  properties:
                    groups:
                      minItems: 1
                      maxItems: 5
                      type: array
                      items:
                        minItems: 1
                        maxItems: 5
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: app_open
                                delaySeconds:
                                  type: integer
                                  minimum: 0
                                  maximum: 300
                              required:
                                - kind
                                - delaySeconds
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: session_count
                                operator:
                                  type: string
                                  enum:
                                    - gte
                                    - lte
                                    - eq
                                value:
                                  type: integer
                                  minimum: 1
                                  maximum: 100000
                              required:
                                - kind
                                - operator
                                - value
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: session_duration
                                seconds:
                                  type: integer
                                  minimum: 1
                                  maximum: 86400
                              required:
                                - kind
                                - seconds
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: event
                                name:
                                  type: string
                                  pattern: ^[A-Za-z0-9_.:-]{1,64}$
                                atLeast:
                                  type: integer
                                  minimum: 1
                                  maximum: 1000
                              required:
                                - kind
                                - name
                                - atLeast
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: custom
                                key:
                                  type: string
                                operator:
                                  type: string
                                  enum:
                                    - eq
                                    - ne
                                    - gt
                                    - gte
                                    - lt
                                    - lte
                                    - exists
                                    - not_exists
                                    - contains
                                value:
                                  type: string
                                  maxLength: 255
                              required:
                                - kind
                                - key
                                - operator
                  required:
                    - groups
                frequency:
                  oneOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: once
                      required:
                        - kind
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: every_trigger
                      required:
                        - kind
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: repeat
                        limit:
                          type: integer
                          minimum: 2
                          maximum: 100
                        gapMinutes:
                          type: integer
                          minimum: 1
                          maximum: 525600
                      required:
                        - kind
                        - limit
                        - gapMinutes
                priority:
                  default: 0
                  type: integer
                  minimum: 0
                  maximum: 100
                startAt:
                  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'
                endAt:
                  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'
              required:
                - name
                - audience
                - editor
                - layout
                - defaultLocale
                - contents
                - style
                - triggers
                - frequency
      responses:
        '201':
          description: Brouillon créé
      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.