API
API Referansı
Worktio REST API dokümantasyonu.
Authentication
Tüm API endpoint’leri session authentication gerektirir. NextAuth.js cookie ile otomatik yönetilir.
Endpoints
GET
/api/flowsTüm flowları listelerResponse:
[{ "id": "uuid", "name": "string", "nodes": [], "edges": [] }]POST
/api/flowsYeni flow oluştururRequest Body:
{ "name": "string", "nodes": [], "edges": [] }PATCH
/api/flows/:idFlow güncellerRequest Body:
{ "name": "string", "nodes": [], "edges": [] }DELETE
/api/flows/:idFlow silerResponse:
{ "success": true }POST
/api/flows/:id/runFlow'u çalıştırırResponse:
{ "success": true, "results": {}, "duration": 234 }GET
/api/agentsTüm agentları listelerResponse:
[{ "id": "uuid", "name": "string", "model": "gpt-4o" }]POST
/api/agents/:id/chatAgent'a mesaj gönderirRequest Body:
{ "content": "string" }Webhook Endpoint
POST
/api/webhooks/:flowIdDış servislerden flow tetiklemek için kullanılır. Authentication gerektirmez.
// Örnek istek:
curl -X POST https://worktio.com/api/webhooks/<flowId> \
-H "Content-Type: application/json" \
-d '{"event": "new_user", "userId": 123}'