Queue Session Message
Send a message to a session. If the session is busy it waits on the queue and runs as the next turn; if idle it drains immediately.
interrupt=true cancels the session’s active run so this message takes effect
now instead of waiting for the current turn (no-op when the session is idle).
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
interrupt: false,
attachedFileIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/queue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/queue \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"text": "<string>",
"interrupt": false,
"attachedFileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/queue"
payload = {
"text": "<string>",
"interrupt": False,
"attachedFileIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "queue",
"status": "pending",
"text": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"attachedFileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Headers
Path Parameters
Body
Send a message to a session. If the session is busy the message waits on the queue and runs as the next turn; if idle it runs immediately.
Set interrupt to make it take effect now: the session's active run is
cancelled and this message drains straight after. Interrupt is a no-op when
the session is already idle, and BEST-EFFORT when busy — if the cancel can't
be delivered, the message stays queued and runs after the current turn.
Response
Successful Response
One message on a session's queue (a v4_session_input row).
queue, interrupt pending, dispatching, consumed, cancelled, superseded, failed Was this page helpful?
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
interrupt: false,
attachedFileIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.browser-use.com/api/v4/sessions/{session_id}/queue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v4/sessions/{session_id}/queue \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"text": "<string>",
"interrupt": false,
"attachedFileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.browser-use.com/api/v4/sessions/{session_id}/queue"
payload = {
"text": "<string>",
"interrupt": False,
"attachedFileIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "queue",
"status": "pending",
"text": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"attachedFileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}