API Reference
Operator API
High-level API for executing user intents as structured task plans across registered devices.
Endpoints
POSTAuth
/api/operator/executeOperatorExecute a structured intent task plan. Returns TaskPlan with results.
GETAuth
/api/operator/summaryOperatorHuman-readable summary of all actions taken in the last 24 hours.
Example
operator-execute.ts
| 1 | // Execute an operator task plan |
| 2 | const response = await fetch(39;/api/operator/execute39;, { |
| 3 | method: 39;POST39;, |
| 4 | headers: { |
| 5 | 39;x-user-id39;: 39;user_12339;, |
| 6 | 39;Content-Type39;: 39;application/json39;, |
| 7 | }, |
| 8 | body: JSON.stringify({ |
| 9 | intentId: 39;intent_xyz39;, |
| 10 | taskPlan: { |
| 11 | steps: [ |
| 12 | { id: 39;step-139;, actionType: 39;OpenApp39;, parameters: { appName: 39;Mail39; } }, |
| 13 | { id: 39;step-239;, actionType: 39;SendEmail39;, dependsOn: [39;step-139;], |
| 14 | parameters: { to: 39;team@company.com39;, subject: 39;Weekly update39;, body: 39;...39; } }, |
| 15 | ], |
| 16 | }, |
| 17 | }), |
| 18 | }); |
| 19 | const { taskId, status, results } = await response.json(); |