Webhook đăng ký — Cập nhật

Cập nhật một phần thông tin webhook qua PATCH.

Xem Markdown

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

MethodEndpointMô tả
PATCH/api/v1/webhooks/{id}Cập nhật webhook

Tham số

Tham sốVị tríKiểuBắt buộcMô tả
idpathstringCóĐịnh danh webhook
eventsbodyarrayKhôngDanh sách sự kiện đăng ký

Kiểm thử tại chỗ

PATCHhttps://sale-ai.hitechcloud.vn/api/v1/webhooks/{id}

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"
  }
}