Creating Multiple Browser Instances
Please read the Material Usage Rules on this site.
Description: This method is used to create browser instances in bulk for the specified profiles. Ensure that the provided profile IDs are valid and that the specified workspace ID exists.
Request parameters:
| Parameter | Type | Format | Default | Description |
|---|---|---|---|---|
| workspaceId | integer | int64 | -1 | Workspace identifier. -1 means the default workspace. |
| desktopName | string | (empty) | The name of the desktop environment (optional). Defaults to empty. | |
| keepAlive | boolean | (empty) | Indicates if the browser instances should remain active after creation. true to keep active; otherwise false. Defaults to true. | |
| environmentTags | string | (empty) | Tags to configure the environment for the browser instance. | |
| commandLineArguments | string | (empty) | Custom additional command line arguments to pass to the browser on startup |
Request body:
| Field | Type | Format | Required | Description |
|---|---|---|---|---|
| body | array[string] | uuid | (optional) | Array of profile UUIDs for which browser instances will be created. Each ID must correspond to an existing profile. |
Example request:
POST
CURL:
curl 'http://localhost:8160/v1/browser_instances/create_bulk?workspaceId=-1&desktopName=Desktop%201&keepAlive=true&environmentTags=&commandLineArguments=--disable-gpu' \
--request POST \
--header 'Api-Token: YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '[
"123e4567-e89b-12d3-a456-426614174000"
]'
C#:
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://localhost:8160/v1/browser_instances/create_bulk?workspaceId=-1&desktopName=Desktop%201&keepAlive=true&environmentTags=&commandLineArguments=--disable-gpu"),
Headers =
{
{ "Api-Token", "YOUR_SECRET_TOKEN" },
},
};
request.Content = new StringContent("[\n \"123e4567-e89b-12d3-a456-426614174000\"\n]", Encoding.UTF8, "application/json");
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Cube:
http://localhost:8160/v1/browser_instances/create_bulk?workspaceId=-1&desktopName=Desktop%201&keepAlive=true&environmentTags=&commandLineArguments=--disable-gpu
Body (JSON):
[
"123e4567-e89b-12d3-a456-426614174000"
]

Additionally:
User-Agent: {-Profile.UserAgent-}
Api-Token: Token from UserArea2.

Response API:
| Response code | Result |
|---|---|
200 OK | OK |
401 Unauthorized | Unauthorized |
403 Forbidden | Forbidden |
500 Internal Server Error | Internal Server Error |
Success Response (200 OK):
[
{
"profileId": "123e4567-e89b-12d3-a456-426614174000",
"processId": 1,
"connectionString": "ws://127.0.0.1:12345/devtools/browser/example"
}
]
Error Response (500):
{
"message": null
}