Chuyển tới nội dung chính

19. API Công Khai & Webhook

19.1 Liệt Kê Cài Đặt Webhook

GET /api/v1/webhook-settings

Liệt kê các webhook được cấu hình.

Phản hồi:

[
{
"id": "webhook-001",
"url": "https://your-app.com/webhooks/zcrm",
"events": ["contact.created", "message.received"],
"active": true,
"createdAt": "2026-05-01T10:00:00Z"
}
]

19.2 Tạo Webhook

POST /api/v1/webhook-settings

Tạo webhook mới.

Thân Yêu Cầu:

{
"url": "https://your-app.com/webhooks/contacts",
"events": ["contact.created", "contact.updated"],
"secret": "your-webhook-secret"
}

Phản hồi: 201

{
"id": "webhook-002",
"url": "https://your-app.com/webhooks/contacts",
"active": true,
"createdAt": "2026-06-05T17:35:00Z"
}