เอกสารอ้างอิง API
Webhook EndpointPOST

สร้าง จุดเชื่อมต่อ Webhook

สร้าง Webhook ที่ URL HTTP(S) แบบ absolute และแนะนำ HTTPS สำหรับ production status เป็น active หรือ inactive subscribed_events รับ public event หรือ ["*"] และ max_attempts 0..5

https://api.unifyport.ai/v1/webhook-endpoints

ส่วนหัว

X-Api-Key
stringจำเป็น

API key ของพื้นที่ทำงาน ระบบจะระบุพื้นที่ทำงานจากส่วนหัวนี้

Content-Type
stringจำเป็น

ใช้ application/json เมื่อต้องส่งเนื้อหาของคำขอเป็น JSON

พารามิเตอร์ใน path

จุดเชื่อมต่อนี้ไม่มีพารามิเตอร์ใน path

เนื้อหาของคำขอ

url
stringจำเป็น

URL HTTP(S) แบบ absolute ที่รับ Webhook และแนะนำ HTTPS สำหรับ production

format: uri

status
stringจำเป็น

สถานะ endpoint: active หรือ inactive

enum: active, inactive

subscribed_events[]
string[]

public standard event ที่ส่งไปยัง จุดเชื่อมต่อ โดย ["*"] หมายถึง public event ทั้งหมด แต่ไม่รวม provider.raw_event

signing_secret
string

secret สำหรับลงนาม Webhook แบบเลือก ในตัวอย่างให้ใช้ค่าตัวแทน

retry_policy
object

max_attempts คือจำนวน retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5 และ 0 หมายถึงส่งครั้งแรกเท่านั้น

max_attempts
integer

จำนวน retry หลังการส่งครั้งแรก ตั้งแต่ 0 ถึง 5

เนื้อหาการตอบกลับ

id
string

ตัวระบุ จุดเชื่อมต่อ Webhook (we_...)

url
string

URL HTTP(S) แบบ absolute ที่รับ Webhook และแนะนำ HTTPS สำหรับ production

format: uri

status
string

สถานะ จุดเชื่อมต่อ: active หรือ inactive

enum: active, inactive

subscribed_events[]
string[]

public standard event ของ จุดเชื่อมต่อ; ["*"] หมายถึง public event ทั้งหมดโดยไม่รวม provider.raw_event

signing_enabled
boolean

เป็น true เมื่อมีการตั้ง signing secret และการนำส่งถูกลงนาม

retry_policy
object

max_attempts นับ retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5

max_attempts
integer

จำนวน retry หลังการส่งครั้งแรกที่ตั้งไว้ ตั้งแต่ 0 ถึง 5

การตอบกลับ

201
201 Created

คำขอสำเร็จ ดูตัวอย่างเนื้อหาตอบกลับด้านบน

400
Bad Request

เนื้อหาของคำขอ path หรือพารามิเตอร์ไม่ถูกต้อง

401
Unauthorized

ส่วนหัว X-Api-Key หายไปหรือไม่ถูกต้อง

คำขอ

curl -X POST https://api.unifyport.ai/v1/webhook-endpoints \
  -H "X-Api-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/webhook",
  "status": "active",
  "subscribed_events": ["*"],
  "signing_secret": "<WEBHOOK_SIGNING_SECRET>"
}'

การตอบกลับ

{
  "data": {
    "id": "we_example",
    "url": "https://example.com/webhook",
    "status": "active",
    "subscribed_events": ["*"],
    "signing_enabled": true,
    "retry_policy": {
      "max_attempts": 3
    }
  }
}