File size: 8,056 Bytes
6a7089a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Endpoints Reference

## Health & Server

```
GET  /health                             # Server health check (tab count, crash logs)
POST /ensure-chrome                      # Force Chrome initialization
GET  /help                               # List all available endpoints
GET  /openapi.json                       # OpenAPI spec
GET  /metrics                            # Global metrics snapshot
GET  /welcome                            # Welcome HTML page
POST /shutdown                           # Graceful server shutdown
GET  /api/events                         # SSE event stream (dashboard)
```

## Navigation

```
POST /navigate                           # Navigate current tab to URL
GET  /navigate?url=<url>                 # Navigate (GET variant)

POST /tabs/{id}/navigate                 # Navigate a specific tab
```

Body: `{"url": "...", "timeout": 60, "blockImages": true, "newTab": true, "blockAds": true}`

## History & Reload

```
POST /back                               # Go back in current tab
POST /back?tabId=<id>                    # Go back in specific tab
POST /tabs/{id}/back                     # Go back (tab-scoped)
POST /forward                            # Go forward in current tab
POST /forward?tabId=<id>                 # Go forward in specific tab
POST /tabs/{id}/forward                  # Go forward (tab-scoped)
POST /reload                             # Reload current tab
POST /reload?tabId=<id>                  # Reload specific tab
POST /tabs/{id}/reload                   # Reload (tab-scoped)
```

## Tab Management

```
GET  /tabs                               # List all open tabs
POST /tab                                # Tab actions: new, close, focus
POST /tabs/{id}/close                    # Close a specific tab (orchestrator)
GET  /tabs/{id}/metrics                  # Per-tab metrics
```

Actions via `POST /tab`:
- `{"action": "new", "url": "..."}` — open new tab
- `{"action": "close", "tabId": "..."}` — close tab
- `{"action": "focus", "tabId": "..."}` — focus/switch to tab

## Tab Locking (multi-agent)

```
POST /tab/lock                           # Lock a tab {tabId, owner, timeoutSec}
POST /tab/unlock                         # Unlock a tab {tabId, owner}
POST /tabs/{id}/lock                     # Lock specific tab
POST /tabs/{id}/unlock                   # Unlock specific tab
```

## Interaction

```
POST /action                             # Single action on current tab
GET  /action                             # Action (GET variant)
POST /actions                            # Batch actions in sequence
POST /macro                              # Multi-step macro with per-step timeout
POST /tabs/{id}/action                   # Action on specific tab
POST /tabs/{id}/actions                  # Batch actions on specific tab
```

Action kinds: `click`, `dblclick`, `type`, `fill`, `press`, `hover`, `scroll`, `select`, `focus`, `drag`

Body: `{"kind": "click", "ref": "e5"}` / `{"kind": "dblclick", "ref": "e5"}` / `{"kind": "type", "ref": "e12", "text": "hello"}`

## Page Analysis

```
GET  /snapshot                           # Accessibility tree (current tab)
GET  /tabs/{id}/snapshot                 # Accessibility tree (specific tab)
GET  /text                               # Extract readable text
GET  /tabs/{id}/text                     # Extract text (specific tab)
POST /find                               # Semantic search in page
POST /tabs/{id}/find                     # Semantic search (specific tab)
POST /evaluate                           # Evaluate JavaScript
POST /tabs/{id}/evaluate                 # Evaluate JS (specific tab)
```

Snapshot params: `?filter=interactive`, `?format=compact|text|yaml`, `?depth=5`, `?diff=true`, `?selector=main`, `?maxTokens=2000`, `?noAnimations=true`, `?output=file`

Text params: `?mode=raw`, `?format=text`

## Screenshot & PDF

```
GET  /screenshot                         # Screenshot (current tab)
GET  /tabs/{id}/screenshot               # Screenshot (specific tab)
GET  /pdf                                # PDF export (current tab)
POST /pdf                                # PDF export with options
GET  /tabs/{id}/pdf                      # PDF export (specific tab)
POST /tabs/{id}/pdf                      # PDF export with options (specific tab)
GET  /screencast                         # WebRTC screencast stream
GET  /screencast/tabs                    # All tabs screencast
```

Screenshot params: `?raw=true`, `?quality=80`

PDF params: `?raw=true`, `?landscape=true`, `?scale=0.8`, `?pageRanges=1-5`, `?output=file`, `?path=/tmp/out.pdf`

## Downloads & Uploads

```
GET  /download                           # Download file via browser session
GET  /tabs/{id}/download                 # Download (specific tab)
POST /upload                             # Upload file to input element
POST /tabs/{id}/upload                   # Upload (specific tab)
```

Download params: `?url=<url>`, `?raw=true`, `?output=file`

Upload body: `{"selector": "input[type=file]", "files": ["data:...base64..."]}`

## Cookies

```
GET  /cookies                            # Get cookies for current page
POST /cookies                            # Set cookies
GET  /tabs/{id}/cookies                  # Get cookies (specific tab)
POST /tabs/{id}/cookies                  # Set cookies (specific tab)
```

## Fingerprint

```
POST /fingerprint/rotate                 # Rotate browser fingerprint
```

## Instances (multi-instance)

```
GET  /instances                          # List all instances
GET  /instances/{id}                     # Get instance details
GET  /instances/tabs                     # List tabs across all instances
GET  /instances/metrics                  # Metrics across all instances
POST /instances/start                    # Start new instance
POST /instances/launch                   # Launch by profile name
POST /instances/attach                   # Attach external browser
POST /instances/{id}/start               # Start specific instance
POST /instances/{id}/stop                # Stop specific instance
GET  /instances/{id}/logs                # Instance logs (ring buffer)
GET  /instances/{id}/logs/stream         # Stream logs (SSE)
GET  /instances/{id}/tabs                # List instance tabs
POST /instances/{id}/tabs/open           # Open tab in instance
POST /instances/{id}/tab                 # Tab action proxied to instance
```

## Profiles

```
GET  /profiles                           # List all profiles
POST /profiles                           # Create profile
POST /profiles/create                    # Create profile (alias)
GET  /profiles/{id}                      # Get profile details
PATCH /profiles/{id}                     # Update profile
DELETE /profiles/{id}                    # Delete profile
POST /profiles/{id}/start               # Start instance for profile
POST /profiles/{id}/stop                # Stop instance for profile
GET  /profiles/{id}/instance            # Get profile's running instance
POST /profiles/{id}/reset               # Reset profile data
GET  /profiles/{id}/logs                # Profile action logs
GET  /profiles/{id}/analytics           # Profile analytics
POST /profiles/import                   # Import profile from path
PATCH /profiles/meta                    # Update profile metadata
```

## Scheduler

```
POST /tasks                              # Submit task to queue
GET  /tasks                              # List queued/running tasks
GET  /tasks/{id}                         # Get task status and result
POST /tasks/{id}/cancel                  # Cancel a task
POST /tasks/batch                        # Submit batch of tasks
GET  /scheduler/stats                    # Queue stats (depth, inflight, agents)
```

Task body: `{"agentId": "...", "action": "snapshot", "tabId": "..."}`

## Config (Dashboard API)

```
GET  /api/config                         # Get current configuration
PUT  /api/config                         # Update configuration
POST /api/config/generate-token          # Generate new auth token
```