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

# Create New Conversation

> Creating a conversation in WiseApp requires a source id.



## OpenAPI

````yaml /openapi/application.json post /api/v1/accounts/{account_id}/conversations
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}/conversations:
    parameters:
      - $ref: '#/components/parameters/account_id'
        schema:
          type: string
        example: sample
    post:
      tags:
        - Conversations
      summary: Create New Conversation
      description: Creating a conversation in WiseApp requires a source id.
      operationId: newConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/conversation_create_payload'
            example:
              source_id: '1234567890'
              inbox_id: 1
              contact_id: 1
              additional_attributes:
                browser: Chrome
                browser_version: 89.0.4389.82
                os: Windows
                os_version: '10'
              custom_attributes:
                attribute_key: attribute_value
                priority_conversation_number: 3
              status: open
              assignee_id: 1
              team_id: 1
              snoozed_until: '2030-07-21T17:32:28Z'
              message:
                content: Hello, how can I help you?
                template_params:
                  name: sample_issue_resolution
                  category: UTILITY
                  language: en_US
                  processed_params:
                    '1': WiseApp
                direct_send:
                  category: utility
                  ttl_seconds: 3600
                  template_name: order_update
                  header: Order update
                  media:
                    type: image
                    url: https://example.com/invoice-12345.pdf
                    filename: invoice-12345.pdf
                  buttons:
                    - Confirm
                    - Reschedule
                  link:
                    text: Track order
                    url: https://example.com/orders/12345
                  voice_call:
                    text: Call support
                    ttl_minutes: 1440
                  footer: WiseApp Clinic
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: number
                    description: ID of the conversation
                  account_id:
                    type: number
                    description: Account Id
                  inbox_id:
                    type: number
                    description: ID of the inbox
              example:
                id: 1
                account_id: 1
                inbox_id: 1
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_error'
              example:
                error: Forbidden
      security:
        - userApiKey: []
        - agentBotApiKey: []
