Skip to content

Content capture API

Opt-in encrypted capture of request and response bodies for audit (T113). Policies and grants need content_capture:manage; reading needs an explicit per-user content:read grant, and every read is audited.

GET /api/v1/admin/content-capture · operation getContentCapture

Effective per-team policies with their source (yaml or console) and the YAML entry they override, the reader grants, the content key status (configured, current_ref, previous_ref; never the key), with content_key_rotation also key.rotation (enabled, current_records, previous_records, unknown_records, complete: live counts of stored records per key, expired records awaiting purge included) and the field bounds. T186.005: views (true when content_capture_evaluation is on, so request_view, purposes and operations apply), live_evaluation (views and eval_capture: rules judge the records kept for evaluation), operations (the captured operations) and migrated (one entry per team whose evaluation capture policy was folded into content capture: team_id, outcome created, merged, kept_audit or skipped, folded_at and detail with the reason, the evaluation policy as it was, content_source none, yaml or console, replaced_policy (a disabled console policy a created policy took the place of) and evaluation_limits (for merged: the limits the evaluation purpose got, which are the evaluation policy’s own sampling, models, retention and the chat operation, so evaluation reads what it read before)). The first read with content_capture_evaluation on performs the fold. T186.005 extension: media and reasoning (whether content_capture_media and content_capture_reasoning are on), media_usage (per team: items and bytes its retained records keep in the media store), media_limits (the defaults and bounds of the policy’s media block) and ladder (the built-in roles with the content permissions each holds, as in GET /api/v1/admin/content-access). Requires content_capture and content_capture:manage (global administrator).

Authentication: adminSession

Responses

Status Description Body
200 OK —
403 Not a global administrator —
404 Feature disabled —

PUT /api/v1/admin/content-capture/policies/{team}

Section titled “PUT /api/v1/admin/content-capture/policies/{team}”

PUT /api/v1/admin/content-capture/policies/{team} · operation putContentCapturePolicy

Stores the console policy of a team, replacing its YAML entry. Omitted fields take their defaults. Audited as content_capture.policy.set. Takes effect on this replica at once and on others within 30 seconds. Requires content_capture and content_capture:manage.

Authentication: adminSession

Parameters

Name In Type Description
team path string, required
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Request body (required)

Responses

Status Description Body
200 The stored policy, normalized —
400 Invalid policy or unknown team —
403 Not a global administrator, or CSRF check failed —
404 Feature disabled —

DELETE /api/v1/admin/content-capture/policies/{team}

Section titled “DELETE /api/v1/admin/content-capture/policies/{team}”

DELETE /api/v1/admin/content-capture/policies/{team} · operation deleteContentCapturePolicy

Removes the console policy; the team returns to its YAML entry, or to no capture. Audited as content_capture.policy.delete. Records already stored keep their expiry.

Authentication: adminSession

Parameters

Name In Type Description
team path string, required
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Responses

Status Description Body
204 Removed —
404 Feature disabled, or no console policy —

PUT /api/v1/admin/content-capture/readers/{user}

Section titled “PUT /api/v1/admin/content-capture/readers/{user}”

PUT /api/v1/admin/content-capture/readers/{user} · operation putContentReader

Grants content:read to an active console user, for every team (all_teams) or for 1-200 listed teams, replacing an earlier grant. No role holds content:read by itself, and the shared admin and viewer tokens can never read content. Audited as content_capture.reader.grant.

Authentication: adminSession

Parameters

Name In Type Description
user path string, required, pattern ^usr_[a-f0-9]{32}$
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Request body (required)

  • application/json: object
    • all_teams (boolean, default false)
    • teams (array of string, max items 200)

Responses

Status Description Body
200 The grant —
400 Invalid grant —
403 content_grant_forbidden: the session is a shared token or Bearer, or grants itself; or not a global administrator —
404 Feature disabled, or no active console user with this ID —

DELETE /api/v1/admin/content-capture/readers/{user}

Section titled “DELETE /api/v1/admin/content-capture/readers/{user}”

DELETE /api/v1/admin/content-capture/readers/{user} · operation deleteContentReader

Revokes the grant at once. Available with the flag off. Audited as content_capture.reader.revoke.

Authentication: adminSession

Parameters

Name In Type Description
user path string, required
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Responses

Status Description Body
204 Revoked —
404 No grant for this user —

GET /api/v1/admin/content-captures · operation listContentCaptures

Metadata of the records visible to the caller (never content): ID, request ID, team, key, model, operation, status, captured sides, stream, original sizes, truncation, output_blocked, key_ref and times, and (T186.005) request_view (received, sent, both, or none when the record keeps no copy of the request), purposes (audit, evaluation: what this record may really be used for, so a request the policy’s evaluation limits left out says audit only), sent_bytes, sent_truncated and evaluation_expires_at (when evaluation stops reading the record, if before it expires); a record written before the views reads received and audit. T186.005 extension: also media_count and media_bytes (what the record keeps in the media store), reasoning_bytes and reasoning_truncated (its reasoning part), and, beside data, levels: an object that maps each listed record ID to what a reveal would show this session (received, sent, text or structure). The list covers the teams of which the session holds content_structure:read (the content ladder: every built-in console role holds it for its teams, a custom role ceiling may withhold it). Requires content_capture; 403 for a session without content_structure:read.

Authentication: adminSession

Parameters

Name In Type Description
request_id query string Only the capture of this request ID.
team query string
limit query integer, default 50, min 1, max 200 Most rows on this page, 1-200 (50 by default).

Responses

Status Description Body
200 data (the records) and levels —
403 The session does not hold content_structure:read —
404 Feature disabled —

POST /api/v1/admin/content-captures/{id}/reveal

Section titled “POST /api/v1/admin/content-captures/{id}/reveal”

