Skip to main content
PATCH
/
browser_pools
/
{id_or_name}
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});

const browserPool = await client.browserPools.update('id_or_name');

console.log(browserPool.id);
import os
from kernel import Kernel

client = Kernel(
api_key=os.environ.get("KERNEL_API_KEY"), # This is the default and can be omitted
)
browser_pool = client.browser_pools.update(
id_or_name="id_or_name",
)
print(browser_pool.id)
package main

import (
"context"
"fmt"

"github.com/kernel/kernel-go-sdk"
"github.com/kernel/kernel-go-sdk/option"
)

func main() {
client := kernel.NewClient(
option.WithAPIKey("My API Key"),
)
browserPool, err := client.BrowserPools.Update(
context.TODO(),
"id_or_name",
kernel.BrowserPoolUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", browserPool.ID)
}
curl --request PATCH \
--url https://api.onkernel.com/browser_pools/{id_or_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size": 10,
"name": "my-pool",
"fill_rate_per_minute": 1,
"timeout_seconds": 129605,
"stealth": true,
"headless": false,
"profile": {
"id": "<string>",
"name": "<string>"
},
"refresh_on_profile_update": true,
"extensions": [
{
"id": "<string>",
"name": "<string>"
}
],
"proxy_id": "<string>",
"kiosk_mode": true,
"chrome_policy": {},
"start_url": "https://example.com",
"discard_all_idle": false
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onkernel.com/browser_pools/{id_or_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'size' => 10,
'name' => 'my-pool',
'fill_rate_per_minute' => 1,
'timeout_seconds' => 129605,
'stealth' => true,
'headless' => false,
'profile' => [
'id' => '<string>',
'name' => '<string>'
],
'refresh_on_profile_update' => true,
'extensions' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'proxy_id' => '<string>',
'kiosk_mode' => true,
'chrome_policy' => [

],
'start_url' => 'https://example.com',
'discard_all_idle' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.patch("https://api.onkernel.com/browser_pools/{id_or_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size\": 10,\n \"name\": \"my-pool\",\n \"fill_rate_per_minute\": 1,\n \"timeout_seconds\": 129605,\n \"stealth\": true,\n \"headless\": false,\n \"profile\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"refresh_on_profile_update\": true,\n \"extensions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"proxy_id\": \"<string>\",\n \"kiosk_mode\": true,\n \"chrome_policy\": {},\n \"start_url\": \"https://example.com\",\n \"discard_all_idle\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.onkernel.com/browser_pools/{id_or_name}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size\": 10,\n \"name\": \"my-pool\",\n \"fill_rate_per_minute\": 1,\n \"timeout_seconds\": 129605,\n \"stealth\": true,\n \"headless\": false,\n \"profile\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"refresh_on_profile_update\": true,\n \"extensions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"proxy_id\": \"<string>\",\n \"kiosk_mode\": true,\n \"chrome_policy\": {},\n \"start_url\": \"https://example.com\",\n \"discard_all_idle\": false\n}"

response = http.request(request)
puts response.read_body
{
  "id": "iv25ujqf37x3j07dwoffegqr",
  "available_count": 85,
  "acquired_count": 15,
  "created_at": "2023-11-07T05:31:56Z",
  "browser_pool_config": {
    "size": 10,
    "name": "my-pool",
    "fill_rate_per_minute": 1,
    "timeout_seconds": 129605,
    "stealth": true,
    "headless": false,
    "profile": {
      "id": "<string>",
      "name": "<string>"
    },
    "refresh_on_profile_update": true,
    "extensions": [
      {
        "id": "<string>",
        "name": "<string>"
      }
    ],
    "proxy_id": "<string>",
    "viewport": {
      "width": 1280,
      "height": 800,
      "refresh_rate": 60
    },
    "kiosk_mode": true,
    "chrome_policy": {},
    "start_url": "https://example.com"
  },
  "extension_ids": [
    "<string>"
  ],
  "name": "my-pool",
  "profile_id": "iv25ujqf37x3j07dwoffegqr"
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id_or_name
string
required

Browser pool ID or name

Body

application/json

Parameters for updating a browser pool. Omitted fields leave existing values unchanged.

size
integer

If provided, replaces the number of browsers to maintain in the pool. The maximum size is determined by your organization's pooled sessions limit (the sum of all pool sizes cannot exceed your limit).

Required range: x >= 1
Example:

10

name
string

If provided, replaces the pool name. Empty string is a no-op; the pool name cannot be cleared or reset to empty once assigned.

Pattern: ^[a-zA-Z0-9._-]{1,255}$
Example:

"my-pool"

fill_rate_per_minute
integer

If provided, replaces the percentage of the pool to fill per minute. The cap is 25 for most organizations but can be raised per-organization, so only the lower bound is enforced here.

Required range: x >= 0
timeout_seconds
integer

If provided, replaces the default idle timeout in seconds for browsers acquired from this pool before they are destroyed. Minimum 10, maximum 259200 (72 hours).

Required range: 10 <= x <= 259200
stealth
boolean

If provided, replaces whether browsers launch in stealth mode.

Example:

true

headless
boolean

If provided, replaces whether browsers launch using a headless image.

Example:

false

profile
object

If provided, replaces the previously-selected profile. An empty object (no id or name) is rejected as 400, so the profile cannot be cleared.

refresh_on_profile_update
boolean

If provided, replaces whether idle browsers are flushed when the profile the pool uses is updated. Requires a profile to be set on the pool.

Example:

true

extensions
object[]

If provided, replaces the extension list. Empty array clears all previously-selected extensions. Omit this field to leave extensions unchanged.

Maximum array length: 20

Extension selection for the browser session. Provide either id or name of an extension uploaded to Kernel.

proxy_id
string

Empty string clears the previously-selected proxy. Omit this field to leave the proxy unchanged.

viewport
object

If provided, replaces the viewport with the new width/height/refresh_rate. Because width and height are required and must be positive, the viewport cannot be cleared; omit this field to leave it unchanged.

kiosk_mode
boolean

If provided, replaces whether browsers launch in kiosk mode.

Example:

true

chrome_policy
object

If provided, replaces the custom Chrome enterprise policy overrides applied to all browsers in this pool. Empty object clears any previously-set policy. Keys are Chrome enterprise policy names; values must match their expected types. Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See https://chromeenterprise.google/policies/ The serialized JSON payload is capped at 5 MiB.

start_url
string

If provided, replaces the URL to navigate to when a new browser is warmed into the pool. Empty string clears the previously-set URL. Omit this field to leave it unchanged.

Maximum string length: 2048
Example:

"https://example.com"

discard_all_idle
boolean
default:false

Whether to discard all idle browsers and rebuild them immediately with the new configuration. Defaults to false. Only browsers that are idle when the update runs are rebuilt. A browser that is in use during the update keeps its original configuration, and if it is later released with reuse: true it returns to the pool with that stale configuration until it is discarded (by this flag on a later update, or by flushing the pool).

Example:

false

Response

Browser pool details

A browser pool containing multiple identically configured browsers.

id
string
required

Unique identifier for the browser pool

Example:

"iv25ujqf37x3j07dwoffegqr"

available_count
integer
required

Number of browsers currently available in the pool

Example:

85

acquired_count
integer
required

Number of browsers currently acquired from the pool

Example:

15

created_at
string<date-time>
required

Timestamp when the browser pool was created

browser_pool_config
object
required

Configuration used to create all browsers in this pool

extension_ids
string[]
required

Resolved extension IDs attached to the pool, in configured load order. Empty when no extensions are attached. Authoritative for programmatic consumers; the extensions inside browser_pool_config reflect the configured selector (echoed as sent on create).

name
string

Browser pool name, if set

Example:

"my-pool"

profile_id
string

Resolved profile ID the pool is attached to. Omitted when no profile is attached. Authoritative for programmatic consumers; the profile inside browser_pool_config reflects the configured selector (echoed as sent on create).

Example:

"iv25ujqf37x3j07dwoffegqr"