Lumaktaw sa nilalaman

Sanggunian ng API

Reference para sa WorkItem operations, decision-step controls, integration execution, at telemetry i-export.

Ang mga APIs na ito ay ay dinisenyo para sa predictable automation behavior na may explicit policy at tenant scoping.

Pangunahing endpoint

Gamitin ang iyong naka-configure public API endpoint para sa authenticated requests.

https://api.threada.ai

Authentication at context

  • gamitin scoped credentials para sa API access
  • isama tenant at role context kung saan kailangan
  • Requests nang walang valid context fail closed

Karaniwang mga scope

  • workitems:read at workitems:write
  • workflow:pamahalaan para sa policy at decision nag-a-update
  • actions:i-i-execute para sa governed execution
  • telemetry:read para sa exports at analysis

Pagination at filtering

  • List endpoints support cursor- o token-based pagination
  • Filter by channel, workflow, status, policy version, at time range
  • Prefer bounded windows para sa large telemetry exports

Error model

  • Typed error categories para sa validation, authorization, policy, at execution failures
  • Reason codes support deterministic handling sa operator tooling
  • Correlation IDs ay returned para sa cross-service investigation

Mga halimbawang request

Gumawa ng isang WorkItem mula sa intake payload

Gumawa ng isang canonical trabaho record para sa workflow processing. isama ang channel identifier para sa ang intake channel kapag kailangan.

Request
curl -X POST "https://api.threada.ai/work-items" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{\"workflow_id\":\"policy_review\",\"channel_id\":\"web_main\",\"payload\":{\"message\":\"Review this renewal request before approval\"}}"
Response
{
  "work_item_id": "wi_123",
  "status": "new",
  "workflow_id": "policy_review"
}

I-i-i-execute ang approved action

Patakbuhin isang policy-approved action against isang naka-configure integration.

Request
curl -X POST "https://api.threada.ai/actions/execute" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{\"work_item_id\":\"wi_123\",\"action_id\":\"request_approval\",\"integration_id\":\"int_workflow\"}"
Response
{
  "execution_id": "ex_456",
  "status": "started",
  "idempotency_key": "idem_789"
}

Kailangan ng implementation guidance?

Gamitin ang docs at technical overview para sa rollout at governance patterns.

Makipag-ugnayan sa technical team