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

# Browser Profiles

> Persist browser state across hosted Driver sessions.

Browser profiles save cookies and browser state so later sessions can reuse the same login or site state.

<Warning>
  Profiles are supported on hosted sessions. Use `type: "hosted"` when creating a session with a profile.
</Warning>

## Create a Session with a Profile

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await client.browser.session.create({
    type: "hosted",
    profile: {
      name: "my-profile",
      persist: true,
    },
  });
  ```

  ```python Python theme={null}
  resp = requests.post(
      "https://api.driver.dev/v1/browser/session",
      headers={
          "Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
          "Content-Type": "application/json",
      },
      json={
          "type": "hosted",
          "profile": {
              "name": "my-profile",
              "persist": True,
          },
      },
  )
  resp.raise_for_status()
  session = resp.json()
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.driver.dev/v1/browser/session" \
    -H "Authorization: Bearer $DRIVER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type":"hosted","profile":{"name":"my-profile","persist":true}}'
  ```
</CodeGroup>

## Profile Parameters

| Parameter | Type    | Description                                                            |
| --------- | ------- | ---------------------------------------------------------------------- |
| `name`    | string  | Required profile name. Reuse this name to load the same profile later. |
| `persist` | boolean | Save profile changes when the session stops.                           |

## List Profiles

<CodeGroup>
  ```typescript TypeScript theme={null}
  const { profiles } = await client.browser.profiles.list();
  ```

  ```python Python theme={null}
  resp = requests.get(
      "https://api.driver.dev/v1/browser/profiles",
      headers={"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}"},
  )
  resp.raise_for_status()
  print(resp.json())
  ```

  ```bash cURL theme={null}
  curl "https://api.driver.dev/v1/browser/profiles" \
    -H "Authorization: Bearer $DRIVER_API_KEY"
  ```
</CodeGroup>

## Delete a Profile

<CodeGroup>
  ```typescript TypeScript theme={null}
  const result = await client.browser.profiles.delete({
    profileName: "my-profile",
  });
  ```

  ```python Python theme={null}
  resp = requests.delete(
      "https://api.driver.dev/v1/browser/profile",
      headers={"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}"},
      params={"profileName": "my-profile"},
  )
  resp.raise_for_status()
  print(resp.json())
  ```

  ```bash cURL theme={null}
  curl -X DELETE "https://api.driver.dev/v1/browser/profile?profileName=my-profile" \
    -H "Authorization: Bearer $DRIVER_API_KEY"
  ```
</CodeGroup>
