Перейти к содержимому

Local API reference

Это содержимое пока не доступно на вашем языке.

REST API of the Mirage desktop app on 127.0.0.1. Authenticate with Authorization: Bearer <key>; the port is random unless fixed in settings and is published in <dataDir>/automation/local-api.json. Errors follow RFC 9457 with a machine code.

  • Version: 1
  • Base URL: http://127.0.0.1:{port}
  • Authentication: Authorization: Bearer <key> on every request.

GET /v1/

API version and what the calling key may do

Responses

GET /v1/profiles

List profiles, newest change first; q searches name and notes

Parameter In Type Required Notes
q query string no Max length 200.
sort query "name", "updatedAt", "createdAt", "lastLaunchedAt" no Default "updatedAt".
dir query "asc", "desc" no Default "desc".
limit query integer no Default 100. Min 1. Max 500.
offset query integer no Default 0. Min 0.
scope query "all", "running", "trash" no Default "all".
folderId query string no Min length 1. Max length 64.
tagId query string no Min length 1. Max length 64.
status query string no Min length 1. Max length 40.

Responses

POST /v1/profiles

Create a local profile with its browser (coreKind), OS, proxy, folder, tags, notes or template; temporary makes a one-time profile, deleted when its session ends

Request body

Field Type Required Notes
name string yes Min length 1. Max length 120.
temporary boolean no
os "windows", "macos", "linux" no
coreKind "camoufox", "chromium" no
notes string no Max length 10000.
proxyId string or null no
folderId string or null no
tagIds array of string no
templateId string no Min length 1. Max length 64.
settings object no
settings.webrtc "proxy", "disabled", "real" no
settings.timezone string or null no
settings.locale string or null no
settings.geolocation object or null no
settings.startUrls array of string (uri) no
settings.device object no
settings.device.screen object or null no
settings.device.cores integer or null no
settings.device.pinCores boolean no
settings.device.mediaDevices "auto", "none" no
settings.device.canvas "placeholder", "real" no
settings.device.webgl "auto", "off" no
settings.device.doNotTrack boolean no
settings.device.globalPrivacyControl boolean no
settings.device.images "auto", "off" no
settings.device.video "auto", "off" no
settings.deleteProtected boolean no
settings.proxyPool string or null no

Responses

GET /v1/profiles/{id}

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

PATCH /v1/profiles/{id}

Change name, notes, status, proxy, folder or tags; only the fields present change

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
name string no Min length 1. Max length 120.
notes string no Max length 10000.
status string or null no
proxyId string or null no
folderId string or null no
tagIds array of string no
deleteProtected boolean no
settings object no
settings.webrtc "proxy", "disabled", "real" no
settings.timezone string or null no
settings.locale string or null no
settings.geolocation object or null no
settings.startUrls array of string (uri) no
settings.device object no
settings.device.screen object or null no
settings.device.cores integer or null no
settings.device.pinCores boolean no
settings.device.mediaDevices "auto", "none" no
settings.device.canvas "placeholder", "real" no
settings.device.webgl "auto", "off" no
settings.device.doNotTrack boolean no
settings.device.globalPrivacyControl boolean no
settings.device.images "auto", "off" no
settings.device.video "auto", "off" no
settings.deleteProtected boolean no
settings.proxyPool string or null no

Responses

DELETE /v1/profiles/{id}

Move the profile to the trash; restore brings it back until the trash empties

A running profile is not deleted (409): stop it first. Profiles under an agent policy are deleted in the app.

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

GET /v1/profiles/{id}/settings

Launch settings the profile’s next start uses: proxy pool, WebRTC, region, device values

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

POST /v1/profiles/{id}/restore

Bring a profile back from the trash

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

GET /v1/folders

Folders of the profile list, with their parent and how many profiles each holds

Responses

GET /v1/tags

Tags with how many profiles carry each

Responses

GET /v1/profiles/{id}/cookies

Export the profile’s cookies as JSON, Netscape or Base64

