hosting
POST /v1/sites/{siteId}/chat-agent
Switch on the chat agent for this site.
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API) كرمز حامل (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
التفاصيل
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