// Step 1: request a live control tokenconst token = await fetch("https://api.adscrawl.net/cdp/live-token", { method: "POST", headers: { "content-type": "application/json", "x-api-key": "YOUR_API_KEY", }, body: JSON.stringify({ sessionId: "SESSION_ID" }),}).then((r) => r.json());// Step 2: open the live control WebSocket using the returned controlUrlconst socket = new WebSocket(token.controlUrl);socket.addEventListener("open", () => { console.log("Live control session connected");});socket.addEventListener("close", (event) => { console.log("Session closed:", event.code, event.reason);});
// Step 1: request a live control tokenconst token = await fetch("https://api.adscrawl.net/cdp/live-token", { method: "POST", headers: { "content-type": "application/json", "x-api-key": "YOUR_API_KEY", }, body: JSON.stringify({ sessionId: "SESSION_ID" }),}).then((r) => r.json());// Step 2: open the live control WebSocket using the returned controlUrlconst socket = new WebSocket(token.controlUrl);socket.addEventListener("open", () => { console.log("Live control session connected");});socket.addEventListener("close", (event) => { console.log("Session closed:", event.code, event.reason);});
When you need to step in and interact with a running CDP session in real time, use this endpoint to issue a short-lived control token. Pass the returned controlUrl directly to a WebSocket constructor to begin live control.
string
required
The active CDP session ID you want to take live control of.
Response
boolean
true when the token was issued successfully.
string
A wss:// WebSocket URL with the single-use controlToken already embedded as a query parameter. Pass this directly to new WebSocket(...); do not replace or modify the token.
number
Unix timestamp in milliseconds when the controlToken expires. The token is valid for 30 seconds and can only be used once.
Status
Meaning
200
Token issued; controlUrl and expiresAt are in the response body.
400
sessionId is missing from the request body.
401 / 403
The API key is invalid or does not own the target session.
404 / 409 / 410
The session is missing, stopping, or expired.
503
The session backend is unavailable.
500
Failed to issue or store the control token.
The controlToken expires after 30 seconds and can only be consumed once. If the WebSocket connection fails or is not opened in time, call POST /cdp/live-token again to get a fresh token.
Open the live WebSocket
Open a live-control WebSocket connection to the target session at wss://api.adscrawl.net/cdp/live/{sessionId}?controlToken={token}. The server validates the controlToken, connects to the session backend, and then upgrades your client connection. Once connected, CDP messages are proxied bidirectionally and you have full interactive control.
string
required
The session ID embedded in the controlUrl returned by POST /cdp/live-token.
string
required
The single-use token from POST /cdp/live-token. It must be used within 30 seconds of issuance and can only be consumed once.
When the live-control WebSocket closes, the server sends one of the following reason codes:
Code
Reason
Cause
1000
cdp_upstream_closed
The upstream CDP session closed normally.
1000
idle_timeout
The session exceeded the configured idleTimeoutMs.
1000
max_timeout
The session exceeded the configured maxSessionMs.
1011
cdp_upstream_disconnected
The upstream CDP connection dropped unexpectedly.
1011
cdp_upstream_error
An error occurred on the upstream CDP connection.
Status
Meaning
101
WebSocket upgrade succeeded; live control is now active.
401
controlToken is invalid, expired, already used, or does not match sessionId.
404 / 409 / 410
The session is missing, stopping, or expired.
502
The session backend could not be reached before the 101 upgrade.
503
The session backend or control infrastructure is unavailable.
Live control tokens are designed for short bursts of manual or conditional interaction. For fully automated workflows, drive the session directly through cdpBaseUrl with Playwright or Puppeteer instead.
// Step 1: request a live control tokenconst token = await fetch("https://api.adscrawl.net/cdp/live-token", { method: "POST", headers: { "content-type": "application/json", "x-api-key": "YOUR_API_KEY", }, body: JSON.stringify({ sessionId: "SESSION_ID" }),}).then((r) => r.json());// Step 2: open the live control WebSocket using the returned controlUrlconst socket = new WebSocket(token.controlUrl);socket.addEventListener("open", () => { console.log("Live control session connected");});socket.addEventListener("close", (event) => { console.log("Session closed:", event.code, event.reason);});
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"AdsCrawl","description":"Connect with Playwright, Puppeteer, or CDP and run jobs in a full browser environment with residential proxy routing—built for dynamic pages, authenticated sessions, and sites that stop basic scrapers.","colors":{"primary":"#0071e3","light":"#7c7c7e","dark":"#070707"},"logo":{"light":"https://media.brand.dev/4640f1e9-6451-460f-a082-f8c2438d4f3b.svg","dark":"https://mintcdn.com/adscrawl/MOJftQlB9dh80Xox/images/AdsCrawl-Mainlogo2.svg?fit=max\u0026auto=format\u0026n=MOJftQlB9dh80Xox\u0026q=85\u0026s=10300c0754e1fe5c5861c09a260e7d28","href":"https://www.adscrawl.net/"},"favicon":{"light":"https://mintcdn.com/adscrawl/En06nz0S4G8hWrQZ/images/AdsCrawl-Dock4.svg?fit=max\u0026auto=format\u0026n=En06nz0S4G8hWrQZ\u0026q=85\u0026s=c26faf96d0aa9e550d718670e196b8e7","dark":"https://mintcdn.com/adscrawl/En06nz0S4G8hWrQZ/images/AdsCrawl-Dock4.svg?fit=max\u0026auto=format\u0026n=En06nz0S4G8hWrQZ\u0026q=85\u0026s=c26faf96d0aa9e550d718670e196b8e7"},"api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python","go"]},"mdx":{"auth":{"method":"key","name":"x-api-key"},"server":"https://api.adscrawl.net"}},"navbar":{"primary":{"type":"button","label":"Start for Free","href":"https://app.adscrawl.net/register/"}},"footer":{"socials":{"github":"https://github.com/AdsCrawl","x":"https://x.com/Adscrawl"}},"seo":{"metatags":{"canonical":"https://docs.adscrawl.net"}},"integrations":{"ga4":{"measurementId":"G-F0ZW9VMNR2"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","vscode","mcp","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"introduction"},{"language":"zh","href":"zh"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"adscrawl","hasAudioNarration":false,"actualSubdomain":"adscrawl","customDomains":["docs.adscrawl.net"],"gitSource":{"type":"github","owner":"adscrawl","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6aedc312644e5d1cbd4c966e","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"zh","tag":"文档","count":24},{"language":"en","tag":"Documentation","count":23},{"language":"en","tag":"API Reference","count":22},{"language":"zh","tag":"API 参考","count":22},{"language":"zh","tag":"快速上手","count":12},{"language":"en","tag":"Get Started","count":11},{"language":"en","tag":"SDKs \u0026 Integrations","count":8},{"language":"zh","tag":"SDK 与集成","count":8},{"language":"en","tag":"Cloud Browsers","count":6},{"language":"en","tag":"Guides","count":6},{"language":"zh","tag":"云浏览器","count":6},{"language":"zh","tag":"使用指南","count":6},{"language":"en","tag":"Remote CDP","count":5},{"language":"en","tag":"Browser Tasks","count":5},{"language":"zh","tag":"远程 CDP","count":5},{"language":"zh","tag":"浏览器任务","count":5},{"language":"en","tag":"AI Scrapers","count":4},{"language":"en","tag":"Core Concepts","count":4},{"language":"zh","tag":"AI Scrapers","count":4},{"language":"zh","tag":"核心概念","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/cdp-live-token","slug":"/api-reference/cdp-live-token","pageMetadata":{"title":"Issue Live Control Token","sidebarTitle":"Live Control Token","description":"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.","api":"POST /cdp/live-token","playground":"interactive","href":"/api-reference/cdp-live-token"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Heading,Info,ParamField,ResponseField,Table,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`When you need to step in and interact with a running CDP session in real time, use this endpoint to issue a short-lived control token. Pass the returned `,_jsx(_components.code,{children:`controlUrl`}),` directly to a WebSocket constructor to begin live control.`]}),`\n`,_jsx(ParamField,{body:`sessionId`,type:`string`,required:true,id:`param-session-id`,children:_jsx(_components.p,{children:`The active CDP session ID you want to take live control of.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`ok`,type:`boolean`,id:`param-ok`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` when the token was issued successfully.`]})}),`\n`,_jsx(ResponseField,{name:`controlUrl`,type:`string`,id:`param-control-url`,children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`wss://`}),` WebSocket URL with the single-use `,_jsx(_components.code,{children:`controlToken`}),` already embedded as a query parameter. Pass this directly to `,_jsx(_components.code,{children:`new WebSocket(...)`}),`; do not replace or modify the token.`]})}),`\n`,_jsx(ResponseField,{name:`expiresAt`,type:`number`,id:`param-expires-at`,children:_jsxs(_components.p,{children:[`Unix timestamp in milliseconds when the `,_jsx(_components.code,{children:`controlToken`}),` expires. The token is valid for 30 seconds and can only be used once.`]})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsxs(_components.td,{children:[`Token issued; `,_jsx(_components.code,{children:`controlUrl`}),` and `,_jsx(_components.code,{children:`expiresAt`}),` are in the response body.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sessionId`}),` is missing from the request body.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`The API key is invalid or does not own the target session.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404 / 409 / 410`}),_jsx(_components.td,{children:`The session is missing, stopping, or expired.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`The session backend is unavailable.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Failed to issue or store the control token.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`controlToken`}),` expires after `,_jsx(_components.strong,{children:`30 seconds`}),` and can only be consumed `,_jsx(_components.strong,{children:`once`}),`. If the WebSocket connection fails or is not opened in time, call `,_jsx(_components.code,{children:`POST /cdp/live-token`}),` again to get a fresh token.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`open-the-live-websocket`,children:`Open the live WebSocket`}),`\n`,_jsxs(_components.p,{children:[`Open a live-control WebSocket connection to the target session at `,_jsx(_components.code,{children:`wss://api.adscrawl.net/cdp/live/{sessionId}?controlToken={token}`}),`. The server validates the `,_jsx(_components.code,{children:`controlToken`}),`, connects to the session backend, and then upgrades your client connection. Once connected, CDP messages are proxied bidirectionally and you have full interactive control.`]}),`\n`,_jsx(ParamField,{path:`sessionId`,type:`string`,required:true,id:`param-session-id-1`,children:_jsxs(_components.p,{children:[`The session ID embedded in the `,_jsx(_components.code,{children:`controlUrl`}),` returned by `,_jsx(_components.code,{children:`POST /cdp/live-token`}),`.`]})}),`\n`,_jsx(ParamField,{query:`controlToken`,type:`string`,required:true,id:`param-control-token`,children:_jsxs(_components.p,{children:[`The single-use token from `,_jsx(_components.code,{children:`POST /cdp/live-token`}),`. It must be used within 30 seconds of issuance and can only be consumed once.`]})}),`\n`,_jsx(_components.p,{children:`When the live-control WebSocket closes, the server sends one of the following reason codes:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Reason`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_closed`})}),_jsx(_components.td,{children:`The upstream CDP session closed normally.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`idle_timeout`})}),_jsxs(_components.td,{children:[`The session exceeded the configured `,_jsx(_components.code,{children:`idleTimeoutMs`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`max_timeout`})}),_jsxs(_components.td,{children:[`The session exceeded the configured `,_jsx(_components.code,{children:`maxSessionMs`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1011`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_disconnected`})}),_jsx(_components.td,{children:`The upstream CDP connection dropped unexpectedly.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1011`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_error`})}),_jsx(_components.td,{children:`An error occurred on the upstream CDP connection.`})]})]})]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`101`}),_jsx(_components.td,{children:`WebSocket upgrade succeeded; live control is now active.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`controlToken`}),` is invalid, expired, already used, or does not match `,_jsx(_components.code,{children:`sessionId`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404 / 409 / 410`}),_jsx(_components.td,{children:`The session is missing, stopping, or expired.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502`}),_jsx(_components.td,{children:`The session backend could not be reached before the 101 upgrade.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`The session backend or control infrastructure is unavailable.`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Live control tokens are designed for short bursts of manual or conditional interaction. For fully automated workflows, drive the session directly through `,_jsx(_components.code,{children:`cdpBaseUrl`}),` with Playwright or Puppeteer instead.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Issue Live Control Token","sidebarTitle":"Live Control Token","description":"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.","api":"POST /cdp/live-token","playground":"interactive","href":"/api-reference/cdp-live-token"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`When you need to step in and interact with a running CDP session in real time, use this endpoint to issue a short-lived control token. Pass the returned `,_jsx(_components.code,{children:`controlUrl`}),` directly to a WebSocket constructor to begin live control.`]}),`\n`,_jsx(ParamField,{body:`sessionId`,type:`string`,required:true,id:`param-session-id`,children:_jsx(_components.p,{children:`The active CDP session ID you want to take live control of.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`ok`,type:`boolean`,id:`param-ok`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` when the token was issued successfully.`]})}),`\n`,_jsx(ResponseField,{name:`controlUrl`,type:`string`,id:`param-control-url`,children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`wss://`}),` WebSocket URL with the single-use `,_jsx(_components.code,{children:`controlToken`}),` already embedded as a query parameter. Pass this directly to `,_jsx(_components.code,{children:`new WebSocket(...)`}),`; do not replace or modify the token.`]})}),`\n`,_jsx(ResponseField,{name:`expiresAt`,type:`number`,id:`param-expires-at`,children:_jsxs(_components.p,{children:[`Unix timestamp in milliseconds when the `,_jsx(_components.code,{children:`controlToken`}),` expires. The token is valid for 30 seconds and can only be used once.`]})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsxs(_components.td,{children:[`Token issued; `,_jsx(_components.code,{children:`controlUrl`}),` and `,_jsx(_components.code,{children:`expiresAt`}),` are in the response body.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sessionId`}),` is missing from the request body.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`The API key is invalid or does not own the target session.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404 / 409 / 410`}),_jsx(_components.td,{children:`The session is missing, stopping, or expired.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`The session backend is unavailable.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Failed to issue or store the control token.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`controlToken`}),` expires after `,_jsx(_components.strong,{children:`30 seconds`}),` and can only be consumed `,_jsx(_components.strong,{children:`once`}),`. If the WebSocket connection fails or is not opened in time, call `,_jsx(_components.code,{children:`POST /cdp/live-token`}),` again to get a fresh token.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`open-the-live-websocket`,children:`Open the live WebSocket`}),`\n`,_jsxs(_components.p,{children:[`Open a live-control WebSocket connection to the target session at `,_jsx(_components.code,{children:`wss://api.adscrawl.net/cdp/live/{sessionId}?controlToken={token}`}),`. The server validates the `,_jsx(_components.code,{children:`controlToken`}),`, connects to the session backend, and then upgrades your client connection. Once connected, CDP messages are proxied bidirectionally and you have full interactive control.`]}),`\n`,_jsx(ParamField,{path:`sessionId`,type:`string`,required:true,id:`param-session-id-1`,children:_jsxs(_components.p,{children:[`The session ID embedded in the `,_jsx(_components.code,{children:`controlUrl`}),` returned by `,_jsx(_components.code,{children:`POST /cdp/live-token`}),`.`]})}),`\n`,_jsx(ParamField,{query:`controlToken`,type:`string`,required:true,id:`param-control-token`,children:_jsxs(_components.p,{children:[`The single-use token from `,_jsx(_components.code,{children:`POST /cdp/live-token`}),`. It must be used within 30 seconds of issuance and can only be consumed once.`]})}),`\n`,_jsx(_components.p,{children:`When the live-control WebSocket closes, the server sends one of the following reason codes:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Reason`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_closed`})}),_jsx(_components.td,{children:`The upstream CDP session closed normally.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`idle_timeout`})}),_jsxs(_components.td,{children:[`The session exceeded the configured `,_jsx(_components.code,{children:`idleTimeoutMs`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1000`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`max_timeout`})}),_jsxs(_components.td,{children:[`The session exceeded the configured `,_jsx(_components.code,{children:`maxSessionMs`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1011`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_disconnected`})}),_jsx(_components.td,{children:`The upstream CDP connection dropped unexpectedly.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1011`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cdp_upstream_error`})}),_jsx(_components.td,{children:`An error occurred on the upstream CDP connection.`})]})]})]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`101`}),_jsx(_components.td,{children:`WebSocket upgrade succeeded; live control is now active.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`controlToken`}),` is invalid, expired, already used, or does not match `,_jsx(_components.code,{children:`sessionId`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404 / 409 / 410`}),_jsx(_components.td,{children:`The session is missing, stopping, or expired.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502`}),_jsx(_components.td,{children:`The session backend could not be reached before the 101 upgrade.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:`The session backend or control infrastructure is unavailable.`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Live control tokens are designed for short bursts of manual or conditional interaction. For fully automated workflows, drive the session directly through `,_jsx(_components.code,{children:`cdpBaseUrl`}),` with Playwright or Puppeteer instead.`]})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.adscrawl.net/cdp/live-token\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"sessionId\": \"SESSION_ID\"}'`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`20`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Step 1: request a live control token`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` token`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.adscrawl.net/cdp/live-token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sessionId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"SESSION_ID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Step 2: open the live control WebSocket using the returned controlUrl`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` socket`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` WebSocket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`controlUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`socket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Live control session connected\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`socket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"close\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Session closed:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reason`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200 Token issued`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"controlUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wss://api.adscrawl.net/cdp/live/SESSION_ID?controlToken=\u003csingle-use-token>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"expiresAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1785726630000`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Issue Live Control Token","sidebarTitle":"Live Control Token","description":"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.","api":"POST /cdp/live-token","playground":"interactive","href":"/api-reference/cdp-live-token"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Open the live WebSocket","slug":"open-the-live-websocket","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -sS\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.adscrawl.net/cdp/live-token\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content-type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key: YOUR_API_KEY\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\"sessionId\": \"SESSION_ID\"}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\">// Step 1: request a live control token\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> token\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api.adscrawl.net/cdp/live-token\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content-type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"YOUR_API_KEY\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({ \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">sessionId:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"SESSION_ID\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}).\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">then\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">((\u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">r\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">=>\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> r\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">());\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\">// Step 2: open the live control WebSocket using the returned controlUrl\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> socket\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> WebSocket\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">token\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">controlUrl\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">socket\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">addEventListener\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"open\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, () \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">=>\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Live control session connected\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">socket\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">addEventListener\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"close\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, (\u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">event\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">=>\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Session closed:\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">event\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">code\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">event\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">reason\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200 Token issued","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"ok\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"controlUrl\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"wss://api.adscrawl.net/cdp/live/SESSION_ID?controlToken=\u0026#x3C;single-use-token>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"expiresAt\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1785726630000\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Issue Live Control Token","path":"/cdp/live-token","servers":[{"url":"https://api.adscrawl.net"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"x-api-key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{"controlToken":{"schema":[{"type":"string","description":"The single-use token from `POST /cdp/live-token` . It must be used within 30 seconds of issuance and can only be consumed once.","required":true}]}},"header":{},"cookie":{},"path":{"sessionId":{"schema":[{"type":"string","description":"The session ID embedded in the `controlUrl` returned by `POST /cdp/live-token` .","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"sessionId":[{"type":"string","description":"The active CDP session ID you want to take live control of.","required":true}]}}],"examples":{"example":{"value":{"sessionId":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"ok":[{"type":"boolean","description":"`true` when the token was issued successfully."}],"controlUrl":[{"type":"string","description":"A `wss://` WebSocket URL with the single-use `controlToken` already embedded as a query parameter. Pass this directly to `new WebSocket(...)` ; do not replace or modify the token."}],"expiresAt":[{"type":"number","description":"Unix timestamp in milliseconds when the `controlToken` expires. The token is valid for 30 seconds and can only be used once."}]}}],"examples":{"example":{"value":{"ok":true,"controlUrl":"\u003cstring>","expiresAt":123}}}}}},"deprecated":false}},"jsLinks":["/_mintlify/custom/adscrawl/06c522f789ce028e/salesmartly.js"],"subdomain":"adscrawl","siteName":"AdsCrawl","title":"Issue Live Control Token - AdsCrawl","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api-reference/cdp-live-token","matchLevel":0},"zh":{"href":"/zh/api-reference/cdp-live-token","matchLevel":1}}},"lastModified":"2026-09-29T03:36:15.477Z","originalFileLocation":"api-reference/cdp-live-token.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AdsCrawl\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Issue Live Control Token - AdsCrawl\">\u003cmeta data-mint-head property=\"og:description\" content=\"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AdsCrawl\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.adscrawl.net/api-reference/cdp-live-token\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://adscrawl.mintlify.site/_mintlify/api/og/v2?division=Remote+CDP\u0026amp;title=Issue+Live+Control+Token\u0026amp;description=Issue+a+single-use%2C+30-second+control+token+to+take+live+interactive+control+of+an+existing+CDP+session+via+a+dedicated+WebSocket+connection.\u0026amp;theme=77f75d39b9b0c121a2092b55\u0026amp;signature=0e1115a333bcff1d0020cbc719f7dd4df8e98de85104bbbde35602b938364e12\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Issue Live Control Token - AdsCrawl\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://adscrawl.mintlify.site/_mintlify/api/og/v2?division=Remote+CDP\u0026amp;title=Issue+Live+Control+Token\u0026amp;description=Issue+a+single-use%2C+30-second+control+token+to+take+live+interactive+control+of+an+existing+CDP+session+via+a+dedicated+WebSocket+connection.\u0026amp;theme=77f75d39b9b0c121a2092b55\u0026amp;signature=0e1115a333bcff1d0020cbc719f7dd4df8e98de85104bbbde35602b938364e12\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/adscrawl/K83IBBeEnE6-2SmN/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AdsCrawl\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0071e3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.adscrawl.net/api-reference/cdp-live-token\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/cdp-live-token.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.adscrawl.net/api-reference/cdp-live-token\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.adscrawl.net/zh/api-reference/cdp-live-token\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.adscrawl.net/api-reference/cdp-live-token\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.adscrawl.net/#organization\",\"name\":\"AdsCrawl\",\"url\":\"https://docs.adscrawl.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://media.brand.dev/4640f1e9-6451-460f-a082-f8c2438d4f3b.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.adscrawl.net#website\",\"name\":\"AdsCrawl\",\"url\":\"https://docs.adscrawl.net\",\"publisher\":{\"@id\":\"https://docs.adscrawl.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.adscrawl.net/api-reference/cdp-live-token#webpage\",\"url\":\"https://docs.adscrawl.net/api-reference/cdp-live-token\",\"name\":\"Issue Live Control Token\",\"description\":\"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\",\"dateModified\":\"2026-09-29T03:36:15.477Z\",\"isPartOf\":{\"@id\":\"https://docs.adscrawl.net#website\"},\"breadcrumb\":{\"@id\":\"https://docs.adscrawl.net/api-reference/cdp-live-token#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.adscrawl.net/api-reference/cdp-live-token#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Remote CDP\",\"item\":\"https://docs.adscrawl.net/api-reference/cdp-sessions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Issue Live Control Token\",\"item\":\"https://docs.adscrawl.net/api-reference/cdp-live-token\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.adscrawl.net/api-reference/cdp-live-token#apireference\",\"headline\":\"Issue Live Control Token\",\"name\":\"Issue Live Control Token\",\"description\":\"Issue a single-use, 30-second control token to take live interactive control of an existing CDP session via a dedicated WebSocket connection.\",\"url\":\"https://docs.adscrawl.net/api-reference/cdp-live-token\",\"mainEntityOfPage\":{\"@id\":\"https://docs.adscrawl.net/api-reference/cdp-live-token#webpage\"},\"dateModified\":\"2026-09-29T03:36:15.477Z\",\"publisher\":{\"@id\":\"https://docs.adscrawl.net/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.adscrawl.net#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AdsCrawl\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AdsCrawl\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/cdp-live-token.md","siteName":"AdsCrawl","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"AdsCrawl REST API Introduction","sidebarTitle":"Introduction","href":"/api-reference/introduction"},{"title":"API Schema Reference — Shared Types for All Endpoints","sidebarTitle":"Schemas","href":"/api-reference/schemas"}]},{"group":"Browser Tasks","pages":[{"title":"Render HTML, Markdown, or Article JSON","sidebarTitle":"Render HTML","api":"POST /html","playground":"interactive","href":"/api-reference/html"},{"title":"Capture Screenshot","sidebarTitle":"Screenshot","api":"POST /screenshot","playground":"interactive","href":"/api-reference/screenshot"},{"title":"Extract SPA Data","sidebarTitle":"Extract SPA Data","api":"POST /spa-extract","playground":"interactive","href":"/api-reference/spa-extract"},{"title":"List Templates","sidebarTitle":"List Templates","api":"GET /spa-extract/templates","playground":"interactive","href":"/api-reference/spa-extract-templates"},{"title":"Similar websites API","sidebarTitle":"Similar websites","api":"POST https://api.adscrawl.net/similar-sites","playground":"simple","href":"/api-reference/similar-sites"}]},{"group":"Remote CDP","pages":[{"title":"Create CDP Session","sidebarTitle":"Create Session","api":"POST /cdp/sessions","playground":"interactive","href":"/api-reference/cdp-sessions"},{"title":"List CDP Sessions","sidebarTitle":"List Sessions","api":"GET /cdp/sessions","playground":"interactive","href":"/api-reference/cdp-sessions-list"},{"title":"Delete CDP Session","sidebarTitle":"Delete Session","api":"DELETE /cdp/sessions/{sessionId}","playground":"interactive","href":"/api-reference/cdp-sessions-delete"},{"title":"Discover CDP Endpoint","sidebarTitle":"Discover Endpoint","description":"Retrieve the Chrome DevTools Protocol discovery JSON for a session, including the pre-rewritten WebSocket debugger URL.","api":"GET /cdp/sessions/{sessionId}/json/version","playground":"interactive","href":"/api-reference/cdp-sessions-version"},{"title":"Issue Live Control Token","sidebarTitle":"Live Control Token","api":"POST /cdp/live-token","playground":"interactive","href":"/api-reference/cdp-live-token"}]},{"group":"Cloud Browsers","pages":[{"title":"List Cloud Browser Profiles","sidebarTitle":"List Browsers","description":"List all saved cloud browser profiles for your account along with pagination metadata and your plan's saved-profile and concurrent-running allowances.","api":"GET /cloud-browsers","playground":"interactive","href":"/api-reference/cloud-browsers-list"},{"title":"Get Cloud Browser Profile","sidebarTitle":"Get Browser","api":"GET /cloud-browsers/{id}","playground":"interactive","href":"/api-reference/cloud-browsers-get"},{"title":"Create Browser Profile","sidebarTitle":"Create Profile","api":"POST /cloud-browsers","playground":"interactive","href":"/api-reference/cloud-browsers-create"},{"title":"Create and Launch Browser","sidebarTitle":"Launch Browser","api":"POST /cloud-browsers/launch","playground":"interactive","href":"/api-reference/cloud-browsers-launch"},{"title":"Start Cloud Browser","sidebarTitle":"Start Browser","api":"POST /cloud-browsers/{id}/start","playground":"interactive","href":"/api-reference/cloud-browsers-start"},{"title":"Stop Cloud Browser","sidebarTitle":"Stop Browser","api":"POST /cloud-browsers/{id}/stop","playground":"interactive","href":"/api-reference/cloud-browsers-stop"}]},{"group":"AI Scrapers","pages":[{"title":"ChatGPT scraper API","sidebarTitle":"ChatGPT Scraper","api":"POST https://api.adscrawl.net/ai-search","playground":"simple","href":"/api-reference/ai-search"},{"title":"Gemini scraper API","sidebarTitle":"Gemini Scraper","api":"POST https://api.adscrawl.net/ai-search","playground":"simple","href":"/api-reference/gemini-scraper"},{"title":"Google AI Mode scraper API","sidebarTitle":"Google AI Mode Scraper","api":"POST https://api.adscrawl.net/ai-search","playground":"simple","href":"/api-reference/google-ai-mode-scraper"},{"title":"Google AI Overview scraper API","sidebarTitle":"Google AI Overview Scraper","api":"POST https://api.adscrawl.net/ai-search","playground":"simple","href":"/api-reference/google-ai-overview-scraper"}]}]}]},{"language":"zh","pages":[{"title":"zh","href":"/zh/api-reference/cdp-live-token"}]}]},"basePath":"","title":"Issue Live Control Token - AdsCrawl","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js"]}