{"openapi":"3.0.1","info":{"title":"DcWallet API","description":"DcWallet REST API and Treasury Agent API documentation.","contact":{"name":"DcWallet Engineering"},"license":{"name":"Private"},"version":"1.0.0"},"servers":[{"url":"/","description":"Current host"}],"security":[{"apiKeyAuth":[],"apiSecret":[]}],"tags":[{"name":"8. Treasury Agent","description":"Discover capabilities and manage asynchronous Agent tasks."}],"paths":{"/api/v1/agent/tasks":{"post":{"tags":["8. Treasury Agent"],"summary":"Create an asynchronous Treasury Agent task","operationId":"postAgentTasks","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTaskRequest"}}},"required":true},"responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"202":{"description":"Task accepted for asynchronous processing","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseAgentTaskResponse"}}}}}}},"/api/v1/agent/tasks/{taskId}/cancel":{"post":{"tags":["8. Treasury Agent"],"summary":"Cancel a Treasury Agent task","operationId":"postAgentTasksByTaskIdCancel","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseAgentTaskResponse"}}}}}}},"/api/v1/agent/tasks/{taskId}":{"get":{"tags":["8. Treasury Agent"],"summary":"Get a Treasury Agent task","operationId":"getAgentTasksByTaskId","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseAgentTaskResponse"}}}}}}},"/api/v1/agent/tasks/{taskId}/events":{"get":{"tags":["8. Treasury Agent"],"summary":"List Treasury Agent task events","operationId":"getAgentTasksByTaskIdEvents","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseListAgentTaskEventResponse"}}}}}}},"/api/v1/agent/capabilities":{"get":{"tags":["8. Treasury Agent"],"summary":"List Treasury Agent capabilities enabled for the enterprise","operationId":"getAgentCapabilities","responses":{"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseVoid"}}}},"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ApiResponseListAgentCapabilityResponse"}}}}}}}},"components":{"schemas":{"ApiResponseVoid":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"type":"object"}}},"AgentTaskRequest":{"required":["capability","input","intent"],"type":"object","properties":{"capability":{"maxLength":80,"minLength":0,"type":"string","description":"Capability code returned by /agent/capabilities.","example":"receivable.invoice.create"},"intent":{"maxLength":2000,"minLength":0,"type":"string","description":"Plain-language objective retained for audit and review.","example":"Prepare a draft invoice for customer-42"},"input":{"type":"object","additionalProperties":{"type":"object","description":"Capability-specific structured input. Discover requirements from the capability before creating a task."},"description":"Capability-specific structured input. Discover requirements from the capability before creating a task."}}},"AgentTaskResponse":{"type":"object","properties":{"id":{"type":"string"},"capability":{"type":"string"},"intent":{"type":"string"},"status":{"type":"string","description":"Task state: waiting_authorization = user action required; authorized = approved to run; running = executing; waiting_approval = workflow approval required; completed/failed/cancelled are terminal.","enum":["created","waiting_authorization","authorized","running","waiting_approval","completed","failed","cancelled"]},"requiredActions":{"type":"array","items":{"type":"string"}},"errorMessage":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"}}},"ApiResponseAgentTaskResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"$ref":"#/components/schemas/AgentTaskResponse"}}},"AgentTaskEventResponse":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"Task event name corresponding to the new state.","enum":["task.created","task.waiting_authorization","task.authorized","task.running","task.waiting_approval","task.completed","task.failed","task.cancelled"]},"previousStatus":{"type":"string","description":"Task state before the event.","enum":["created","waiting_authorization","authorized","running","waiting_approval","completed","failed","cancelled"]},"currentStatus":{"type":"string","description":"Task state after the event.","enum":["created","waiting_authorization","authorized","running","waiting_approval","completed","failed","cancelled"]},"createdAt":{"type":"string","format":"date-time"}}},"ApiResponseListAgentTaskEventResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentTaskEventResponse"}}}},"AgentCapabilityResponse":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"riskLevel":{"type":"string"},"category":{"type":"string"},"readOnly":{"type":"boolean"},"requiresAuthorization":{"type":"boolean"},"requiresApproval":{"type":"boolean"},"idempotencyRequired":{"type":"boolean"}}},"ApiResponseListAgentCapabilityResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentCapabilityResponse"}}}}},"securitySchemes":{"apiKeyAuth":{"type":"apiKey","description":"API key from Dashboard > Developer Center. The sk_sandbox_ or sk_live_ prefix selects the isolated environment; the production API host accepts both modes.","name":"X-API-Key","in":"header"},"apiSecret":{"type":"apiKey","description":"One-time API Secret shown when the key is created or rotated. The online console uses it in browser memory to sign the request and removes it before transmission.","name":"X-API-Secret","in":"header"}}}}