API Reference

Getting Started

Reply to a received message

Use the incoming conversation as the target. Omit reply_to for a normal reply; for a quoted reply, copy the incoming reply_token unchanged.

Getting started

  1. 1

    Before you call

    Do this first: authorization progress and live inbound messages arrive as webhook events, with no guaranteed replay for missed deliveries. Subscribing with ["*"] receives every public standard event; WhatsApp HistorySync can provide limited recent continuity but is not a durable archive.

    Webhook delivery & signature verification
  2. 2

    Prepare your parameters

    For a reply, copy data.conversation.id and data.conversation.type from message.received into to.id and to.type. For a new recipient, follow the channel-specific identifier rules.

    message.received
  3. 3

    Send text message

    Use the incoming conversation as the target. Omit reply_to for a normal reply; for a quoted reply, copy the incoming reply_token unchanged.

    curl -X POST "https://api.unifyport.ai/v1/messages" \
      -H "X-Api-Key: <YOUR_API_KEY>" \
      -H "Content-Type: application/json" \
      -d '{
      "account_id": "acc_example",
      "to": {
        "id": "user_example",
        "type": "user"
      },
      "message": {
        "type": "text",
        "text": "Hello from UnifyPort"
      }
    }'
    Send text message
  4. 4

    Reply to a message (quote)

    Use the incoming conversation as the target. Omit reply_to for a normal reply; for a quoted reply, copy the incoming reply_token unchanged.

    curl -X POST "https://api.unifyport.ai/v1/messages" \
      -H "X-Api-Key: <YOUR_API_KEY>" \
      -H "Content-Type: application/json" \
      -d '{
      "account_id": "acc_example",
      "to": {
        "id": "8600000000000@s.whatsapp.net",
        "type": "user"
      },
      "message": {
        "type": "text",
        "text": "Sure - replying to your question above."
      },
      "reply_to": {
        "reply_token": "<data.message.reply_token from the inbound event>"
      }
    }'
    Reply to a message (quote)