Create a persisted browser session
Creates a session: a sealed cookie jar and web-storage snapshot, pinned to one exit intent, that you reuse by passing its `id` as `session_id` on `/v1/scrape`.
Requires scope: sessions
Creates a session: a sealed cookie jar and web-storage snapshot, pinned to one
exit intent, that you reuse by passing its id as session_id on /v1/scrape.
Pitfalls:
- Every field is optional. An empty body (Content-Length 0) means "all defaults";
{}also works. Unknown fields are refused with 400. - Sessions are single-writer. While a render holds the lease, a second scrape on the same session,
and release/delete without
force=true, get 409ERR::SESSION::BUSYwith aRetry-After. Serialise work per session, or create one session per concurrent worker. rotate_ipandsticky_keyare mutually exclusive (400ERR::REQUEST::INCOMPATIBLE_FLAGS). Omitting both pins the exit:sticky_keyis derived from the session id.ttl_secondsabove the organization's maximum is refused (400), never clamped. It slides on use but never pasthard_expires_at.proxy_countryrequirespremium_proxy: true.fingerprintis an advanced option and may be refused with 400.- A project may hold only one active session per
sticky_key(409ERR::REQUEST::CONFLICT). - An organization may hold at most 100 live sessions (429
ERR::LIMIT::SESSIONS_EXCEEDED, Retry-After 30). engineis optional (fetch,jsorbrowser): omit it and the session's rendering is chosen for you. Scrapes with the session run on that tier, so ajssession refusesactions,block_resources, a screenshot and a PDF (400ERR::REQUEST::CAPABILITY_UNSUPPORTED).
Authorization
bearerAuth Authorization: Bearer <key>. Read the key from the SPICRAWL_API_KEY environment
variable; never hard-code or log it. spicrawl_test_… keys can never spend live
credits. Scopes: scrape, batch, sessions (granted by default), browser
and read (granted deliberately). A missing scope is 403 ERR::AUTH::INSUFFICIENT_SCOPE naming the scope.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Body of POST /v1/sessions. All fields optional; unknown fields are refused with 400.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/v1/sessions" \ -H "Content-Type: application/json" \ -d '{ "ttl_seconds": 7200, "sticky_key": "acct-4812" }'{ "id": "01J9ZQ4M7R3T8VX2K5N6P0B1CD", "project_id": "01J9Y0000000000000000PROJ1", "status": "active", "sticky_key": "acct-4812", "proxy": { "tier": "datacenter" }, "created_at": "2026-09-22T10:00:00Z", "last_used_at": null, "expires_at": "2026-09-22T12:00:00Z", "hard_expires_at": "2026-09-29T10:00:00Z", "usage_count": 0, "context": { "schema_version": 1, "cookies": 0, "origins": 0, "bytes": 131 }}