> ## Documentation Index
> Fetch the complete documentation index at: https://www.kernel.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Save the current browser state to a profile

> Saves the running browser's current user-data state to an existing or new profile without
ending the browser session.

Saving restarts the browser. Active CDP and WebDriver connections are closed and must
reconnect, and WebDriver clients must create a new session. Open tabs are restored, but
pages reload and in-memory page state is lost. The browser is stopped only while its
user data is copied; this request returns once the restarted browser accepts CDP
connections again and the profile has been uploaded. Caches, Service Worker storage and
Google Drive IndexedDB data are left out of the saved profile but kept in the running
browser.

This does not attach the destination profile to the browser or change its save_changes
setting. Active browsers that already loaded the destination profile keep their in-memory
state. Pools with refresh_on_profile_update enabled flush idle sessions and replenish them
from the new snapshot; other browsers receive it the next time they load the profile. When
saves made with this endpoint to the same profile overlap, the save that started most
recently wins, even if an earlier one finishes later. The automatic save at the end of a
session whose profile has save_changes enabled is ordered against these saves by when each
finishes.

A successful save restarts the browser's inactivity timeout (timeout_seconds). A failed
save leaves it unchanged.

Returns 409 when the browser is no longer active, when a pooled browser was released or
reacquired after the request was made (browser_lease_changed), or when the browser is
briefly unable to accept a save (browser_busy), in which case the request can be retried.




## OpenAPI

````yaml https://api.onkernel.com/spec.json post /browsers/{id_or_name}/profiles
openapi: 3.1.0
info:
  description: Developer tools and cloud infrastructure for AI agents to use web browsers
  title: Kernel API
  version: 0.1.0
servers:
  - description: API Server
    url: https://api.onkernel.com
security:
  - bearerAuth: []
tags:
  - description: Search the web and retrieve content for selected results.
    name: Search
  - description: Create and manage browser sessions.
    name: Browsers
  - description: Control mouse, keyboard, and screen on the browser instance.
    name: Browser Computer Controls
  - description: >-
      Execute Playwright code against the browser instance and manage the
      executors it runs in.
    name: Browser Playwright
  - description: Execute JavaScript in the browser instance's persistent Browser REPL.
    name: Browser REPL
  - description: Discover and invoke native page tools across the browser instance.
    name: Browser WebMCP
  - description: Read, write, and manage files on the browser instance.
    name: Browser Filesystem
  - description: Execute and manage processes on the browser instance.
    name: Browser Processes
  - description: Record and manage browser session video replays.
    name: Browser Replays
  - description: Stream logs from the browser instance.
    name: Browser Logs
  - description: >-
      Stream live telemetry events from a browser session, and manage the
      destinations sessions export them to.
    name: Browser Telemetry
  - description: Create, list, retrieve, and delete browser profiles.
    name: Profiles
  - description: Create and manage proxy configurations for routing browser traffic.
    name: Proxies
  - description: Create, list, retrieve, and delete browser extensions.
    name: Extensions
  - description: Create and manage browser pools for acquiring and releasing browsers.
    name: Browser Pools
  - description: Inspect the identity and authorization context for the current request.
    name: Authentication
  - description: >-
      Create and manage auth connections for automated credential capture and
      login.
    name: Managed Auth
  - description: Create and manage credentials for authentication.
    name: Credentials
  - description: Configure external credential providers like 1Password.
    name: Credential Providers
  - description: List applications and versions.
    name: Apps
  - description: Create and manage app deployments and stream deployment events.
    name: Deployments
  - description: Invoke actions and stream or query invocation status and events.
    name: Invocations
  - description: Read and manage organization-level limits.
    name: Organization
  - description: |
      Create and manage projects for resource isolation within an organization.
      When projects are disabled for the organization, project operations return
      `404` with code `projects_disabled`.
    name: Projects
  - description: Create and manage API keys for organization and project-scoped access.
    name: API Keys
  - description: Read audit log records for the authenticated organization.
    name: Audit Logs
  - description: Resolve browser and proxy recommendations for bot-protected sites.
    name: Config Registry
