Skip to content
Hoody.com

The Instance Control API provides endpoints for inspecting metadata, managing tabs, controlling browser lifecycle, and manipulating cookies within a Hoody browser container. Use these endpoints to query session information, list open tabs, retrieve Chrome DevTools connection details, modify the runtime viewport, and manage the cookie store of a running browser instance. All endpoints target the browser-1 service on the container’s subdomain.

GET /metadata

Retrieves detailed metadata for an existing browser instance, including session information, browser details, operating system, viewport, geolocation, open tabs, and the Chrome DevTools WebSocket URL (when remote debugging is enabled).

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
{
"engine": "playwright",
"stealth": false,
"headless": true,
"chromiumBuildId": "136.0.7103.113",
"chromiumExecutablePath": "/hoody/storage/hoody-browser/chrome/chrome/linux-136.0.7103.113/chrome-linux64/chrome",
"browserExecutablePath": "/hoody/storage/hoody-browser/chrome/chrome/linux-136.0.7103.113/chrome-linux64/chrome",
"fingerprintId": "default",
"display": ":99",
"iframe_url": null,
"browser_id": "0",
"browser_host": "browser-1",
"browser_port": 9222,
"sessionId": "sess_a1b2c3d4e5f6",
"sessionName": "default",
"timezoneId": "America/New_York",
"locale": "en-US",
"geolocation": {
"latitude": 40.7128,
"longitude": -74.006,
"accuracy": 50
},
"viewport": {
"width": 1280,
"height": 720
},
"viewportSource": "creation",
"userAgentString": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
"browserName": "chromium",
"browserFullVersion": "136.0.7103.113",
"operatingSystemName": "Linux",
"operatingSystemPlatform": "linux",
"operatingSystemVersion": "5.15.0",
"renderingEngine": "Blink",
"renderingEngineVersion": "136.0.7103.113",
"webSocketDebuggerUrl": "wss://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com/devtools/browser/b6e7d6f4-8d1e-4f3a-9b2c-1d4e5f6g7h8i",
"devtoolsHttpUrl": "https://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com/json/version",
"devtoolsFrontendUrl": "https://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com",
"extensions": [],
"useRemoteDebuggingPort": true,
"remoteDebuggingPort": 9222,
"remoteDebuggingAddress": "0.0.0.0",
"quicDisabled": true,
"http3Disabled": true,
"dnsOverHttpsEnabled": true,
"dnsOverHttpsUrl": "https://cloudflare-dns.com/dns-query",
"tabs": [
{
"id": 1,
"url": "https://example.com"
}
]
}

When the browser is launched with remote debugging enabled (via useRemoteDebuggingPort=true and browser=chromium), webSocketDebuggerUrl, devtoolsHttpUrl, and devtoolsFrontendUrl are populated. In Hoody container deployments these URLs are rewritten onto the cdp-{N} proxy hostname pattern (paired 1:1 with browser-{N}). The WebSocket URL is not promised stable across browser restarts; prefer chromium.connectOverCDP("https://...-cdp-{N}/"), which resolves the live URL via /json/version and cold-starts instance N on demand.

When the browser uses pipe transport (default behavior), the three DevTools URL fields are null:

{
"engine": "playwright",
"browser_id": "0",
"browser_host": "browser-1",
"browser_port": 9222,
"sessionId": "sess_a1b2c3d4e5f6",
"sessionName": "default",
"webSocketDebuggerUrl": null,
"devtoolsHttpUrl": null,
"devtoolsFrontendUrl": null,
"useRemoteDebuggingPort": false,
"remoteDebuggingPort": null,
"tabs": [
{
"id": 1,
"url": "https://example.com"
}
]
}
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/metadata?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

GET /devtools-url

Returns the Chrome DevTools WebSocket URL and HTTP discovery URL for the specified browser instance. The HTTP URL (/json/version) can be used to resolve the WebSocket endpoint automatically.

In container deployments these URLs are minted on the cdp-{N} hostname (paired 1:1 with browser-{N}). The relay is reached HTTP-first: connect with chromium.connectOverCDP("https://...-cdp-{N}/"), which fetches /json/version to resolve the live WebSocket endpoint before upgrading, and cold-starts instance N on demand if it isn’t already running. Only the read-only discovery endpoints (/json/version, /json/list, /json) and DevTools WebSocket sessions (/devtools/browser/<id>, /devtools/page/<id>) are relayed — mutation endpoints (/json/new, /json/close, /json/activate) are not exposed.

These URLs are populated when the instance is launched with useRemoteDebuggingPort=true and browser=chromium. Otherwise they will be null.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
{
"webSocketDebuggerUrl": "wss://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com/devtools/browser/b6e7d6f4-8d1e-4f3a-9b2c-1d4e5f6g7h8i",
"devtoolsHttpUrl": "https://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com/json/version",
"devtoolsFrontendUrl": "https://{projectId}-{containerId}-cdp-1.{server}.containers.hoody.com"
}
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/devtools-url?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

