---
title: "Ingest Session Capture"
method: POST
path: "/api/v1/session-capture"
tags: ["session_capture"]
---

# Ingest Session Capture

`POST /api/v1/session-capture`

## Request

- Base URL: `https://api-v1.unusual.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-v1.unusual.ai/api/v1/session-capture`
- Auth: none declared

Ingest one Claude Code session transcript (idempotent on content_hash).

Multipart form:
  - ``transcript``  : the raw (optionally gzipped) ``.jsonl`` blob (file part)
  - ``session_id``  : Claude Code session UUID (the .jsonl filename) — upsert key
  - ``project`` / ``git_branch`` / ``source`` : cheap context
  - ``byte_size`` / ``message_count`` / ``started_at`` / ``ended_at`` : cheap metadata
  - ``metadata``    : optional JSON blob (model, mcp servers, tool tallies)

Behavior:
  - hash the uploaded bytes (sha256)
  - if a row for ``session_id`` exists with the same ``content_hash`` → **no-op**
    (returns ``status="unchanged"``; nothing uploaded, nothing rewritten)
  - else upload the blob to R2 (hard-fail: R2 is the blob's only home) and
    upsert the ``session_capture`` row.

## Headers

- `authorization` string, nullable

## Request body `multipart/form-data`

- BodyIngestSessionCaptureApiV1SessionCapturePost
  - `session_id` string, required
  - `transcript` string, binary, required
  - `project` string, nullable
  - `git_branch` string, nullable
  - `source` string
  - `byte_size` string, nullable
  - `message_count` string, nullable
  - `started_at` string, nullable
  - `ended_at` string, nullable
  - `metadata` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/unusual/apis/dashboard-server.md) - [All operations](https://skmtc.dev/unusual/apis/dashboard-server/llms.txt) - [OpenAPI document](https://skmtc.dev/unusual/apis/dashboard-server/revisions/89f716930ead?raw)
