This is the complete reference for the Santiago automation API: the set of endpoints the local daemon exposes for controlling a running browser profile. Every endpoint drives a real Playwright-backed page inside the anti-detect browser, so the same fingerprint and proxy you configured for the profile apply to every action.
For setup and high-level usage, see HTTP API basics and Best practices . For worked end-to-end flows, see the automation guides .
All automation endpoints live under the local daemon and target one running profile by id:
http://localhost:7891/api/automation/:profileId/<action>
The daemon listens on http://localhost:7891 only. Replace :profileId with the id of a running profile — launch it first (see Launch profiles for automation ). Calls to a profile that is not running return 404 PROFILE_NOT_RUNNING.
Element targeting
Most interaction endpoints accept either ref (an element id from a snapshot) or selector (a CSS selector). At least one is required. The ref workflow is the most reliable: take a snapshot, read the [ref=eN] ids, then act on them.
Every endpoint returns the same envelope.
{ "ok" : true , "data" : { ... } }
{ "ok" : false , "error" : { "code" : " ERROR_CODE " , "message" : " ... " } }
Actions that only succeed or fail (click, hover, type, mouse moves, etc.) return { "ok": true } with no data. Endpoints that produce a value (snapshot, screenshot, navigate, tabs, evaluate, dialog) populate data.
Constant Value Applies to Navigation timeout 30s navigate, back, forward, reload, opening a tab with a URLAction timeout 2s Interaction endpoints (click, hover, type, select-option, scroll-to, screenshots of an element) Wait timeout 15s (default) wait endpoint; override with the timeout field
Why interactions fail fast
The action timeout is deliberately short (2s). On animated or unstable pages, a long wait on scroll-into-view is wasted time. If a locator-based action times out, fall back to coordinate-based mouse actions or fill-page .
Method Path Key params Purpose POST /:profileId/navigateurl (required)Navigate to a URL. POST /:profileId/backnone Go back in history. POST /:profileId/forwardnone Go forward in history. POST /:profileId/reloadnone Reload the current page.
All four return { ok, data: { url, title } } with the resulting page URL and title.
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /navigate \
-H ' Content-Type: application/json ' \
-d ' {"url": "https://example.com"} '
{ "ok" : true , "data" : { "url" : " https://example.com/ " , "title" : " Example Domain " } }
Method Path Key params Purpose POST /:profileId/snapshotselector, depthCapture the accessibility tree of the page and get element refs. POST /:profileId/screenshotfullPage, ref, selectorTake a base64-encoded PNG screenshot.
Capture the accessibility tree of the current page. This is the primary way to “see” page structure and obtain [ref=eN] ids for later actions.
Field Type Default Description selectorstring — CSS selector to scope the snapshot to one element subtree depthnumber — Limit tree depth
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /snapshot \
-H ' Content-Type: application/json ' \
{ "ok" : true , "data" : { "snapshot" : " - heading \" Example \" [ref=e1] \n - textbox \" Email \" [ref=e2] \n ... " } }
Take a screenshot. Returns a base64-encoded PNG string. Provide ref or selector to capture a single element; otherwise the viewport (or full page) is captured.
Field Type Default Description fullPageboolean falseCapture the full scrollable page (ignored when ref/selector is set) refstring — Screenshot a specific element by ref selectorstring — Screenshot a specific element by CSS selector
{ "ok" : true , "data" : { "screenshot" : " iVBORw0KGgo... " } }
All interaction endpoints below accept either ref (from snapshot) or selector (CSS); at least one is required.
Method Path Key params Purpose POST /:profileId/clickref/selector, button, doubleClick, modifiersClick an element. POST /:profileId/hoverref/selectorHover over an element. POST /:profileId/dragstartRef/startSelector, endRef/endSelectorDrag and drop between two elements. POST /:profileId/scroll-toref/selectorScroll an element into view.
Field Type Default Description refstring — Element ref from snapshot selectorstring — CSS selector button"left" | "right" | "middle""left"Mouse button doubleClickboolean falseDouble click modifiersstring[] — "Alt", "Control", "ControlOrMeta", "Meta", "Shift"
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /click \
-H ' Content-Type: application/json ' \
Field Type Description refstring Element ref selectorstring CSS selector
Drag from a source element to a target element. Each side accepts a ref or a selector.
Field Type Description startRefstring Source element ref startSelectorstring Source CSS selector endRefstring Target element ref endSelectorstring Target CSS selector
Scroll an element into view.
Field Type Description refstring Element ref selectorstring CSS selector
Two endpoints cover the two kinds of dropdowns you meet on the web: native <select> elements and custom ARIA combobox widgets.
Method Path Key params Purpose POST /:profileId/select-optionref/selector, values (required)Select option(s) in a native <select>. POST /:profileId/select-comboboxref/selector, value (required), optionSelectorSmart selection for custom ARIA combobox dropdowns.
Select option(s) in a native <select> element.
Field Type Required Description ref / selectorstring yes Target <select> element valuesstring[] yes Values to select
{ "ok" : true , "data" : { "selected" : [ " value1 " ] } }
Smart selection for ARIA combobox dropdowns — the custom <div role="combobox"> widgets used by many modern web apps. It performs the whole sequence: click to open, read aria-controls to find the listbox, wait for the listbox to become visible (5s), find the [role="option"] matching value (or your optionSelector), and click it.
Field Type Required Description ref / selectorstring yes Target combobox element valuestring yes Option text to select optionSelectorstring — Custom CSS selector for the option (overrides text matching)
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /select-combobox \
-H ' Content-Type: application/json ' \
-d ' {"ref": "e5", "value": "March"} '
{ "ok" : true , "data" : { "selected" : " March " } }
Method Path Key params Purpose POST /:profileId/typeref/selector, text (required)Clear a field and type a value (human-like per-key delay). POST /:profileId/press-sequentiallyref/selector, text (required), delayType text key by key without clearing first. POST /:profileId/press-keykey (required), modifiersPress a key or key combination. POST /:profileId/fill-formfields (required)Fill multiple fields at once (ref/selector based). POST /:profileId/fill-pagefields, submit, waitAfterSubmitHigh-level coordinate-based form fill + optional submit.
Focus a field, clear its existing value, then type the new value with a human-like per-key delay.
Field Type Required Description ref / selectorstring yes Target input element textstring yes Text to type
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /type \
-H ' Content-Type: application/json ' \
-d ' {"ref": "e2", "text": "jane.doe@example.com"} '
Type text key by key into the targeted element (does not clear first). Useful for inputs that react to each keystroke.
Field Type Default Description ref / selectorstring required Target element textstring required Text to type delaynumber 50Delay between keys in ms
Press a single keyboard key or a combination. With modifiers, the daemon joins them into a chord (for example Control+a).
Field Type Description keystring Key name: "Enter", "Tab", "Escape", "a", "F1", etc. modifiersstring[] "Alt", "Control", "ControlOrMeta", "Meta", "Shift"
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /press-key \
-H ' Content-Type: application/json ' \
Fill multiple form fields in one call. Each field is filled via a Playwright locator (click, clear, type); if that fails, the daemon falls back to a coordinate-based strategy (resolve bounding box, click center, select-all, delete, type). Each field result reports the strategy used (locator or coords).
Field Type Required Description fieldsarray yes [{ ref?, selector?, value }]
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /fill-form \
-H ' Content-Type: application/json ' \
{"ref": "e2", "value": "Jane Doe"},
{"selector": "#email", "value": "jane@example.com"}
{ "ref" : " e1 " , "ok" : true },
{ "selector" : " #email " , "ok" : true },
{ "ref" : " e3 " , "ok" : false , "error" : " Element not found " }
A high-level, coordinate-based fill that bypasses Playwright locators entirely (evaluate to find centers, then mouse + keyboard). One call can fill a whole form, select comboboxes, and click submit — replacing many round-trips. Comboboxes are opened, the matching option is clicked, and the selection is verified (with one automatic retry).
Field Type Default Description fieldsarray — Array of field objects (see below) submitobject — { selector?, text? } submit button (selector first, then text fallback)waitAfterSubmitnumber 2000Milliseconds to wait after clicking submit
Each entry in fields:
Field Type Default Description selectorstring required CSS selector for the element valuestring required Value to type, or the option text to select type"text" | "combobox""text"Field kind nthnumber 00-based index when the selector matches multiple elements optionSelectorstring li[role=option]CSS for option elements (combobox only)
At least one of fields or submit is required (otherwise 400 BAD_REQUEST).
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /fill-page \
-H ' Content-Type: application/json ' \
{"selector": "#firstName", "value": "Jane"},
{"selector": "#month", "value": "March", "type": "combobox"}
"submit": {"text": "Submit"},
{ "selector" : " #firstName " , "type" : " text " , "ok" : true },
{ "selector" : " #month " , "type" : " combobox " , "ok" : true , "selectedValue" : " March " }
"submit" : { "ok" : true , "url" : " https://example.com/welcome " }
Low-level mouse control by viewport coordinates. Use these when locator-based interaction is blocked or unreliable.
Method Path Key params Purpose POST /:profileId/mouse/movex, y (required)Move the cursor to a point. POST /:profileId/mouse/clickx, y (required), buttonClick at a point. POST /:profileId/mouse/downbuttonPress a mouse button down. POST /:profileId/mouse/upbuttonRelease a mouse button. POST /:profileId/mouse/wheeldeltaX, deltaYScroll the wheel.
Field Type Required xnumber yes ynumber yes
Field Type Default xnumber required ynumber required button"left" | "right" | "middle""left"
Field Type Default button"left" | "right" | "middle""left"
Field Type Default Description deltaXnumber 0Horizontal scroll deltaYnumber 0Vertical scroll (positive = down)
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /mouse/click \
-H ' Content-Type: application/json ' \
-d ' {"x": 480, "y": 320} '
Method Path Key params Purpose GET /:profileId/tabsnone List open tabs. POST /:profileId/tabs/newurlOpen a new tab (blank if url omitted). POST /:profileId/tabs/selectindex (required)Switch to a tab by index. POST /:profileId/tabs/closeindexClose a tab (defaults to the last; cannot close the last remaining tab).
curl http://localhost:7891/api/automation/ $PROFILE_ID /tabs
{ "ok" : true , "data" : { "tabs" : [{ "index" : 0 , "url" : " https://... " , "title" : " ... " }] } }
Field Type Default Description urlstring — URL to open (blank tab if omitted)
Returns { ok, data: { index, url, title } }.
Field Type Required indexnumber yes
Returns { ok, data: { index, url, title } }. Out-of-range index returns 400 BAD_REQUEST.
Field Type Default Description indexnumber last tab Tab index to close
Returns { ok, data: { closedIndex } }. Closing the only remaining tab returns 400 LAST_TAB — stop the profile instead.
Method Path Key params Purpose POST /:profileId/evaluatecode (required)Run JavaScript in the page context and return the result.
Field Type Required codestring yes
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /evaluate \
-H ' Content-Type: application/json ' \
-d ' {"code": "document.title"} '
{ "ok" : true , "data" : { "result" : " Example Domain " } }
Method Path Key params Purpose POST /:profileId/waittext, selector, state, timeoutWait for an element/text state, or a fixed time.
If you pass selector or text, the call waits for that element to reach state. If you pass neither, it just waits for timeout milliseconds.
Field Type Default Description textstring — Wait for this text to appear selectorstring — Wait for this CSS selector state"visible" | "hidden" | "attached" | "detached""visible"Target state timeoutnumber 15000Timeout in ms. With no text/selector, waits this long unconditionally
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /wait \
-H ' Content-Type: application/json ' \
-d ' {"selector": "#dashboard", "state": "visible", "timeout": 20000} '
Method Path Key params Purpose POST /:profileId/dialogaction (required), promptTextAccept or dismiss a pending alert/confirm/prompt.
The daemon tracks native dialogs (alert, confirm, prompt) per profile as they open. Call this endpoint to handle the oldest pending one.
Field Type Required Description action"accept" | "dismiss"yes Accept or dismiss the dialog promptTextstring — Text to enter for prompt dialogs (used on accept)
{ "ok" : true , "data" : { "type" : " confirm " , "message" : " Are you sure? " , "defaultValue" : "" } }
If there is no pending dialog, the call returns 404 NO_DIALOG.
Method Path Key params Purpose POST /:profileId/batchactions (required)Run multiple actions in one HTTP call, with human-like pacing.
Execute several actions sequentially in a single request. The daemon inserts a random 80–250ms delay between actions for human-like pacing. It stops on the first error — remaining actions are skipped (so they never run on stale state).
curl -X POST http://localhost:7891/api/automation/ $PROFILE_ID /batch \
-H ' Content-Type: application/json ' \
{"action": "type", "ref": "e1", "text": "Jane Doe"},
{"action": "select-combobox", "ref": "e5", "value": "March"},
{"action": "click", "ref": "e20"}
Available actions and the fields each one uses (same as the matching individual endpoint):
Action Fields clickref/selector, button, doubleClick, modifierstyperef/selector, textpress-sequentiallyref/selector, text, delaypress-keykey, modifiersselect-optionref/selector, valuesselect-comboboxref/selector, value, optionSelectorhoverref/selectorscroll-toref/selectorwaittext, selector, state, timeoutnavigateurlsnapshotselector, depthscreenshotref, selector, fullPageevaluatecode
{ "index" : 0 , "action" : " type " , "ok" : true },
{ "index" : 1 , "action" : " select-combobox " , "ok" : true , "data" : { "selected" : " March " } },
{ "index" : 2 , "action" : " click " , "ok" : true }
An empty actions array returns 400 BAD_REQUEST.
Code When PROFILE_NOT_RUNNINGThe profile id is not a running profile (HTTP 404). BAD_REQUESTMissing required body fields, or an out-of-range tab index (HTTP 400). LAST_TABAttempt to close the only remaining tab (HTTP 400). NO_DIALOGdialog called with no pending dialog (HTTP 404).NAVIGATE_FAILEDnavigate / back / forward / reload failed.SNAPSHOT_FAILED / SCREENSHOT_FAILEDSnapshot or screenshot failed. CLICK_FAILED / HOVER_FAILED / DRAG_FAILED / SCROLL_FAILEDThe corresponding interaction failed (often a 2s action timeout). SELECT_FAILED / SELECT_COMBOBOX_FAILEDDropdown selection failed. TYPE_FAILED / PRESS_SEQ_FAILED / KEY_PRESS_FAILED / FILL_FORM_FAILED / FILL_PAGE_FAILEDText input failed. MOUSE_FAILEDA coordinate mouse action failed. TABS_FAILED / TAB_NEW_FAILED / TAB_SELECT_FAILED / TAB_CLOSE_FAILEDA tab action failed. EVALUATE_FAILEDThe page script threw. WAIT_FAILEDThe wait condition timed out. DIALOG_FAILEDHandling the dialog failed. BATCH_FAILEDThe batch request could not run (e.g. profile not running).