POST /api/v1/admin/content-captures/{id}/reveal · operation revealContentCapture

Decrypts one record. The read is audited (content_capture.read, actor the user, target the captured request ID) in the transaction that reads the record, before any content is returned; the answer carries Cache-Control no-store. request and response each have content_type, format (body, or stream_text for the text a stream carried), encoding (utf8 or base64), body and truncated; a side the policy did not capture is absent. T186.005: request is the received view (as the client sent it) and request_sent the sent view (after the input guardrails), with dialect (chat, messages, responses or generate_content: the API shape of the body, chat for a request the gateway translated before its guardrails ran); it is the body the input stage let through, whether or not a guardrail changed it. A native generateContent request, which no input guardrail reads, has same_as_received true with an empty body when the record also keeps the received view. request_sent is absent when the policy does not keep it or the request was refused before it was sent on. T186.005 extension, the content ladder: the answer is what the session’s content permissions cover of the record’s team, named by level, with withheld listing what the record holds and this reader was not shown (received, sent, reasoning, media). level received (content_received:read: the administrator, the organization admin inside its organization, or a content:read grant; never a shared token): request, request_sent, response, reasoning and media. level sent (content_sent:read, content_reasoning:read and content_media:read: the team administrator): request_sent with its body (also when it equals the received one), response, reasoning and media, never request. level text (content_sent:read with one or none of the other two): input (the sent view as a list of messages, with {“type”:“withheld”,“kind”:“media”} or “reasoning” in place of the parts not shown), output (the answer’s text) and output_truncated, plus reasoning or media for the permission held; input_unreadable true when the sent view was truncated or is not a conversation. reasoning is the model’s reasoning kept apart with content_capture_reasoning (a side with format text); media lists the record’s attachments kept with content_capture_media: id, source (request or response), kind (image or audio), content_type, bytes, sha256 (absent for an attachment over the item bound, which is not decoded), stored and, when not stored, reason (item_too_large, record_limit, team_limit, store_failed). The audit target ends with view:<what was shown>, for example view:sent+reasoning+media. Requires content_capture and content_structure:read on the route; 403 content_read_forbidden when the session’s permissions cover only the record’s metadata.

Authentication: adminSession

Parameters

Name In Type Description
id path string, required
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Responses

Status Description Body
200 capture metadata, level, withheld and what the level covers —
403 The session reads no content of this record’s team, or the CSRF check failed —
404 Feature disabled, or no record visible to this reader —
503 The key that wrapped the record is not configured, or storage unavailable —

POST /api/v1/admin/content-captures/{id}/media/{media}

Section titled “POST /api/v1/admin/content-captures/{id}/media/{media}”

POST /api/v1/admin/content-captures/{id}/media/{media} · operation revealContentMedia

T186.005 (content_capture_media): one captured image or audio of a record, decrypted. The read is audited (content_capture.media.read, target capture, media, request and team) in the transaction that reads the attachment, before any byte is returned. The answer is the attachment’s bytes with its stored Content-Type when that is a plain image or audio type (application/octet-stream otherwise), Content-Disposition attachment, X-Content-Type-Options nosniff, Cache-Control no-store and X-Gateway-Media-Kind (image or audio). An attachment is found only under its own record and team: an ID of another record, team or organization answers 404. Requires content_capture, content_capture_media and content_media:read of the record’s team (the administrator, the organization admin inside its organization, the team administrator, or a content:read grant).

Authentication: adminSession

Parameters

Name In Type Description
id path string, required The record’s ID
media path string, required, pattern ^cm_[0-9a-f]{32}$ The attachment’s ID, from media of a reveal or of an evaluation capture
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Responses

Status Description Body
200 The attachment’s bytes application/octet-stream: string (binary)
400 Malformed attachment ID —
403 The session does not hold content_media:read, or the CSRF check failed —
404 Feature disabled, or no such attachment visible to this reader —
503 The key that wrapped the record is not configured, or storage unavailable —

GET /api/v1/admin/content-access · operation getContentAccess

T186.005, the content ladder: what the calling session reads of captured content. ladder lists the built-in roles top down (role, scope, permissions: the content permissions the role holds among content_structure:read, content_sent:read, content_reasoning:read, content_media:read and content_received:read); permissions lists the five; all_teams (only for a gateway-wide role) and teams (by team ID) say the session’s level (received, sent, text, structure) and permissions, after its custom role ceiling and its content:read grant. It grants nothing and returns no content. Any console session.

Authentication: adminSession

Responses

Status Description Body
200 ladder, permissions, all_teams and teams —
401 No session —

DELETE /api/v1/admin/content-captures/{id}

Section titled “DELETE /api/v1/admin/content-captures/{id}”

DELETE /api/v1/admin/content-captures/{id} · operation deleteContentCapture

Deletes one record and answers the count. Available with the flag off. Audited as content_capture.delete with the count. Requires content_capture:manage.

Authentication: adminSession

Parameters

Name In Type Description
id path string, required
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Responses

Status Description Body
200 Deleted —
404 No record with this ID —

POST /api/v1/admin/content-captures/delete

Section titled “POST /api/v1/admin/content-captures/delete”

POST /api/v1/admin/content-captures/delete · operation deleteContentCaptures

Deletes the records of a team, optionally of one request_id and occurred before an RFC 3339 time, and answers the count. Available with the flag off. Audited as content_capture.delete with the count. Requires content_capture:manage.

Authentication: adminSession

Parameters

Name In Type Description
X-CSRF-Token header string, required Token returned by admin login/session; required with the same-origin session cookie for writes.

Request body (required)

  • application/json: object
    • team (string, required)
    • request_id (string)
    • before (string (date-time))

Responses

Status Description Body
200 Deleted count —
400 Invalid filter —

m7gtwcontact@m7gtw.com