---
title: "Create a Context"
method: POST
path: "/v1/contexts"
---

# Create a Context

`POST /v1/contexts`

## Request body

- object
  - `projectId` string — The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key.

## Response `201`

The request has succeeded and a new resource has been created as a result.

- object
  - `id` string, required
  - `uploadUrl` string, required — An upload URL to upload a custom user-data-directory.
  - `publicKey` string, required — The public key to encrypt the user-data-directory.
  - `cipherAlgorithm` string, required — The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is currently the only supported algorithm.
  - `initializationVectorSize` integer, required — The initialization vector size used to encrypt the user-data-directory. [Read more about how to use it](/features/contexts).

## Changes

- **2026-02-26** `a2379f6bf614` — 1 breaking, 1 warning, 2 info
  - the `projectId` request property type/format changed from ``/`` to `string`/``
  - removed `#/components/schemas/uuid` from the `projectId` request property `allOf` list
  - request body became optional
  - the request property `projectId` became optional
- **2024-10-27** `0d0ad7d4de2f` — 1 info
  - removed the non-success response with the status `500`

[Change history](https://skmtc.dev/browserbase/apis/browserbase-api/changes/v1/contexts/post.md)

---

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