Sanggunian ng API
Sanggunian para sa mga WorkItem operation, decision-step control, integration execution, at telemetry export.
Idinisenyo ang mga API na ito para sa predictable na automation behavior na may malinaw na policy at tenant scoping.
Batayang endpoint
Gamitin ang iyong na-configure na public API endpoint para sa mga authenticated na request.
https://api.threada.ai Authentication at context
- Gumamit ng mga scoped na credential para sa API access
- Isama ang tenant at role context kung saan kailangan
- Nag-fail-closed ang mga request na walang valid na context
Mga karaniwang scope
- workitems:read at workitems:write
- workflow:manage para sa mga update sa policy at decision
- actions:execute para sa governed na execution
- telemetry:read para sa mga export at analysis
Pagination at filtering
- Sinusuportahan ng mga list endpoint ang cursor- o token-based na pagination
- Mag-filter ayon sa channel, workflow, status, policy version, at time range
- Mas mainam ang mga bounded window para sa malalaking telemetry export
Error model
- Mga typed na error category para sa validation, authorization, policy, at execution failure
- Sinusuportahan ng mga reason code ang deterministic na paghawak sa operator tooling
- Ibinabalik ang mga correlation ID para sa cross-service na imbestigasyon
Mga halimbawang request
Gumawa ng WorkItem mula sa intake payload
Gumawa ng canonical na work record para sa workflow processing. Isama ang channel identifier para sa intake channel kapag kailangan.
curl -X POST "https://api.threada.ai/api/v1/public/work-items" \
-H "X-API-Key: <api-key>" \
-H "Content-Type: application/json" \
-d "{\"subject\":\"Review renewal request\",\"channel\":\"web\",\"channel_id\":\"web_main\",\"initial_message\":{\"role\":\"user\",\"content\":\"Review this renewal request before approval\"},\"tags\":[\"policy_review\"]}" {
"work_item": {
"summary": {
"work_item_id": "wi_123",
"status": "new",
"subject": "Review renewal request"
}
}
} Magpatakbo ng inaprubahang action
Magpatakbo ng policy-approved na action laban sa isang na-configure na integration.
curl -X POST "https://api.threada.ai/api/v1/public/work-items/wi_123/actions" \
-H "X-API-Key: <api-key>" \
-H "Content-Type: application/json" \
-d "{\"integration_id\":\"int_workflow\",\"idempotency_key\":\"act_456\",\"payload\":{\"type\":\"custom_http\",\"method\":\"POST\",\"url\":\"https://api.example.com/approvals\",\"body_json\":\"{\\\"approved\\\":true}\"}}" {
"action": {
"action_id": "act_456",
"work_item_id": "wi_123",
"action_type": "custom_http",
"status": "completed"
}
} Mga halimbawang artifact
Mga paglalarawang halimbawa ng mga object na ginagawa ng Threada, na may synthetic na data — hindi mga tunay na customer o talaan. Ang mga pangalan ng field ay sumusunod sa mga API at audit schema ng Threada.
- Halimbawang WorkItem (JSON) generation_mode: illustrative_sample · provenance_citation: docs/spec/product.md#design-principles
- Halimbawang evidence bundle (JSON) generation_mode: illustrative_sample · provenance_citation: docs/spec/product.md#design-principles
- Halimbawang action receipt (JSON) generation_mode: illustrative_sample · provenance_citation: docs/spec/product.md#design-principles
- Halimbawang audit export (CSV) generation_mode: illustrative_sample · provenance_citation: docs/spec/product.md#design-principles
Kailangan ng gabay sa implementation?
Gamitin ang docs at technical overview para sa mga pattern ng rollout at governance.
Makipag-ugnayan sa technical team