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
  • 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 on Peach
      POST
  • orders
    • Create an order
      POST
    • Find order by ID
      GET
    • Create a refund for an order
      POST
  • medias
    • 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 flow execution status webhooks
  1. messaging

Connect to AI Agent

POST
https://app.trypeach.io/api/v1/events
Connect to an AI Agent by sending 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
event_type
enum<string> 
required
Allowed value:
connect_to_ai_agent
contact
object 
write-onlyrequired
name
string 
optional
email
string 
optional
phone_number
string 
required
Additional properties
string 
optional
template_message
object 
write-onlyrequired
whats_app_template_id
string 
required
liquid_values
object 
required
Additional properties
string 
optional
ai_agent
object 
required
id
string 
required
Example
{
    "event_type": "connect_to_ai_agent",
    "contact": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "phone_number": "+919988776655"
    },
    "template_message": {
        "whats_app_template_id": "wat_1234abcd",
        "liquid_values": {
            "account_name": "Foo",
            "cta1": "Bar"
        }
    },
    "ai_agent": {
        "id": "aiflw_1234abcd"
    }
}

Request 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 'Content-Type: application/json' \
--header 'Authorization;' \
--data-raw '{
    "event_type": "connect_to_ai_agent",
    "contact": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "phone_number": "+919988776655"
    },
    "template_message": {
        "whats_app_template_id": "wat_1234abcd",
        "liquid_values": {
            "account_name": "Foo",
            "cta1": "Bar"
        }
    },
    "ai_agent": {
        "id": "aiflw_1234abcd"
    }
}'

Responses

🟢200Success
application/json
Body
status
string 
required
event_id
string 
required
Example
{
    "status": "success",
    "event_id": "string"
}
Modified at 2025-06-09 11:43:40
Previous
Poll template messages status
Next
List all templates
Built with