---
title: "Start a capture session"
method: POST
path: "/v1beta/capture_sessions"
tags: ["Capture Sessions"]
---

# Start a capture session

`POST /v1beta/capture_sessions`

## Request

- Base URL: `https://api.indices.io`
- URL: `https://api.indices.io/v1beta/capture_sessions`
- Auth: HTTP bearer

Spawn a browser session that records the network traffic of everything done in it.

Once completed, the capture session is a reusable recording: attach it to a task to generate an API from it.

## Request body

- StartCaptureSessionRequest
  - `use_proxy` boolean: If true, spawn the browser session using a proxy.
  - `cookies` SessionCookie[]: Initial cookies to set in the browser session.
    - `name` string, required: The name of the cookie.
    - `value` string, required: The value of the cookie.
    - `domain` string, nullable: The domain of the cookie.
    - `path` string, nullable: The path of the cookie.
    - `secure` boolean, nullable: Whether the cookie is secure.
    - `http_only` boolean, nullable: Whether the cookie is HTTP only.

## Response `200`

Successful response

- CaptureSession
  - `id` string, required: Unique identifier for the capture session.
  - `state` 'active' | 'completing' | 'completed' | 'abandoned' | 'failed', required
  - `browser_session_id` string, nullable, required: Opaque identifier for the spawned browser session. Null once the browser is gone.
  - `iframe_url` string, nullable, required: URL to embed in an iframe to control the browser. Only usable while the session is active.
  - `created_at` string, date-time, required: Timestamp when the object was created.
  - `updated_at` string, date-time, required: Timestamp when the object was last updated.

## Other responses

- `422`: Validation error

---

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