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

# Message a customer first

> Sends to a customer who has not written first, and opens the conversation, or uses the open one for that number. Answers 201. On Messenger and Instagram the conversation must exist already. Needs the `messages:write` scope.



## OpenAPI

````yaml /openapi/partner.yaml post /api/v1/partner/tenants/{external_ref}/messages/send/
openapi: 3.1.0
info:
  title: ImpelLabs Partner API
  version: '1'
  description: >-
    The Partner API provisions customer businesses (tenants) and runs their
    channels, conversations and templates from your own product. Call it from
    your server with a partner key. Every path ends with a slash.
servers:
  - url: https://api.impellabs.tech
security:
  - bearer: []
tags:
  - name: Keys
    description: Your partner API keys.
  - name: Tenants
    description: Customer businesses, their channels, conversations and templates.
  - name: Webhooks
    description: Where your tenants' events go.
  - name: WhatsApp sign-up
    description: The settings of the hosted WhatsApp sign-up.
paths:
  /api/v1/partner/tenants/{external_ref}/messages/send/:
    post:
      tags:
        - Tenants
      summary: Message a customer first
      description: >-
        Sends to a customer who has not written first, and opens the
        conversation, or uses the open one for that number. Answers 201. On
        Messenger and Instagram the conversation must exist already. Needs the
        `messages:write` scope.
      operationId: post_api_v1_partner_tenants_external_ref_messages_send
      parameters:
        - name: external_ref
          in: path
          required: true
          schema:
            type: string
          description: Your own id for the customer business, set when you created it.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: string
                  description: >-
                    The customer phone number, or the Messenger or Instagram
                    customer id.
                channel:
                  type: string
                  enum:
                    - whatsapp
                    - messenger
                    - instagram
                  description: Default `whatsapp`.
                whatsapp_number:
                  type: string
                  description: >-
                    The `phone_number_id` to send from. Default is the first
                    connected number.
                type:
                  type: string
                  description: >-
                    One of `text`, `template`, `image`, `video`, `audio`,
                    `document`, `interactive`, `location`, `reaction`. Default
                    `text`.
                text:
                  type: string
                  description: The message text. Required for `text`.
                reply_to:
                  type: string
                  description: A message id or provider message id to quote.
                template_name:
                  type: string
                  description: The approved template to send. Required for `template`.
                lang:
                  type: string
                  description: The template language. Default `en_US`.
                body_params:
                  type: array
                  items:
                    type: string
                  description: The values for the template body.
                components:
                  type: array
                  items:
                    type: object
                  description: Template components, as Meta defines them.
                link:
                  type: string
                  description: A public link to the file, for a media type.
                media_id:
                  type: string
                  description: >-
                    A provider media id, for a media type. Send `link` or
                    `media_id`.
                caption:
                  type: string
                  description: A caption for a media type. 1024 characters at most.
                filename:
                  type: string
                  description: A file name for a document.
                payload:
                  type: object
                  description: For `interactive`, `location` and `reaction`.
                tag:
                  type: string
                  description: 'Messenger only: `HUMAN_AGENT`.'
              required:
                - to
            example:
              to: '+15550100101'
              channel: whatsapp
              type: template
              template_name: appointment_reminder
              lang: en_US
              body_params:
                - Sam
                - 3 pm
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              example:
                message:
                  id: 9b3c1d5f-0000-4000-8000-000000000000
                  object: message
                  role: user
                  type: text
                  text: Hello
                  created_at: '2026-01-15T10:04:00+00:00'
                  conversation: 5d2f7a3e-0000-4000-8000-000000000000
                  channel:
                    name: whatsapp
                    from: '+15550100101'
                conversation:
                  id: 5d2f7a3e-0000-4000-8000-000000000000
                  object: conversation
                  status: active
                  agent: null
                  agent_version: null
                  channel: whatsapp
                  external_ref: null
                  turns: 3
                  metadata: {}
                  created_at: '2026-01-15T10:00:00+00:00'
                  updated_at: '2026-01-15T10:05:00+00:00'
                  contact:
                    name: Sam
                    phone: '+15550100101'
                    lead_id: 8a1e0c7b-0000-4000-8000-000000000000
                  human_control:
                    'on': false
                    reason: ''
                    since: ''
                    state: ai
                    pending_since: ''
                  window:
                    open: true
                    last_inbound_at: '2026-01-15T10:04:00+00:00'
                    closes_at: '2026-01-16T10:04:00+00:00'
                  capabilities:
                    can_text: true
                    can_template: true
                    can_media: true
                    window_open: true
                    window:
                      open: true
                    tags: []
                  whatsapp_number: '100000000000001'
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          description: The request is not valid or not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  responses:
    Invalid:
      description: >-
        A field is missing or wrong. The body names each field: {"field": "what
        to fix"}.
    Unauthorized:
      description: The credentials are missing, wrong, expired or revoked.
    Forbidden:
      description: These credentials may not do this.
    NotFound:
      description: There is no such row, or these credentials cannot see it.
  schemas:
    Error:
      type: object
      description: >-
        An error. Most errors carry `detail`. Some carry `error` with `code` and
        `message`.
      properties:
        detail:
          type: string
        code:
          type: string
        field:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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