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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Créer une campagne

> Crée une nouvelle campagne de communication pour la récupération des paiements refusés, avec le statut INACTIVE par défaut.

Crée une nouvelle campagne. Si aucun `status` n'est fourni, les campagnes sont créées par défaut avec le statut `INACTIVE`.

Consultez la [référence de l'objet campagne](https://docs.y.uno/fr/reference/communications-campaigns.md#campaign-object)  pour plus d'informations.


## OpenAPI

````yaml openapi/fr/communications-campaigns/create-campaign.json POST /campaigns
openapi: 3.0.0
info:
  version: 1.0.0
  title: Communications Campaigns
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - public-api-key: []
    private-secret-key: []
paths:
  /campaigns:
    post:
      operationId: post_campaigns
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Nom de la campagne, pour l'identifier.
                account_id:
                  type: string
                  description: >-
                    L'ID de votre compte Yuno, disponible dans le [Dashboard
                    Yuno](https://dashboard.y.uno/developers) (UUID).
                organization_code:
                  type: string
                  description: L'identifiant de votre organisation (UUID).
                country:
                  type: string
                  description: >-
                    Code pays ISO 3166-1 alpha-2 (par exemple, `CO`, `MX`,
                    `BR`).
                channel:
                  type: string
                  description: Canal de communication.
                  enum:
                    - WHATSAPP_MESSAGE
                    - PHONE_CALL
                focus:
                  type: string
                  description: >-
                    Descripteur de l'objectif de la campagne (par exemple,
                    `payment_recovery`).
                schedule:
                  type: object
                  properties:
                    daily_start_time:
                      type: string
                      description: Début de la plage d'envoi quotidienne au format `HH:MM`.
                    daily_end_time:
                      type: string
                      description: Fin de la plage d'envoi quotidienne au format `HH:MM`.
                    time_zone:
                      type: string
                      description: >-
                        Fuseau horaire IANA (par exemple, `America/Bogota`) ou
                        décalage UTC (par exemple, `-05:00`)
                  required:
                    - daily_start_time
                    - daily_end_time
                    - time_zone
                  description: Configuration de la planification.
                duration:
                  type: object
                  properties:
                    start_at:
                      type: string
                      description: Date de début de la campagne au format ISO 8601.
                    end_at:
                      type: string
                      description: >-
                        Date de fin de la campagne au format ISO 8601. Doit être
                        postérieure à `start_at`.
                  required:
                    - end_at
                    - start_at
                  description: Période d'activité de la campagne.
              required:
                - name
                - duration
                - schedule
                - channel
                - country
                - organization_code
                - account_id
            examples:
              Basic declined payment recovery:
                summary: Basic declined payment recovery
                value:
                  name: Mexico Card Recovery
                  account_id: YOUR_ACCOUNT_ID
                  organization_code: YOUR_ORGANIZATION_CODE
                  country: MX
                  channel: WHATSAPP_MESSAGE
                  focus: payment_recovery
                  schedule:
                    daily_start_time: '09:00'
                    daily_end_time: '20:00'
                    time_zone: America/Mexico_City
                  duration:
                    start_at: '2025-08-01T00:00:00Z'
                    end_at: '2026-08-01T00:00:00Z'
              High-value transaction recovery via phone call:
                summary: High-value transaction recovery via phone call
                value:
                  name: High Value Recovery - Phone
                  account_id: YOUR_ACCOUNT_ID
                  organization_code: YOUR_ORGANIZATION_CODE
                  country: CO
                  channel: PHONE_CALL
                  focus: payment_recovery
                  schedule:
                    daily_start_time: '09:00'
                    daily_end_time: '18:00'
                    time_zone: America/Bogota
                  duration:
                    start_at: '2025-08-01T00:00:00Z'
                    end_at: '2026-08-01T00:00:00Z'
      responses:
        '200':
          description: ''
        '201':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      name:
                        type: string
                        example: Declined Payment Recovery - Colombia
                      account_id:
                        type: string
                        example: 2404911d-5df9-429e-8488-ad41abea1a4b
                      organization_code:
                        type: string
                        example: 550e8400-e29b-41d4-a716-446655440000
                      country:
                        type: string
                        example: CO
                      channel:
                        type: string
                        example: WHATSAPP_MESSAGE
                      schedule:
                        type: object
                        properties:
                          daily_start_time:
                            type: string
                            example: '08:00'
                          daily_end_time:
                            type: string
                            example: '21:00'
                          time_zone:
                            type: string
                            example: America/Bogota
                      duration:
                        type: object
                        properties:
                          start_at:
                            type: string
                            example: '2025-07-01T00:00:00Z'
                          end_at:
                            type: string
                            example: '2026-07-01T00:00:00Z'
                      status:
                        type: string
                        example: ACTIVE
                      created_at:
                        type: string
                        example: '2025-07-01T12:00:00Z'
                      updated_at:
                        type: string
                        example: '2025-07-01T12:00:00Z'
              examples:
                Created:
                  summary: Created
                  value:
                    data:
                      id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      name: Declined Payment Recovery - Colombia
                      account_id: 2404911d-5df9-429e-8488-ad41abea1a4b
                      organization_code: 550e8400-e29b-41d4-a716-446655440000
                      country: CO
                      channel: WHATSAPP_MESSAGE
                      schedule:
                        daily_start_time: '08:00'
                        daily_end_time: '21:00'
                        time_zone: America/Bogota
                      duration:
                        start_at: '2025-07-01T00:00:00Z'
                        end_at: '2026-07-01T00:00:00Z'
                      status: ACTIVE
                      created_at: '2025-07-01T12:00:00Z'
                      updated_at: '2025-07-01T12:00:00Z'
          description: Créé
components:
  securitySchemes:
    public-api-key:
      type: apiKey
      in: header
      name: public-api-key
    private-secret-key:
      type: apiKey
      in: header
      name: private-secret-key

````

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