Peach
  1. messaging
Peach
  • messaging
    • Send a pre-approved template message
      POST
    • Poll template message status
      GET
    • Launch a broadcast
      POST
    • Poll broadcast status
      GET
    • Poll template messages status
      GET
    • Connect to AI Agent
      POST
    • Send an App message
      POST
  • whatsapp_templates
    • List all templates
      GET
    • Create a template
      POST
    • Update template
      PATCH
    • Archive template
      PATCH
    • Pause template
      PATCH
    • Submit template
      PATCH
  • conversations
    • Agent Assignment
      POST
    • Close Conversation
      POST
  • contacts
    • Create a contact
      POST
    • Update a contact
      PATCH
    • Create multiple contacts
      POST
  • orders
    • Create an order
      POST
    • Find order by ID
      GET
    • Create a refund for an order
      POST
  • medias
    • About uploaded media
    • List available medias
      GET
    • Add a media
      POST
    • Remove a media
      DELETE
  • webhooks
    • Order status webhooks
    • Flow execution status webhooks
    • Message delivery status webhooks
    • AI Agent Execution Webhooks
  • Schemas
    • Schemas
      • Order
      • RefundRequest
      • Contact
      • LineItem
      • OrderExpiry
      • TemplateMessage
      • AnyValue
      • Argument
  1. messaging

Send a pre-approved template message

POST
https://app.trypeach.io/api/v1/events
Send a template message to a contact. The WhatsApp template should be approved for this API to work.

Request

Authorization
Add parameter in header
Authorization
Example:
Authorization: ********************
Body Params application/json

Example
{
    "event_type": "send_template_message",
    "contact": {
        "name": "Alfred Hitchcock",
        "language": "string",
        "email": "alfred@example.com",
        "phone_number": "+919988776655",
        "metadata": {
            "key": "value"
        }
    },
    "template_message": {
        "whats_app_template_id": "your_template_id",
        "liquid_values": {
            "product_name": "Product 1",
            "price": 112,
            "currency": "₹",
            "header_media": "https://example.com/image.png"
        },
        "retry_until": "2024-04-01T17:30:00Z",
        "retry_window": {
            "start_at": "08:00",
            "end_at": "20:00",
            "timezone": "The account's default timezone"
        },
        "business_phone_number": "919876543222",
        "reply_automation": {
            "app_id": "aiflw_1234abcd"
        }
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.trypeach.io/api/v1/events' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "event_type": "send_template_message",
    "contact": {
        "name": "Alfred Hitchcock",
        "language": "string",
        "email": "alfred@example.com",
        "phone_number": "+919988776655",
        "metadata": {
            "key": "value"
        }
    },
    "template_message": {
        "whats_app_template_id": "your_template_id",
        "liquid_values": {
            "product_name": "Product 1",
            "price": 112,
            "currency": "₹",
            "header_media": "https://example.com/image.png"
        },
        "retry_until": "2024-04-01T17:30:00Z",
        "retry_window": {
            "start_at": "08:00",
            "end_at": "20:00",
            "timezone": "The account'\''s default timezone"
        },
        "business_phone_number": "919876543222",
        "reply_automation": {
            "app_id": "aiflw_1234abcd"
        }
    }
}'

Responses

🟢201Created
application/json
Transactional message has been queued for delivery
Body

Example
{
    "event_type": "send_template_message",
    "contact": {
        "name": "Alfred Hitchcock",
        "language": "string",
        "email": "alfred@example.com",
        "phone_number": "+919988776655",
        "metadata": {
            "key": "value"
        }
    },
    "template_message": {
        "whats_app_template_id": "your_template_id",
        "liquid_values": {
            "product_name": "Product 1",
            "price": 112,
            "currency": "₹",
            "header_media": "https://example.com/image.png"
        },
        "retry_until": "2024-04-01T17:30:00Z",
        "retry_window": {
            "start_at": "08:00",
            "end_at": "20:00",
            "timezone": "The account's default timezone"
        },
        "business_phone_number": "919876543222",
        "reply_automation": {
            "app_id": "aiflw_1234abcd"
        }
    }
}
🟠422Parameter Error
Modified at 2025-05-07 06:40:10
Next
Poll template message status
Built with