# sessions.create

Source: https://docs.scrappey.com/docs/sessions-create

> Start a persistent browser session that retains cookies, speeds up requests, and reduces repeated setup work across multi-step browser workflows.

A session remains active for **200 seconds** after the last request. After that, it is automatically destroyed.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `session` | string | No | Custom session ID. If not set, a random UUID is generated. |
| `proxy` | string | No | Use a custom proxy. Supports `http://`, `socks4://`, or `socks5://` with authentication. Example: `"http://username:password@127.0.0.1:8888"`. Default: built-in rotating proxies from random countries. |
| `whitelistedDomains` | array | No | Allow requests to specified external domains. Example: `["probot.io", "google.com"]`. Useful for loading assets from third-party domains. |
| `datacenter` | boolean | No | Set to `true` to use a datacenter IP instead of a residential IP. Datacenter IPs offer higher speed and stability, but lower anonymity. |
| `browser` | array | No | Define the browser type and version range. Options: `chrome`, `firefox`, `safari`. Example: `[{ "name": "chrome", "minVersion": 116, "maxVersion": 117 }]`. |
| `operatingSystem` | array | No | Specify OS options. Options: `windows`, `macos`, `linux`, `android`, `ios`. Example: `["windows", "linux"]`. |
| `device` | array | No | Choose device type. Options: `desktop`, `mobile`. Example: `["desktop", "mobile"]`. |

## Why Use sessions.create

- **Speed:** Reuses the same browser instance across multiple requests.
- **Persistence:** Retains cookies and session data until explicitly destroyed.
- **Convenience:** Reuses cookies and browser state across requests.

## Request

```json
{
    "cmd": "sessions.create",
    "session": "my-session-id"
}
```

## Response

```json
{
    "solution": {
        "verified": true
    },
    "data": "success",
    "session": "my-session-id",
    "fingerprint": {},
    "context": {
        "_type": "BrowserContext",
        "_guid": "browser-context@2356ec33a1fa91f08e3b3da7b55b13f6"
    }
}
```

## Related concepts

Go deeper in the [Scrappey knowledge base](https://scrappey.com/qa):

- [Stateful web scraping](https://scrappey.com/qa/web-scraping-apis/what-is-stateful-web-scraping) — reusing cookies and state across requests
- [Session cookie](https://scrappey.com/qa/anti-bot/what-is-a-session-cookie) — the cookie that ties a session together
