To enable the Compliance API, see the setup guide.
Set up the Compliance APIローカルセッションメッセージの取得
GET/v1/compliance/apps/sessions/local/{local_session_id}/messages
1つのローカルセッションのトランスクリプトを、デフォルトでは古い順に読み取ります。
保持期間は読み取り側で適用されます。子組織の保持境界以前のターンは返されません。境界をまたぐセッションでは、それらのターンの代わりに、先頭に1つの content_unavailable プレースホルダー(reason: "retention_elapsed")が含まれます。境界は走査の最初のページで固定され、24時間有効です。それより古いカーソルは明示的な400で拒否されます。現在の境界で読み取るには、走査を最初からやり直してください。
非常に大きなセッションでは、一部のページが大きすぎて読み取れず、400が返されることがあります。再試行しても解決しません。リクエストで order=desc を使用していた場合は、代わりに最初のページから古い順にセッションを読み取ってください(order と page を省略し、next_page をたどります)。まれに、古い順のページでもこの400が返されることがあります。その場合はAnthropicサポートに連絡し、request-id レスポンスヘッダーの値を伝えてください。
Path parameters
Query parameters
Headers
Returns
ローカルセッションメッセージの取得
cURL
curl https://api.anthropic.com/v1/compliance/apps/sessions/local/$LOCAL_SESSION_ID/messages \
-H 'anthropic-version: 2023-06-01' \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"Response 200
{
"data": [
{
"id": "clsm_eyJ2IjoxLCJsIjoi…",
"content": [
{
"text": "text",
"truncated": true,
"type": "text"
}
],
"created_at": "2025-03-12T18:22:41.123456Z",
"model": "claude-opus-5",
"provenance": {
"reason": "not_captured",
"type": "content_unavailable"
},
"role": "assistant",
"type": "compliance_local_session_message"
}
],
"next_page": "page_eyJ2IjoxLCJmIjoibSIs…",
"session": {
"id": "clls_eyJ2IjoxLCJvIjoiOWEx…",
"created_at": "2025-03-12T18:22:41.123456Z",
"organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"product_surface": "cowork",
"truncated": true,
"type": "compliance_local_session",
"updated_at": "2025-03-12T18:22:41.123456Z",
"user": {
"id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"email_address": "jane.doe@example.com"
},
"workspace_id": "wrkspc_01SvYKoWVRVHoEbwESNvzYdR"
}
}Returns Examples
Response 200
{
"data": [
{
"id": "clsm_eyJ2IjoxLCJsIjoi…",
"content": [
{
"text": "text",
"truncated": true,
"type": "text"
}
],
"created_at": "2025-03-12T18:22:41.123456Z",
"model": "claude-opus-5",
"provenance": {
"reason": "not_captured",
"type": "content_unavailable"
},
"role": "assistant",
"type": "compliance_local_session_message"
}
],
"next_page": "page_eyJ2IjoxLCJmIjoibSIs…",
"session": {
"id": "clls_eyJ2IjoxLCJvIjoiOWEx…",
"created_at": "2025-03-12T18:22:41.123456Z",
"organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
"product_surface": "cowork",
"truncated": true,
"type": "compliance_local_session",
"updated_at": "2025-03-12T18:22:41.123456Z",
"user": {
"id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"email_address": "jane.doe@example.com"
},
"workspace_id": "wrkspc_01SvYKoWVRVHoEbwESNvzYdR"
}
}