---
title: "Save the current browser state to a profile"
method: POST
path: "/browsers/{id_or_name}/profiles"
tags: ["Browsers"]
---

# Save the current browser state to a profile

`POST /browsers/{id_or_name}/profiles`

## Request

- Base URL: `https://api.onkernel.com`
- URL: `https://api.onkernel.com/browsers/{id_or_name}/profiles`
- Auth: HTTP bearer

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.

## Path parameters

- `id_or_name` string, required

## Request body

- union: 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.
  - object
    - `id` string, required: Existing profile ID to overwrite.
    - `name` string: Profile name to overwrite or create.
  - object
    - `id` string: Existing profile ID to overwrite.
    - `name` string, required: Profile name to overwrite or create.

## Response `200`

Existing profile updated successfully

- Profile: Browser profile metadata.
  - `created_at` string, date-time, required: Timestamp when the profile was created
  - `id` string, required: Unique identifier for the profile
  - `last_used_at` string, date-time: Timestamp when the profile was last used
  - `name` string, nullable: Optional, easier-to-reference name for the profile
  - `updated_at` string, date-time: Timestamp when the profile was last updated

## Other responses

- `201`: New profile created and saved successfully
- `400`: Bad Request – invalid input
- `401`: Unauthorized – missing or invalid authorization token
- `403`: Forbidden – insufficient permissions or plan
- `404`: Resource not found
- `409`: Conflict – resource already exists
- `500`: Internal Server Error

## Changes

- **2026-10-28** `5e31244c396e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kernel/apis/kernel-api/changes/browsers/:id_or_name/profiles/post.md)

---

[API](https://skmtc.dev/kernel/apis/kernel-api.md) - [All operations](https://skmtc.dev/kernel/apis/kernel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kernel/apis/kernel-api/revisions/0f6cf4f58fe6?raw)