components:
  parameters:
    account_id:
      in: path
      name: account_id
      schema:
        type: integer
      required: true
      description: The numeric ID of the account
  schemas:
    conversation_create_payload:
      type: object
      required:
        - source_id
      properties:
        source_id:
          type: string
          description: Conversation source id
          example: '1234567890'
        inbox_id:
          type: integer
          description: >-
            Id of inbox in which the conversation is created <br/> Allowed Inbox
            Types: Website, Phone, Api, Email
          example: 1
        contact_id:
          type: integer
          description: Contact Id for which conversation is created
          example: 1
        additional_attributes:
          type: object
          description: Lets you specify attributes like browser information
          example:
            browser: Chrome
            browser_version: 89.0.4389.82
            os: Windows
            os_version: '10'
        custom_attributes:
          type: object
          description: >-
            The object to save custom attributes for conversation, accepts
            custom attributes key and value
          example:
            attribute_key: attribute_value
            priority_conversation_number: 3
        status:
          type: string
          enum:
            - open
            - resolved
            - pending
          description: Specify the conversation whether it's pending, open, closed
          example: open
        assignee_id:
          type: integer
          description: Agent Id for assigning a conversation to an agent
          example: 1
        team_id:
          type: integer
          description: Team Id for assigning a conversation to a team\
          example: 1
        snoozed_until:
          type: string
          format: date-time
          description: Snoozed until date time
          example: '2030-07-21T17:32:28Z'
        message:
          type: object
          description: The initial message to be sent to the conversation
          required:
            - content
          properties:
            content:
              type: string
              description: The content of the message
              example: Hello, how can I help you?
            template_params:
              type: object
              description: The template params for the message in case of whatsapp Channel
              properties:
                name:
                  type: string
                  description: Name of the template
                  example: sample_issue_resolution
                category:
                  type: string
                  description: Category of the template
                  example: UTILITY
                language:
                  type: string
                  description: Language of the template
                  example: en_US
                processed_params:
                  type: object
                  description: >-
                    The processed param values for template variables in
                    template
                  example:
                    '1': WiseApp
            direct_send:
              $ref: '#/components/schemas/direct_send_payload'
    bad_request_error:
      title: data
      type: object
      properties:
        description:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/request_error'
    direct_send_payload:
      type: object
      description: >
        Sends the message through Meta's WhatsApp Direct Send (beta): a utility
        or

        authentication message without a pre-approved template, also outside the

        24-hour window. Meta matches or generates the template and bills it at
        the

        category rate. Only WhatsApp Cloud inboxes with Direct Send turned on

        accept it; send utility content only, since marketing content can
        restrict

        the WABA. Attachments are not supported.


        - `utility` (default): plain text, or reply buttons, one link button or
        one
          voice call button (only one of them). Reply and link buttons take an
          optional text or media header and a footer; the voice call button takes a
          text header only and no footer.
        - `authentication`: plain text only, for verification codes. Meta has to
          open it to the WABA, and it can't go to contacts known only by their
          WhatsApp user ID (BSUID).

        Send `{}` for a plain utility text message. Invalid options answer `422`

        with `{ error, code }` (codes such as `invalid_ttl`,
        `invalid_template_name`,

        `conflicting_buttons`, `header_needs_buttons`,
        `authentication_text_only`).
      properties:
        category:
          type: string
          enum:
            - utility
            - authentication
          default: utility
          description: Meta category the message is billed and checked as.
        ttl_seconds:
          type: integer
          minimum: 30
          maximum: 43200
          description: >
            How long WhatsApp keeps trying to deliver the message before
            dropping it.

            Utility: 30 to 43200 seconds (12 hours), Meta's default is 30 days.

            Authentication: 30 to 900 seconds (15 minutes), Meta's default is 10
            minutes.
          example: 3600
        template_name:
          type: string
          pattern: ^[a-z0-9_]+$
          maxLength: 512
          description: >
            Utility only. Meta creates or reuses the template with this exact
            name

            instead of matching one automatically. It must be unique in the WABA
            and

            not clash with a template created outside Direct Send.
          example: order_update
        header:
          type: string
          maxLength: 60
          description: >-
            Text header. Needs reply, link or voice call buttons; not together
            with `media`.
          example: Order update
        media:
          type: object
          description: >-
            Image, video or document header from a public URL (Meta downloads
            it). Needs reply or link buttons.
          required:
            - type
            - url
          properties:
            type:
              type: string
              enum:
                - image
                - video
                - document
            url:
              type: string
              format: uri
              example: https://example.com/invoice-12345.pdf
            filename:
              type: string
              description: File name the customer sees, documents only.
              example: invoice-12345.pdf
          additionalProperties: false
        buttons:
          type: array
          minItems: 1
          maxItems: 3
          description: Reply button titles, all different.
          items:
            type: string
            maxLength: 20
          example:
            - Confirm
            - Reschedule
        link:
          type: object
          description: One call-to-action link button.
          required:
            - text
            - url
          properties:
            text:
              type: string
              maxLength: 20
              example: Track order
            url:
              type: string
              format: uri
              example: https://example.com/orders/12345
          additionalProperties: false
        voice_call:
          type: object
          description: |
            One "Call on WhatsApp" button: the customer calls the business on
            WhatsApp. Needs WhatsApp calling turned on for the inbox.
          required:
            - text
          properties:
            text:
              type: string
              maxLength: 20
              example: Call support
            ttl_minutes:
              type: integer
              minimum: 1
              maximum: 43200
              description: >-
                Minutes the button stays active. Meta's default is 7 days
                (10080).
              example: 1440
          additionalProperties: false
        footer:
          type: string
          maxLength: 60
          description: Goes out with reply or link buttons only.
          example: WiseApp Clinic
      additionalProperties: false
    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.
    agentBotApiKey:
      type: apiKey
      in: header
      name: api_access_token
      description: >-
        Token do bot de agente, fornecido pelo administrador. Acessa apenas um
        subconjunto limitado de endpoints.

````

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