---
title: "Invoke a Function"
method: POST
path: "/v1/functions/{id}/invoke"
---

# Invoke a Function

`POST /v1/functions/{id}/invoke`

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `params` object — JSON object that can be stored in a JSONB column
  - `sessionCreateParams` object
    - `extensionId` string — The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension).
    - `browserSettings` object
      - `context` object
        - `id` string, required — The Context ID.
        - `persist` boolean — Whether or not to persist the context after browsing. Defaults to `false`.
      - `extensionId` string — The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension).
      - `viewport` object
        - `width` integer — The width of the browser.
        - `height` integer — The height of the browser.
      - `blockAds` boolean — Enable or disable ad blocking in the browser. Defaults to `false`.
      - `solveCaptchas` boolean — Enable or disable captcha solving in the browser. Defaults to `true`.
      - `recordSession` boolean — Enable or disable session recording. Defaults to `true`.
      - `logSession` boolean — Enable or disable session logging. Defaults to `true`.
      - `advancedStealth` boolean — Advanced Browser Stealth Mode
      - `verified` boolean — Verified Browser Mode
      - `captchaImageSelector` string — Custom selector for captcha image. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
      - `captchaInputSelector` string — Custom selector for captcha input. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
      - `os` 'windows' | 'mac' | 'linux' | 'mobile' | 'tablet' — Operating system for stealth mode. Valid values: windows, mac, linux, mobile, tablet
      - `size` 'small' | 'medium' | 'large' — [NOT IN DOCS] Resource size of the browser.
      - `enableNativeSelectPolyfill` boolean — [NOT IN DOCS] Enable native select polyfill. This gives support a break-glass option to disable the polyfill.
      - `enablePdfViewer` boolean — [NOT IN DOCS] Enable PDF viewer. This gives support a break-glass option to enable the viewer when users want to view PDFs in-browser.
      - `extensions` string[] — [NOT IN DOCS] List of pre-installed extension names and custom extension ids to enable on the browser
      - `allowedDomains` string[] — An optional list of allowed domains for the session. If you pass one or more domains, Browserbase restricts top-level (main-frame) page navigations to the listed domains and their subdomains. For example, `example.com` also permits `www.example.com` and `a.b.example.com`, but not `notexample.com`. Matching is domain-based, not full-URL. An empty list (the default) disables the restriction entirely. Browserbase enforces only main-frame navigations; it does not block iframe/subframe loads or other in-page resource requests (images, scripts, XHR, etc.).
      - `ignoreCertificateErrors` boolean — Enable or disable ignoring of certificate errors in the browser. Defaults to `true`.
    - `proxies` union — Proxy configuration. Can be true for default proxy, or an array of proxy configurations.
      - union[]
        - union
          - BrowserbaseProxyConfig
            - `type` 'browserbase', required — Type of proxy. Always use 'browserbase' for the Browserbase managed proxy network.
            - `geolocation` object — Geographic location for the proxy. Optional.
              - …
            - `domainPattern` string — Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional.
          - ExternalProxyConfig
            - `type` 'external', required — Type of proxy. Always 'external' for this config.
            - `server` string, required — Server URL for external proxy. Required.
            - `domainPattern` string — Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional.
            - `username` string — Username for external proxy authentication. Optional.
            - `password` string — Password for external proxy authentication. Optional.
          - NoneProxyConfig
            - `type` 'none', required — Type of proxy. Always 'none' for this config.
            - `domainPattern` string — Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional.
      - boolean
    - `proxySettings` object — Supplementary proxy settings. Optional.
      - `caCertificates` string[] — The TLS certificate IDs to trust. Optional.
    - `userMetadata` object — Arbitrary user metadata to attach to the session. To learn more about user metadata, see [User Metadata](/features/sessions#user-metadata).
    - `timeout` integer — Duration in seconds after which the function invocation will automatically end. Defaults to 900 (15 minutes).

## Response `202`

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

- Invocation
  - `id` string, uuid, required
  - `projectId` string, uuid, required
  - `functionId` string, uuid, required
  - `versionId` string, uuid, required
  - `sessionId` string, uuid, required
  - `region` string
  - `params` object — JSON object that can be stored in a JSONB column
  - `status` 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED', required
  - `results` union — Any JSON-serializable value that can be stored in a JSONB column
    - string
    - number
    - boolean
    - unknown[]
      - unknown
    - object
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `startedAt` string, date-time, required
  - `endedAt` string, date-time
  - `expiresAt` string, date-time, required

---

[API](https://skmtc.net/browserbase/apis/browserbase-api.md) · [All operations](https://skmtc.net/browserbase/apis/browserbase-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/browserbase/browserbase-api/revisions/832b22144edf/schema)