Parameter In Type Required Notes
format query "json", "netscape", "base64" no Default "json".
domains query string no Max length 20000.
id path string yes Min length 1. Max length 64.

Responses

POST /v1/profiles/{id}/cookies

Import cookies (JSON, Netscape or Base64): into the running browser at once, otherwise at its next start

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
text string yes Min length 1. Max length 50000000.
mode "add", "replace" no Default "add".

Responses

POST /v1/profiles/{id}/start

Start the profile (or reuse it if it already runs) and return a Playwright endpoint; firefox.connect(automation.wsEndpoint) (chromium.connect for a Chromium profile) then sees the profile as browser.contexts()[0]; a Chromium profile also has cdpEndpoint, and debuggerAddress when started with debugger: true

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
headless boolean no Default false.
automation boolean no Default true.
debugger boolean no Default false.

Responses

POST /v1/profiles/{id}/stop

Close the browser gracefully; resolves when it has exited

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

POST /v1/profiles/{id}/markers

Put a mark with an optional note in the profile’s Blackbox recording

The mark appears on the recording’s timeline with a screenshot of the active page. 404 when the profile is not being recorded.

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
text string no Max length 1000.

Responses

GET /v1/proxies

List proxies with their last check; passwords are never returned

Parameter In Type Required Notes
q query string no Max length 200.
status query "ok", "slow", "dead", "unchecked" no
tag query string no Max length 40.

Responses

POST /v1/proxies

Request body

Field Type Required Notes
name string no Max length 120.
type "http", "https", "socks5" yes
host string yes Min length 1. Max length 253.
port integer yes Min 1. Max 65535.
username string no Max length 255.
password string no Max length 255.
changeIpUrl string (uri) no Max length 2000.
rotateOnLaunch boolean no
rotateEveryMin integer or null no
tags array of string no

Responses

POST /v1/proxies/import

Add proxies from a pasted list (one per line, common formats); checks them by default

Request body

Field Type Required Notes
text string yes Max length 1000000.
defaultType "http", "https", "socks5" no Default "http".
tags array of string no Default [].
skipDuplicates boolean no Default true.
check boolean no Default true.

Responses

GET /v1/proxies/{id}

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

PATCH /v1/proxies/{id}

Change a proxy; null clears the login, password or change-IP link

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
name string no Max length 120.
type "http", "https", "socks5" no
host string no Min length 1. Max length 253.
port integer no Min 1. Max 65535.
username string or null no
password string or null no
changeIpUrl string (uri) or null no
rotateOnLaunch boolean no
rotateEveryMin integer or null no
tags array of string no

Responses

DELETE /v1/proxies/{id}

Delete a proxy; its profiles switch to replaceWith or run without a proxy

Parameter In Type Required Notes
replaceWith query string no Min length 1. Max length 64.
id path string yes Min length 1. Max length 64.

Responses

POST /v1/proxies/{id}/check

Check the proxy now: reachability, exit IP, GeoIP and IP class

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

POST /v1/proxies/{id}/change-ip

Call the mobile proxy’s change-IP link, then check it again

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

GET /v1/extensions

The extension library with access, versions and how many profiles use each

Responses

POST /v1/extensions

Add an extension from Firefox Add-ons (page, slug, id or guid), Chrome Web Store (page or id) or a link to an .xpi or .crx; the same extension added again replaces its version. Refusals say why in reason

Request body

Field Type Required Notes
source object or object or object yes
format "xpi", "crx" no

Responses

GET /v1/extensions/search

Search Firefox Add-ons (extensions for Firefox only)

Parameter In Type Required Notes
q query string yes Min length 1. Max length 200.
page query integer no Default 1. Min 1. Max 50.

Responses

GET /v1/extensions/{id}

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

PATCH /v1/extensions/{id}

Turn auto-update on or off (extensions from Firefox Add-ons only)

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
autoUpdate boolean yes

Responses

