hosting
POST /v1/sites/{siteId}/chat-agent
Switch on the chat agent for this site.
การยืนยันตัวตน
ส่ง API key เป็น bearer token เอนด์พอยต์นี้ไม่ได้ระบุสิทธิ์การใช้งานเฉพาะในข้อกำหนด ดังนั้นควรให้คีย์ของคุณมีสิทธิ์น้อยที่สุดเท่าที่จำเป็นและให้ตรวจสอบจากการตอบกลับแทนที่จะคาดเดา
ปลายทางนี้ไม่ต้องใช้รหัสองค์กร คีย์ของคุณระบุองค์กรที่เป็นเจ้าของอยู่แล้ว และการตอบกลับจะถูกจำกัดขอบเขตไว้เฉพาะองค์กรนั้น
ทดลองใช้เลย
แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/chat-agent \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API
รายละเอียด
Creates the agent, named after the site and pre-authorised for the site's own domains so the snippet works the moment it is pasted. ⛔ Refuses with 422 when the product has not been bought for this site, or when the account is not in good standing — two different refusals with two different remedies, told apart by the code in the error details (not_purchased / not_in_good_standing). A suspension is not cleared by credit, so that refusal deliberately offers no top-up. Calling it twice returns the existing agent with 200 rather than an error.
พารามิเตอร์
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
siteId (path) | Uuid | ใช่ | Site ID (UUIDv7). |
เนื้อหาคำขอ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
name | string | ไม่ใช่ | — |
greeting | string | ไม่ใช่ | — |
persona | string | ไม่ใช่ | — |
brand_colour | string | ไม่ใช่ | — |
launcher_position | string<left, right> | ไม่ใช่ | — |
handoff_enabled | boolean | ไม่ใช่ | — |
status | string<active, paused> | ไม่ใช่ | — |
allowed_origins | string[] | ไม่ใช่ | — |
monthly_message_cap | integer | ไม่ใช่ | — |
การตอบกลับ
| ชื่อ | ประเภท | จำเป็นต้องมี | ลักษณะของสิ่งนี้ |
|---|---|---|---|
id | string | ใช่ | — |
site_id | string | ไม่ใช่ | — |
name | string | ใช่ | What the agent calls itself to visitors. The customer's brand, not ours. |
greeting | string | ไม่ใช่ | — |
persona | string | ไม่ใช่ | Free text describing tone and what to say. ⛔ It cannot widen what the agent may read — retrieval decides that before the model sees anything. |
brand_colour | string | ไม่ใช่ | — |
launcher_position | string<left, right> | ไม่ใช่ | — |
status | string<active, paused> | ใช่ | paused stops it answering and keeps everything it has learned, so switching back on is instant rather than a re-index. |
handoff_enabled | boolean | ไม่ใช่ | Offer to pass the visitor to a person when the agent cannot answer. |
public_key | string | ใช่ | Carried in the embed snippet. It identifies the agent and authorises nothing a page's reader could not already do — the fence is allowed_origins. |
allowed_origins | string[] | ใช่ | Origins the public endpoints will answer for. ⛔ Empty refuses everything — it means "not installed yet", never "allow anything". |
monthly_message_cap | integer | ไม่ใช่ | Messages included per calendar month. Checked before each answer. |
messages_this_month | integer | ไม่ใช่ | — |
indexed_chunks | integer | ไม่ใช่ | Passages of the site currently searchable. Zero means it knows nothing yet. |
embed_snippet | string | ไม่ใช่ | The two lines to paste into any website. |
sources | ChatAgentSource[] | ใช่ | — |
ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้
401 · 403 · 404 · 422