# Dump the session's cookies and storage

> The only endpoint that returns credentials. Works only while the session is `active`.

Source: https://docs.spicrawl.com/api-reference/sessions/sessions-get-context

## GET /v1/sessions/{sessionID}/context

Operation ID: `sessionsGetContext`. API key scope: `sessions`.

The only endpoint that returns credentials. Works only while the session is `active`. The response is
marked `Cache-Control: no-store, private`. Reading does not slide the TTL.

Pitfalls:
- After release, delete, or TTL expiry the context is purged immediately and permanently. A released
  session answers 410 `ERR::SESSION::RELEASED`; an expired one 410 `ERR::SESSION::EXPIRED`. Do not
  retry a 410: create a new session and log in again.
- Store this object yourself if you need it later. You can POST its `session_context` back to
  `POST /v1/sessions` to clone the session.
- 500 `ERR::SESSION::STATE_CORRUPT` means the stored context cannot be opened (retired key, newer
  schema, corrupt blob). It will not recover; create a new session.

### Example

```bash
curl "https://api.spicrawl.com/v1/sessions/{sessionID}/context" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `sessionID` | path | string | yes | Session id from `POST /v1/sessions` (26-character ULID; a UUID is also accepted). A malformed id answers 404 `ERR::SESSION::NOT_FOUND`, the same as an unknown one. |

### Responses

#### 200

The live context.

Headers: `Cache-Control`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `session_id` | string | yes | The session id. |
| `schema_version` | integer | yes | Stored format version. Currently 1. |
| `session_context` | object (`SessionContext`) | yes | Everything a browser holds that makes it logged in. Maps and arrays are never null in responses. |
| `fingerprint` | object \| null | no | Stored Camoufox fingerprint, or null when none. Omitted only in edge cases. |
| `domain_scores` | object | no | Per-domain standing, as stored. `{}` when empty. |
| `retired` | string: `expired`, `usage_exhausted`, `explicit` | no | Why a worker retired the session. Absent while usable. |
| `usage_count` | integer | yes | Scrapes that used the session. |
| `created_at` | string (date-time) | yes | Creation time. |
| `last_used_at` | string \| null (date-time) | yes | Last use, or null if never used. |
| `expires_at` | string (date-time) | yes | Current sliding expiry. |
| `warning` | string | yes | Fixed reminder that this context is destroyed on release, delete or expiry. Save the object now if you need it later. |

Example `dump`

```json
{
  "session_id": "01J9ZQ4M7R3T8VX2K5N6P0B1CD",
  "schema_version": 1,
  "session_context": {
    "cookies": [
      {
        "name": "sid",
        "value": "9f2c1e7a",
        "domain": ".example.com",
        "path": "/",
        "expires": 1790000000,
        "http_only": true,
        "secure": true,
        "same_site": "Lax"
      }
    ],
    "local_storage": {
      "https://app.example.com": {
        "token": "eyJhbGciOi"
      }
    },
    "session_storage": {},
    "indexed_db": {}
  },
  "fingerprint": null,
  "domain_scores": {
    "example.com": {
      "score": 0.5,
      "good": 12,
      "bad": 1,
      "last_updated": 1790000500000,
      "retired": false
    }
  },
  "usage_count": 3,
  "created_at": "2026-09-22T10:00:00Z",
  "last_used_at": "2026-09-22T10:05:12Z",
  "expires_at": "2026-09-22T12:05:12Z",
  "warning": "This context only exists while the session is live. Releasing the session, deleting it, or letting its TTL elapse destroys it immediately and permanently — there is no recovery and no soft delete. If you need this state later, store this object yourself now."
}
```

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

No such resource for this key's organization.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 410

The resource existed but is past its retention window or was purged. Not retryable.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