DELETE /v1/extensions/{id}

Remove an extension from the library and from every profile

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

POST /v1/extensions/{id}/update

Install the newest Firefox Add-ons version now; profiles get it at their next launch

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

POST /v1/extensions/{id}/install

Install into profiles; running ones get it at their next launch (pendingRestart)

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
profileIds array of string yes

Responses

POST /v1/extensions/{id}/uninstall

Take out of profiles; running ones lose it at their next launch (pendingRestart)

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Request body

Field Type Required Notes
profileIds array of string yes

Responses

GET /v1/profiles/{id}/extensions

Ids of the profile’s extensions in the order the browser loads them

Parameter In Type Required Notes
id path string yes Min length 1. Max length 64.

Responses

Schemas

AutomationEndpoint

Field Type Required Notes
wsEndpoint string yes
playwrightVersion string yes
browser "firefox", "chromium" yes
cdpEndpoint string no Chromium profiles: DevTools WebSocket for Puppeteer and connectOverCDP; single-use, like wsEndpoint
debuggerAddress string no Chromium profiles started with debugger: true: host:port for Selenium’s debuggerAddress, open while the session lives
expiresAt string (date-time) yes

CookieExport

Field Type Required Notes
format "json", "netscape", "base64" yes
count integer yes Min 0.
text string yes

CookieImportResult

Field Type Required Notes
imported integer yes Min 0.
skipped integer yes Min 0.
applied "now", "next_launch", "none" yes

Extension

Field Type Required Notes
id string yes
addonId string yes
format "xpi", "crx" yes
name string yes
version string yes
description string yes
source "amo", "cws", "url", "file" yes
sourceRef string yes
autoUpdate boolean yes
updateVersion string or null yes
access array of "all_sites", "some_sites", "tabs", "cookies", "history", "downloads", "proxy" yes
icon string or null yes
sha256 string yes
size integer yes Min 0.
profiles integer yes Min 0.
createdAt string (date-time) yes
updatedAt string (date-time) yes

ExtensionAddResult

Field Type Required Notes
extension Extension yes
replaced boolean yes

ExtensionDeleteResult

Field Type Required Notes
removed integer yes Min 0.

ExtensionInstallResult

Field Type Required Notes
added integer yes Min 0.
skipped integer yes Min 0.
pendingRestart array of string yes

ExtensionList

Field Type Required Notes
extensions array of Extension yes

ExtensionSearchResult

Field Type Required Notes
results array of FirefoxAddon yes
total integer yes Min 0.

ExtensionUninstallResult

Field Type Required Notes
removed integer yes Min 0.
pendingRestart array of string yes

ExtensionUpdateResult

Field Type Required Notes
updated boolean yes
previousVersion string or null yes
extension Extension yes

FirefoxAddon

Field Type Required Notes
amoId integer yes
guid string yes
slug string yes
name string yes
summary string yes
iconUrl string or null yes
version string yes
users integer yes Min 0.
rating number or null yes
url string yes

FolderList

Field Type Required Notes
folders array of object yes

LocalApiInfo

Field Type Required Notes
name string yes
apiVersion number yes
appVersion string yes
playwrightVersion string or null yes
key object yes
key.id string yes
key.name string yes
key.actor "script", "mcp", "automation-device" yes
key.scopes array of "profiles:read", "profiles:write", "profiles:launch", "proxies:read", "proxies:write", "mcp" yes
key.profileIds array of string or null yes

MarkerResult

Field Type Required Notes
recordingId string yes
markerId string yes
at number yes
screenshot boolean yes

Problem

Field Type Required Notes
type string yes Default "about:blank".
title string yes
status integer yes Min 400. Max 599.
detail string no
instance string no
code "validation_failed", "unauthorized", "forbidden", "not_found", "conflict", "core_capability_missing", "lease_held", "upgrade_required", "rate_limited", "internal", "invalid_credentials", "email_not_verified", "account_restricted", "account_banned", "device_not_trusted", "fresh_session_required", "plan_limit", "gone", "stale_epoch", "rev_conflict", "generation_changed", "signature_invalid", "payment_provider_error", "unavailable", "misdirected_request", "playwright_version_mismatch", "automation_limit_reached" yes
errors array of object no
requestId string no
reason string no
data object no

