LetsBot Menu
Bắt đầu Tiếng Việt Ngôn ngữ

Đối tác kinh doanh của Meta Công ty đăng ký tại Vương quốc Anh

Ngôn ngữ

CRM · Endpoint API

POST /api/v1/crm/hooks Mới

Subscribe a webhook (REST hook)

Zapier / Make / n8n REST-hook subscribe.

Zapier / Make / n8n REST-hook subscribe. Scope: crm.

Fields: target_url (or url), event (or events[]), optional source (zapier, make, n8n, api) and description. Up to 50 subscriptions per workspace; at most 30 subscribe calls per minute per key.

The answer carries the signing secret once — store it. Deliveries are signed with X-LetsBot-Signature (see the CRM section above).

Nội dung JSON

{
  "target_url": "https://hooks.example.com/letsbot/crm",
  "events": [
    "deal.won",
    "deal.lost"
  ],
  "source": "api",
  "description": "Sync won deals to the ERP"
}

Ví dụ yêu cầu

curl -X POST "https://your-workspace.letsbot.net/api/v1/crm/hooks" \
  -H "X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "target_url": "https://hooks.example.com/letsbot/crm",
  "events": [
    "deal.won",
    "deal.lost"
  ],
  "source": "api",
  "description": "Sync won deals to the ERP"
}'
const response = await fetch("https://your-workspace.letsbot.net/api/v1/crm/hooks", {
  method: "POST",
  headers: {
    "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "target_url": "https://hooks.example.com/letsbot/crm",
    "events": [
      "deal.won",
      "deal.lost"
    ],
    "source": "api",
    "description": "Sync won deals to the ERP"
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://your-workspace.letsbot.net/api/v1/crm/hooks');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "target_url": "https://hooks.example.com/letsbot/crm",
        "events": [
            "deal.won",
            "deal.lost"
        ],
        "source": "api",
        "description": "Sync won deals to the ERP"
    }
    JSON,
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://your-workspace.letsbot.net/api/v1/crm/hooks",
    headers={
        "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "target_url": "https://hooks.example.com/letsbot/crm",
        "events": [
            "deal.won",
            "deal.lost",
        ],
        "source": "api",
        "description": "Sync won deals to the ERP",
    },
)

print(response.json())

Phản hồi

Subscribed201
{
  "success": true,
  "data": {
    "id": 4,
    "url": "https://hooks.example.com/letsbot/crm",
    "events": [
      "deal.won",
      "deal.lost"
    ],
    "source": "api",
    "description": "Sync won deals to the ERP",
    "is_active": true,
    "disabled_reason": null,
    "created_at": "2026-10-08T09:30:00+03:00",
    "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
URL not https422
{
  "success": false,
  "error": "The URL must start with https://.",
  "code": "validation_failed",
  "errors": {
    "url": [
      "The URL must start with https://."
    ]
  }
}

Sẵn sàng khi bạn sẵn sàng

Dùng thử endpoint này với số của bạn

API hoạt động trong thời gian dùng thử miễn phí. Tạo tài khoản, kết nối số WhatsApp và sao chép khóa của bạn tại API → Dữ liệu xác thực.