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

# Resolve a recipient and schedule an outbound message

> Resolves or creates a contact and contact-inbox for the selected inbox, then creates a pending scheduled message.
It does not create a conversation until the normal delivery flow runs. Provider delivery remains asynchronous.

For `multipart/form-data`, send recipient identity using Rails bracket fields (for example, `recipient[phone_number]`), repeat `recurrence_days[]` for each day, and send `template_params` as a JSON string.




## OpenAPI

````yaml /openapi/application.json post /api/v1/accounts/{account_id}/scheduled_outbound_messages
openapi: 3.1.0
info:
  title: WiseApp API — Aplicação
  description: >-
    Referência completa da API do WiseApp: plataforma (provisionamento),
    aplicação (conta), cliente (canais públicos) e MCP.
  version: 1.1.0
servers:
  - url: https://chat.wiseapp360.com
    description: Sua instalação WiseApp
security: []
paths:
  /api/v1/accounts/{account_id}/scheduled_outbound_messages:
    parameters:
      - $ref: '#/components/parameters/account_id'
        schema:
          type: string
        example: sample
    post:
      tags:
        - Scheduled Messages
      summary: Resolve a recipient and schedule an outbound message
      description: >
        Resolves or creates a contact and contact-inbox for the selected inbox,
        then creates a pending scheduled message.

        It does not create a conversation until the normal delivery flow runs.
        Provider delivery remains asynchronous.


        For `multipart/form-data`, send recipient identity using Rails bracket
        fields (for example, `recipient[phone_number]`), repeat
        `recurrence_days[]` for each day, and send `template_params` as a JSON
        string.
      operationId: create-scheduled-outbound-message
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/scheduled_outbound_message_create_payload'
            example:
              inbox_id: 12
              recipient:
                phone_number: '+595981123456'
                name: Juan Pérez
              content: Tu cita es mañana a las 10:00.
              scheduled_at: '2026-08-04T14:00:00Z'
              title: Recordatorio de cita
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/scheduled_outbound_message_create_payload'
            encoding:
              attachments:
                contentType: application/octet-stream
            example:
              inbox_id: 12
              recipient: Sample text
              content: Sample text
              scheduled_at: '2026-05-20T12:00:00Z'
              title: Sample resource
              attachments:
                - Sample text
              template_params:
                source: api
                segment: enterprise
              recurrence_type: none
              recurrence_interval: 1
              recurrence_days:
                - 1
              recurrence_end_type: never
              recurrence_end_date: '2026-05-20'
      responses:
        '201':
          description: Pending scheduled message created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - scheduled_message
                  - contact
                  - contact_inbox
                properties:
                  scheduled_message:
                    $ref: '#/components/schemas/scheduled_message'
                  contact:
                    $ref: '#/components/schemas/outbound_message_resource_result'
                  contact_inbox:
                    $ref: '#/components/schemas/outbound_message_resource_result'
              example:
                scheduled_message:
                  id: 123
                  content: >-
                    Hello {{name}}, your appointment is confirmed for tomorrow
                    at 10:00 AM
                  scheduled_at: 1738800000
                  sent_at: 1
                  title: Daily appointment reminder
                  inbox_id: 42
                  inbox_name: WhatsApp Business
                  conversation_id: 567
                  contact_id: 789
                  contact_name: María González
                  contact_phone: '+525512345678'
                  contact_email: maria.gonzalez@example.com
                contact:
                  id: 1
                  created: true
                contact_inbox:
                  id: 1
                  created: true
        '401':
          description: Invalid token or unauthorized access.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: API access is disabled for the account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Forbidden
        '422':
          description: Invalid recipient or scheduled-message payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_error'
              example:
                message: Validation failed
                attributes:
                  - name cannot be blank
      security:
        - userApiKey: []