Profile

Field Type Required Notes
id string yes
name string yes
notes string yes
color "gray", "red", "orange", "yellow", "green", "teal", "blue", "purple", "pink", "rose" or null yes
status string or null yes
favorite boolean yes
storage "local", "cloud" yes
folderId string or null yes
tagIds array of string yes
proxyId string or null yes
coreKind string yes
createdAt string (date-time) yes
updatedAt string (date-time) yes
lastLaunchedAt string (date-time) or null yes
trashedAt string (date-time) or null yes
temporary boolean yes
run object yes
run.state "stopped", "starting", "running", "stopping", "crashed" yes
run.pid integer no
run.since string (date-time) no
run.reason "requested", "window_closed", "crashed", "launch_failed", "host_lost", "taken_over" no
run.needsRestart boolean no
risk object or null yes
lastExit object or null yes
deleteProtected boolean yes

ProfileDeleteResult

Field Type Required Notes
trashed boolean yes
purgeAfterDays integer yes

ProfileExtensions

Field Type Required Notes
extensionIds array of string yes

ProfileList

Field Type Required Notes
profiles array of Profile yes
total integer yes Min 0.

ProfileSettings

Field Type Required Notes
webrtc "proxy", "disabled", "real" yes Default "proxy".
timezone string or null yes Default null.
locale string or null yes Default null.
geolocation object or null yes Default null.
startUrls array of string (uri) yes Default [].
device object yes
device.screen object or null yes Default null.
device.cores integer or null yes Default null.
device.pinCores boolean yes Default false.
device.mediaDevices "auto", "none" yes Default "auto".
device.canvas "placeholder", "real" yes Default "placeholder".
device.webgl "auto", "off" yes Default "auto".
device.doNotTrack boolean yes Default false.
device.globalPrivacyControl boolean yes Default false.
device.images "auto", "off" yes Default "auto".
device.video "auto", "off" yes Default "auto".
deleteProtected boolean yes Default false.
proxyPool string or null yes Default null.

ProfileStartResult

Field Type Required Notes
profile Profile yes
automation AutomationEndpoint or null yes

Proxy

Field Type Required Notes
id string yes
name string yes
type "http", "https", "socks5" yes
host string yes
port integer yes
username string or null yes
hasPassword boolean yes
hasChangeIpUrl boolean yes
rotateOnLaunch boolean yes
rotateEveryMin integer or null yes
tags array of string yes
lastCheck ProxyCheck or null yes
profiles integer yes Min 0.
createdAt string (date-time) yes
updatedAt string (date-time) yes

ProxyChangeIpResult

Field Type Required Notes
linkStatus integer yes
check ProxyCheck yes

ProxyCheck

Field Type Required Notes
status "ok", "slow", "dead" yes
checkedAt string (date-time) yes
latencyMs integer no Min 0.
ip string no
previousIp string no
error "timeout", "auth_failed", "refused", "dns", "unreachable", "protocol", "tls", "bad_response" no
detail string no Max length 300.
geo object no
geo.country string no Min length 2. Max length 2.
geo.region string no
geo.city string no
geo.timezone string no
geo.asn integer no
geo.org string no
geo.ipType "residential", "mobile", "datacenter", "unknown" yes

ProxyDeleteResult

Field Type Required Notes
deleted integer yes Min 0.
profilesUpdated integer yes Min 0.

ProxyImportResult

Field Type Required Notes
created array of string yes
duplicates integer yes Min 0.
invalid integer yes Min 0.

ProxyList

Field Type Required Notes
proxies array of Proxy yes

TagList

Field Type Required Notes
tags array of object yes