To enable the Compliance API, see the setup guide.
リモートセッションメッセージの取得
1 つのリモートセッションのトランスクリプト(ユーザープロンプト、アシスタントの応答、ツール呼び出しと結果)を取得します。思考ブロックと画像は含まれません。Claude のアプリがユーザーに表示せずにユーザーのメッセージに追加する、アシスタント向けの一部のメモは返されません。そのような text ブロックは added_as_context: true 付きの空の状態で返されます。その他の追加されたテキストは完全な形で返されます。
メッセージはデフォルトで古い順に返されます。逆順にするには order=desc を渡してください。ページネーションは一覧エンドポイントと同じ page/next_page 方式を使用し、1 ページあたり最大 limit 件のメッセージが返されます(デフォルト 100、最大 1000)。next_page が null になるまでページネーションを続けてください。tool_use_input_max_bytes と tool_result_max_bytes は、各ツール使用入力および各ツール結果テキスト項目について返されるバイト数の上限を設定します。いずれかの上限によって短縮されたブロックには truncated: true が付きます。
レスポンスには、ページネーションされた data 配列とともに、セッションのメタデータが session の下に埋め込まれます。このエンドポイントでは session.user.email_address と session.started_by_user は常に null です。これらは代わりに一覧エンドポイントから読み取ってください。
セッションがまだ pending の間、削除されたセッション、およびキーが読み取り可能な組織外のセッションに対しては 404 を返します。不正な形式のセッション識別子は 400 を返します。
セッションの組織、またはキー自身の組織に、リモートセッションを Compliance API 経由で読み取ることを許可しないコンプライアンス設定がある場合、error.details に error_code organization_compliance_restricted を含む 403 を返します。これらの設定が変更されるまで、再試行しても解決しません。
Path parameters
Query parameters
Headers
Returns
curl https://api.anthropic.com/v1/compliance/apps/sessions/remote/$CLAUDE_REMOTE_SESSION_ID/messages \
-H 'anthropic-version: 2026-10-21' \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"{
"data": [
{
"id": "id",
"content": [
{
"added_as_context": true,
"text": "text",
"truncated": true,
"type": "text"
}
],
"content_unavailable": true,
"created_at": "2019-12-27T18:11:19.117Z",
"role": "assistant",
"sent_by_user_id": "sent_by_user_id"
}
],
"next_page": "next_page",
"session": {
"id": "id",
"agent_id": "agent_id",
"claude_project_id": "claude_project_id",
"created_at": "2019-12-27T18:11:19.117Z",
"organization_uuid": "organization_uuid",
"product_surface": "product_surface",
"scheduled_task_id": "scheduled_task_id",
"started_by_user": {
"id": "id",
"email_address": "email_address"
},
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"user": {
"id": "id",
"email_address": "email_address"
}
}
}Returns Examples
{
"data": [
{
"id": "id",
"content": [
{
"added_as_context": true,
"text": "text",
"truncated": true,
"type": "text"
}
],
"content_unavailable": true,
"created_at": "2019-12-27T18:11:19.117Z",
"role": "assistant",
"sent_by_user_id": "sent_by_user_id"
}
],
"next_page": "next_page",
"session": {
"id": "id",
"agent_id": "agent_id",
"claude_project_id": "claude_project_id",
"created_at": "2019-12-27T18:11:19.117Z",
"organization_uuid": "organization_uuid",
"product_surface": "product_surface",
"scheduled_task_id": "scheduled_task_id",
"started_by_user": {
"id": "id",
"email_address": "email_address"
},
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"user": {
"id": "id",
"email_address": "email_address"
}
}
}