paths:
  /browsers/{id_or_name}/profiles:
    post:
      tags:
        - Browsers
      summary: Save the current browser state to a profile
      description: >
        Saves the running browser's current user-data state to an existing or
        new profile without

        ending the browser session.


        Saving restarts the browser. Active CDP and WebDriver connections are
        closed and must

        reconnect, and WebDriver clients must create a new session. Open tabs
        are restored, but

        pages reload and in-memory page state is lost. The browser is stopped
        only while its

        user data is copied; this request returns once the restarted browser
        accepts CDP

        connections again and the profile has been uploaded. Caches, Service
        Worker storage and

        Google Drive IndexedDB data are left out of the saved profile but kept
        in the running

        browser.


        This does not attach the destination profile to the browser or change
        its save_changes

        setting. Active browsers that already loaded the destination profile
        keep their in-memory

        state. Pools with refresh_on_profile_update enabled flush idle sessions
        and replenish them

        from the new snapshot; other browsers receive it the next time they load
        the profile. When

        saves made with this endpoint to the same profile overlap, the save that
        started most

        recently wins, even if an earlier one finishes later. The automatic save
        at the end of a

        session whose profile has save_changes enabled is ordered against these
        saves by when each

        finishes.


        A successful save restarts the browser's inactivity timeout
        (timeout_seconds). A failed

        save leaves it unchanged.


        Returns 409 when the browser is no longer active, when a pooled browser
        was released or

        reacquired after the request was made (browser_lease_changed), or when
        the browser is

        briefly unable to accept a save (browser_busy), in which case the
        request can be retried.
      operationId: saveBrowserProfile
      parameters:
        - description: Browser session ID or name
          example: htzv5orfit78e1m2biiifpbv
          in: path
          name: id_or_name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveBrowserProfileRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
          description: Existing profile updated successfully
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
          description: New profile created and saved successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    SaveBrowserProfileRequest:
      additionalProperties: false
      description: >
        Destination profile for a snapshot of the running browser. Provide
        either id or name.

        An id must identify an existing profile. A name overwrites the matching
        profile in the

        browser's project, or creates it when no matching profile exists.
      oneOf:
        - required:
            - id
        - required:
            - name
      properties:
        id:
          description: Existing profile ID to overwrite.
          minLength: 1
          type: string
        name:
          description: Profile name to overwrite or create.
          maxLength: 255
          minLength: 1
          pattern: ^[a-zA-Z0-9._-]{1,255}$
          type: string
      type: object
    Profile:
      description: Browser profile metadata.
      properties:
        created_at:
          description: Timestamp when the profile was created
          format: date-time
          type: string
        id:
          description: Unique identifier for the profile
          type: string
        last_used_at:
          description: Timestamp when the profile was last used
          format: date-time
          type: string
        name:
          description: Optional, easier-to-reference name for the profile
          nullable: true
          type: string
        updated_at:
          description: Timestamp when the profile was last updated
          format: date-time
          type: string
      required:
        - id
        - created_at
      type: object
    Error:
      properties:
        code:
          description: Application-specific error code (machine-readable)
          example: bad_request
          type: string
        details:
          description: Additional error details (for multiple errors)
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
        inner_error:
          $ref: '#/components/schemas/ErrorDetail'
        message:
          description: Human-readable error description for debugging
          example: 'Missing required field: app_name'
          type: string
      required:
        - code
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: Lower-level error code providing more specific detail
          example: invalid_input
          type: string
        message:
          description: Further detail about the error
          example: Provided version string is not semver compliant
          type: string
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Bad Request – invalid input
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Unauthorized – missing or invalid authorization token
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Forbidden – insufficient permissions or plan
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Resource not found
    Conflict:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Conflict – resource already exists
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Internal Server Error
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.