Skip to main content
POST
/
v1
/
functions
/
{id}
/
invoke
Invoke a Function
curl --request POST \
  --url https://api.browserbase.com/v1/functions/{id}/invoke \
  --header 'Content-Type: application/json' \
  --header 'X-BB-API-Key: <api-key>' \
  --data '
{
  "params": {},
  "sessionCreateParams": {
    "extensionId": "<string>",
    "browserSettings": {
      "context": {
        "id": "<string>",
        "persist": true
      },
      "extensionId": "<string>",
      "viewport": {
        "width": 123,
        "height": 123
      },
      "blockAds": true,
      "solveCaptchas": true,
      "recordSession": true,
      "logSession": true,
      "advancedStealth": true,
      "captchaImageSelector": "<string>",
      "captchaInputSelector": "<string>",
      "os": "windows",
      "size": "small",
      "enableNativeSelectPolyfill": true,
      "enablePdfViewer": true,
      "headful": true,
      "extensions": [],
      "allowedDomains": []
    },
    "timeout": 10830,
    "proxies": [
      {
        "type": "browserbase",
        "geolocation": {
          "country": "<string>",
          "city": "<string>",
          "state": "<string>"
        },
        "domainPattern": "<string>"
      }
    ],
    "proxySettings": {
      "caCertificates": []
    },
    "userMetadata": {}
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "functionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "versionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "PENDING",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "startedAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "region": "<string>",
  "params": {},
  "results": {},
  "endedAt": "2023-11-07T05:31:56Z"
}

Authorizations

X-BB-API-Key
string
header
required

Path Parameters

id
string<uuid>
required

Body

application/json
params
object

JSON object that can be stored in a JSONB column

sessionCreateParams
object

Response

202 - application/json

The request has been accepted for processing, but processing has not yet completed.

id
string<uuid>
required
projectId
string<uuid>
required
functionId
string<uuid>
required
versionId
string<uuid>
required
sessionId
string<uuid>
required
status
enum<string>
required
Available options:
PENDING,
RUNNING,
COMPLETED,
FAILED
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
startedAt
string<date-time>
required
expiresAt
string<date-time>
required
region
string
Minimum string length: 1
params
object

JSON object that can be stored in a JSONB column

results
object

JSON object that can be stored in a JSONB column

endedAt
string<date-time>