Webhook đăng ký — Cập nhật
Cập nhật một phần thông tin webhook qua PATCH.
Endpoint PATCH /api/v1/webhooks/{id} cập nhật một phần thông tin webhook. Chỉ gửi những trường cần đổi.
Endpoint
| Method | Endpoint | Mô tả |
|---|---|---|
PATCH | /api/v1/webhooks/{id} | Cập nhật webhook |
Tham số
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
id | path | string | Có | Định danh webhook |
events | body | array | Không | Danh sách sự kiện đăng ký |
Kiểm thử tại chỗ
PATCH
https://sale-ai.hitechcloud.vn/api/v1/webhooks/{id}Kiểm thử tại chỗGửi thử sẽ ghi dữ liệu thật trên môi trường được chọn. Nên thử trên Sandbox trước. Token không được lưu lại.
Tham số đường dẫn
Body
Ví dụ cURL
curl -X PATCH "https://sale-ai.hitechcloud.vn/api/v1/webhooks/wh_a1b2c3d4" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"events": [
"message.received",
"order.created",
"flow.completed"
]
}'Phản hồi mẫu
{
"status": "success",
"data": {
"id": "wh_a1b2c3d4",
"url": "https://your-app.example.com/sale-ai/webhook",
"events": [
"message.received",
"order.created",
"flow.completed"
],
"secret": "whsec_************",
"status": "active",
"created_at": "2026-10-15T08:00:00+07:00"
}
}Endpoint PATCH /api/v1/webhooks/{id} cập nhật một phần thông tin webhook. Chỉ gửi những trường cần đổi.
Endpoint
| Method | Endpoint | Mô tả |
|---|---|---|
PATCH | /api/v1/webhooks/{id} | Cập nhật webhook |
Tham số
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
id | path | string | Có | Định danh webhook |
events | body | array | Không | Danh sách sự kiện đăng ký |
Kiểm thử tại chỗ
PATCH
https://sale-ai.hitechcloud.vn/api/v1/webhooks/{id}Kiểm thử tại chỗGửi thử sẽ ghi dữ liệu thật trên môi trường được chọn. Nên thử trên Sandbox trước. Token không được lưu lại.
Tham số đường dẫn
Body
Ví dụ cURL
curl -X PATCH "https://sale-ai.hitechcloud.vn/api/v1/webhooks/wh_a1b2c3d4" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"events": [
"message.received",
"order.created",
"flow.completed"
]
}'Phản hồi mẫu
{
"status": "success",
"data": {
"id": "wh_a1b2c3d4",
"url": "https://your-app.example.com/sale-ai/webhook",
"events": [
"message.received",
"order.created",
"flow.completed"
],
"secret": "whsec_************",
"status": "active",
"created_at": "2026-10-15T08:00:00+07:00"
}
}