# RPA Service API v2
Running on: http://royaloak02.local:9100
## Natural Language (AI-Powered)
POST /natural/execute
- Converts plain English to RPA steps
- Records video + screenshots
- Returns PASS/FAIL result
- Example: "Open calculator and wait 2 seconds"
## Workflow (Multi-Step)
POST /workflow/execute
- Actions: open, wait, click, type, key, screenshot, drag, scroll
- Add "retries": 3 for retry logic
- Example: [{"action":"click","x":100,"y":200,"retries":3}]
## Automation
- POST /auto/click?x=100&y=200
- POST /auto/type (body: text)
- POST /auto/key (body: "Return")
- GET /auto/windows
- POST /auto/focus?title=Firefox
- POST /auto/close?title=Firefox
## File Operations
- GET /file/read?path=/tmp/test.txt
- POST /file/write?path=/tmp/test.txt (body: content)
- GET /file/list?path=/tmp
- POST /file/delete?path=/tmp/test.txt
## Browser
- POST /browser/open?url=https://example.com
- POST /browser/chrome?url=URL
- POST /browser/firefox?url=URL
## Screenshot & OCR
- GET /screenshot (returns PNG)
- GET /ocr/screen
- GET /ocr/file?path=/tmp/image.png
## Session Management
- POST /cleanup/now (manual cleanup)
- Auto-cleanup runs hourly
## New in v2
- JSON repair for malformed AI responses
- Error screenshots (error-stepN.png)
- App mapping (calculator → gnome-calculator)
- Retry logic per step
- Mouse drag and scroll
- Session auto-cleanup
## Control
~/projects/rpa-mcp-server/control.sh {start|stop|status|log|check}