components:
  parameters:
    account_id:
      in: path
      name: account_id
      schema:
        type: integer
      required: true
      description: The numeric ID of the account
  schemas:
    scheduled_outbound_message_create_payload:
      type: object
      required:
        - inbox_id
        - recipient
        - content
        - scheduled_at
      properties:
        inbox_id:
          type: integer
          description: Inbox that will deliver the message.
          example: 12
        recipient:
          type: object
          description: >-
            Exactly one identity is required; name is optional metadata and is
            never used for lookup.
          properties:
            name:
              type: string
              example: Juan Pérez
            phone_number:
              type: string
              example: '+595981123456'
            email:
              type: string
              format: email
              example: juan@example.com
            contact_id:
              type: integer
              description: Existing contact ID in this account.
            source_id:
              type: string
              description: Provider recipient identifier for the selected inbox.
          oneOf:
            - required:
                - phone_number
            - required:
                - email
            - required:
                - contact_id
            - required:
                - source_id
        content:
          type: string
          description: Message content.
        scheduled_at:
          type: string
          format: date-time
          description: Future ISO-8601 date and time when delivery should run.
        title:
          type: string
        attachments:
          type: array
          maxItems: 15
          items:
            type: string
            format: binary
          description: Files to attach to the scheduled message.
        template_params:
          type: object
          description: WhatsApp template parameters.
          additionalProperties: true
        recurrence_type:
          type: string
          enum:
            - none
            - daily
            - weekly
            - monthly
            - yearly
        recurrence_interval:
          type: integer
        recurrence_days:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
        recurrence_end_type:
          type: string
          enum:
            - never
            - on_date
            - after_occurrences
        recurrence_end_date:
          type: string
          format: date-time
        recurrence_max_occurrences:
          type: integer
    scheduled_message:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the scheduled message
          example: 123
        content:
          type: string
          description: The content of the message to be sent
          example: >-
            Hello {{name}}, your appointment is confirmed for tomorrow at 10:00
            AM
        scheduled_at:
          type: integer
          description: The timestamp when the message should be sent (Unix timestamp)
          example: 1738800000
        sent_at:
          type: integer
          nullable: true
          description: The timestamp when the message was actually sent (Unix timestamp)
          example: null
        title:
          type: string
          nullable: true
          description: Optional title for the scheduled message
          example: Daily appointment reminder
        inbox_id:
          type: integer
          description: The ID of the inbox from which the message will be sent
          example: 42
        inbox_name:
          type: string
          description: The name of the inbox
          example: WhatsApp Business
        conversation_id:
          type: integer
          nullable: true
          description: The ID of the conversation if associated with one
          example: 567
        contact_id:
          type: integer
          nullable: true
          description: The ID of the contact to send the message to
          example: 789
        contact_name:
          type: string
          nullable: true
          description: The name of the contact
          example: María González
        contact_phone:
          type: string
          nullable: true
          description: The phone number of the contact
          example: '+525512345678'
        contact_email:
          type: string
          nullable: true
          description: The email of the contact
          example: maria.gonzalez@example.com
        message_id:
          type: integer
          nullable: true
          description: The ID of the actual message after it's sent
          example: null
        created_at:
          type: integer
          description: >-
            The timestamp when the scheduled message was created (Unix
            timestamp)
          example: 1738713600
        status:
          type: string
          enum:
            - pending
            - sent
            - failed
          description: >-
            The status of the scheduled message (pending = waiting to be sent,
            sent = successfully delivered, failed = sending error)
          example: pending
        error_message:
          type: string
          nullable: true
          description: Error message if the sending failed
          example: null
        template_params:
          type: object
          nullable: true
          description: WhatsApp template parameters if using a template
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/scheduled_attachment'
          description: Array of attachments (max 15)
        recurrence_type:
          type: string
          enum:
            - none
            - daily
            - weekly
            - monthly
            - yearly
          description: >-
            The type of recurrence for the scheduled message (none = single
            send, daily = every day, weekly = every week, monthly = every month,
            yearly = once per year)
          example: daily
        recurrence_interval:
          type: integer
          nullable: true
          description: >-
            Interval for recurrence (e.g., 2 for every 2 days/weeks/months, 1
            for every day/week/month)
          example: 1
        recurrence_days:
          type: array
          items:
            type: integer
          nullable: true
          description: >-
            Days of the week for weekly recurrence (0=Sunday, 1=Monday, ...,
            6=Saturday)
          example:
            - 1
            - 3
            - 5
        recurrence_end_type:
          type: string
          enum:
            - never
            - on_date
            - after_occurrences
          nullable: true
          description: >-
            How the recurrence should end (never = infinite, on_date = until
            specific date, after_occurrences = after N times)
          example: never
        recurrence_end_date:
          type: integer
          nullable: true
          description: End date for recurrence if end_type is 'on_date' (Unix timestamp)
          example: null
        recurrence_max_occurrences:
          type: integer
          nullable: true
          description: Maximum number of occurrences if end_type is 'after_occurrences'
          example: null
        recurrence_count:
          type: integer
          description: >-
            Current count of occurrences (how many times this recurring message
            has been sent)
          example: 0
        parent_id:
          type: integer
          nullable: true
          description: >-
            Parent scheduled message ID if this is a recurring occurrence (null
            for original, ID for recurring copies)
          example: null
        assignee_id:
          type: integer
          nullable: true
          description: The ID of the assigned agent who created the scheduled message
          example: 15
        assignee_name:
          type: string
          nullable: true
          description: The name of the assigned agent
          example: Carlos Ramírez
        assignee_avatar_url:
          type: string
          nullable: true
          description: The avatar URL of the assigned agent
    outbound_message_resource_result:
      type: object
      required:
        - id
        - created
      properties:
        id:
          type: integer
        created:
          type: boolean
    bad_request_error:
      title: data
      type: object
      properties:
        description:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/request_error'
    scheduled_attachment:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the scheduled attachment
          example: 456
        file_type:
          type: string
          enum:
            - image
            - audio
            - video
            - file
          description: >-
            The type of the file (image = photos/pictures, audio = voice
            notes/music, video = video files, file = documents/PDFs)
          example: image
        account_id:
          type: integer
          description: The ID of the account
          example: 1
        external_url:
          type: string
          nullable: true
          description: External URL of the file if hosted externally
          example: https://cdn.example.com/images/promo.jpg
        extension:
          type: string
          nullable: true
          description: File extension (e.g., jpg, png, pdf, mp4)
          example: jpg
        thumb_url:
          type: string
          nullable: true
          description: Thumbnail URL for images/videos
          example: https://cdn.example.com/thumbs/promo_thumb.jpg
    request_error:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
        code:
          type: string
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token
      description: >-
        Token de acesso do usuário (Perfil → Token de acesso). Dá acesso
        conforme o papel do usuário e age em nome dele.

````

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