GET /tabs

Lists all open tabs in a browser instance. Each tab includes its identifier, current URL, and whether it is the active tab.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
[
{
"id": 1,
"url": "https://example.com",
"isActive": true
},
{
"id": 2,
"url": "https://docs.example.com/getting-started",
"isActive": false
}
]
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/tabs?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

POST /tab/close

Closes a specific browser tab by its tab ID. If no tabId is provided, closes the active tab (unless it is the last remaining tab).

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
FieldTypeRequiredDescription
tabIdintegerNoThe ID of the tab to close
{
"closed": 1,
"remaining": 1
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/tab/close?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tabId": 2}'

GET /shutdown

Shuts down a specific browser instance. The instance can be recreated later via /start.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
{
"message": "Instance shutdown successfully"
}
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/shutdown?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

GET /viewport

Returns the instance’s current viewport policy without mutating anything. viewport: null means fixed-viewport emulation is disabled (responsive — the page follows the real window size). source is creation until the first successful POST /viewport, then runtime. converged reports whether every live page currently reflects the policy.

NameInTypeRequiredDescription
browser_hostquerystringNoInstance host. Must be paired with browser_port; when both are omitted the single running instance is selected (400 AMBIGUOUS_INSTANCE with more than one).
browser_portqueryintegerNoInstance port. Must be paired with browser_host.
{
"viewport": {
"width": 1280,
"height": 720
},
"source": "creation",
"tabs": 2,
"converged": true
}
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/viewport" \
-H "Authorization: Bearer $HOODY_TOKEN"

POST /viewport

Mutates the running instance’s viewport policy. JSON body only:

  • Fixed size: {"viewport": {"width": 1280, "height": 800}} (integers 1..8192; no other keys)
  • Responsive (follow the real window): {"viewport": null}

Applies to every currently-open tab; tabs opened later inherit the policy.

NameInTypeRequiredDescription
browser_hostquerystringNoInstance host. Must be paired with browser_port; when both are omitted the single running instance is selected (400 AMBIGUOUS_INSTANCE with more than one).
browser_portqueryintegerNoInstance port. Must be paired with browser_host.
FieldTypeRequiredDescription
viewportobject | nullYesFixed size {width, height} (integers 1..8192, no other keys), or null for responsive.

The fixed-size object accepts only these properties:

FieldTypeRequiredDescription
widthintegerYesViewport width (1..8192).
heightintegerYesViewport height (1..8192).
{
"viewport": {
"width": 1280,
"height": 800
},
"source": "runtime",
"tabs": 2,
"converged": true
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/viewport" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"viewport": {"width": 1280, "height": 800}}'

GET /cookies

Returns all cookies for the browser context, optionally filtered by URL. Each cookie includes its name, value, domain, path, httpOnly and secure flags.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
urlquerystringNoFilter cookies by URL
{
"cookies": [
{
"name": "session",
"value": "abc123xyz789",
"domain": ".example.com",
"path": "/",
"httpOnly": true,
"secure": true
},
{
"name": "pref",
"value": "compact",
"domain": ".example.com",
"path": "/",
"httpOnly": false,
"secure": false
}
]
}
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/cookies?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

POST /cookies

Adds cookies to the browser context. Each cookie entry in the cookies array requires name, value, and url. The optional domain, path, httpOnly, and secure fields override inferred defaults.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
FieldTypeRequiredDescription
cookiesarrayYesList of cookies to add.

Each cookie object supports:

FieldTypeRequiredDescription
namestringYesCookie name.
valuestringYesCookie value.
urlstringYesURL the cookie is associated with.
domainstringNoCookie domain (overrides inferred from url).
pathstringNoCookie path.
httpOnlybooleanNoSet the HttpOnly flag.
securebooleanNoSet the Secure flag.
{
"added": 2
}
Terminal window
curl -X POST "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/cookies?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookies": [
{
"name": "auth",
"value": "token_abc123",
"url": "https://example.com",
"httpOnly": true,
"secure": true
}
]
}'

DELETE /cookies

Removes all cookies from the browser context.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Default mode: instances are created automatically. Set to false to prevent creation. When auto-start is disabled globally, set to true to create an instance. Omitting this parameter is not equivalent to sending true — the server branches on HOODY_DISABLE_AUTO_START (DISABLE ? start === 'true' : start !== 'false'), so an ABSENT value means “auto-start unless the operator disabled it” while an explicit true means “start even though the operator disabled it”.
{
"cleared": true
}
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/cookies?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"