Troupia API
اربط أي نظام بالأتمتة والتشغيلات والمحادثات لديك، بمفتاح واحد.
أولًا: مفتاح API
ينشئه المالك أو المسؤول من الإعدادات ← مفاتيح API ويحدد ما يُسمح له به. كل طلب يرسله هكذا:
Authorization: Bearer trp_live_…
الأتمتة
/v1/automationsAll automations
Your workspace's automations, a page at a time.
automations:read/v1/automations/{automationId}One automation
Its steps, every way it starts and its version. Never a secret.
automations:readETag: "7.1a2b3c4d"
احتفظ بالـ ETag. التغيير يرسله مرة أخرى.
/v1/automations/{automationId}Rename
automations:writeIf-Match: "7.1a2b3c4d"
إذا غيّر أحدهم الأتمتة منذ قرأتها: 412، ولا يُستبدل شيء. اقرأها مجددًا وقرّر.
/v1/automations/{automationId}/enableTurn on
The plan's schedule floor applies, as in the app.
automations:writeIf-Match: "7.1a2b3c4d"
طلب الحالة القائمة أصلًا يعيد 200 ولا يغيّر شيئًا. التشغيلات المجدولة تبقى.
/v1/automations/{automationId}/disableTurn off
automations:writeIf-Match: "7.1a2b3c4d"
طلب الحالة القائمة أصلًا يعيد 200 ولا يغيّر شيئًا. التشغيلات المجدولة تبقى.
/v1/automations/resolve-linkFrom a link
A Troupia link → the automation or run it names.
automations:readالتشغيلات
/v1/automations/{automationId}/runsAn automation's runs
A page at a time.
runs:read/v1/automations/{automationId}/analysisRuns analysed
How many succeeded, how many failed and why, over a window.
runs:read/v1/automations/runs/{runId}One run
With what went in and out of each step.
runs:read_payloads/v1/runs/{runId}A chat run
data:readالمحادثات
/v1/conversationsConversations
data:read/v1/conversationsStart a conversation
chat:write/v1/conversations/{conversationId}/messagesSend a message
chat:write/v1/conversations/{conversationId}/exportExport a conversation
data:readWebhooks
/v1/automations/{automationId}/webhookWebhook addresses and their secrets
webhooks:manageمفتاح المالك أو المسؤول فقط: يُفحص في كل طلب، وكل طلب يُسجَّل.
/v1/webhook-endpoints/{endpointId}/deliveriesFailed deliveries
To one outgoing endpoint: newest first, a page at a time.
webhooks:manageالإضافات
/v1/plugins/{slug}/openapi.jsonA plugin's API
Each plugin publishes its own OpenAPI document.
data:read/v1/plugins/{slug}/{entity}A plugin's records
data:read/v1/plugins/{slug}/{entity}Create a record
data:write/v1/plugins/{slug}/{entity}/{id}One record
data:read/v1/plugins/{slug}/{entity}/{id}Update a record
data:write/v1/plugins/crm/{path}Read from the CRM
crm:read/v1/plugins/crm/{path}Write to the CRM
crm:writeحول الـ API
/v1/openapi.jsonThis document
As OpenAPI 3.1, no key needed.
بدون مفتاحعندما لا يمر الطلب
| 401 | لا يوجد مفتاح، أو أنه غير صالح. |
| 403 | ليس لدى المفتاح هذه الصلاحية. |
| 404 | غير موجود في مساحة العمل هذه. |
| 412 | تغيّرت الأتمتة منذ قرأتها. |
| 428 | If-Match مفقود. |
| 429 | طلبات كثيرة جدًا. انتظر وحاول مجددًا. |