SPB Git

Repository Public

remote.md 17.4 KB 563 lines markdown

1---2title: Remote3url: https://platform.claude.com/docs/en/api/compliance/apps/sessions/remote4---56# Remote78## List remote sessions910**GET** `/v1/compliance/apps/sessions/remote`1112List remote sessions (Cowork sessions that run in Anthropic-managed13cloud environments) across the organizations the key may read.1415Each entry carries session metadata only; retrieve a session's16transcript from the messages endpoint. By default the list spans every17such organization; pass up to 500 `organization_ids[]` values to18narrow it. Pass 1 to 10 `user_ids[]` values to scope the19list to specific users: that filter matches the session's owning user,20so agent-owned sessions are excluded whenever it is set. Bound results21in time with the `created_at` range parameters (`created_at.gte`,22`created_at.gt`, `created_at.lt`, `created_at.lte`; RFC 3339). There23is no `updated_at` filter.2425Results are sorted newest first by `created_at`, with at most `limit`26sessions per page (default 100, maximum 500). Pagination is27forward-only: pass the response's `next_page` value back as `page` to28retrieve the next page, and stop when `next_page` is null.2930### Query parameters3132- `created_at: optional object`3334  - `gt: optional string`3536    Filter remote sessions created after this time (RFC 3339 format)3738    format: date-time3940  - `gte: optional string`4142    Filter remote sessions created at or after this time (RFC 3339 format)4344    format: date-time4546  - `lt: optional string`4748    Filter remote sessions created before this time (RFC 3339 format)4950    format: date-time5152  - `lte: optional string`5354    Filter remote sessions created at or before this time (RFC 3339 format)5556    format: date-time5758- `limit: optional number`5960  Maximum results (default: 100, max: 500)6162  default: 100, maximum: 500, minimum: 16364- `organization_ids: optional array of string`6566  Filter to specific child organization identifiers. Omit to enumerate every child organization the key may read.6768  maxItems: 5006970- `page: optional string`7172  Opaque pagination token from a previous response's `next_page` field. Pass this to retrieve the next page of results. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.7374- `user_ids: optional array of string`7576  Filter to sessions owned by specific users (max 10 per request). Agent-owned sessions are excluded when this filter is set.7778  maxItems: 107980### Headers8182- `"x-api-key": optional string`8384### Returns8586- `data: array of object`8788  - `id: string`8990    Remote session identifier9192  - `agent_id: string or null`9394    Identifier of the automated agent that owns the session. Null for user-owned sessions. At most one of `user` and `agent_id` is set.9596  - `claude_project_id: string or null`9798    ID of the project the session is bound to. Null when the session has no project binding.99100  - `created_at: string`101102    When the session was created (RFC 3339, UTC)103104    format: date-time105106  - `organization_uuid: string`107108    UUID of the organization the session belongs to109110  - `product_surface: string or null`111112    The Claude product the session was created from. Currently `cowork_remote`, for Cowork sessions started on claude.ai web or mobile. More values will appear as other surfaces launch, so treat any unrecognized value as an unclassified surface rather than an error. Null for sessions created before this field was recorded, for surfaces that do not stamp it, and for unrecognized tag values.113114  - `started_by_user: object or null`115116    A user associated with a remote session.117118    - `id: string`119120      User identifier121122    - `email_address: string or null`123124      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.125126  - `status: string`127128    Session lifecycle state. One of `active`, `paused`, `archived`, or `failed` — the lifecycle states the owning product surface exposes — plus `pending`, a brief transient state that resolves before any transcript content exists. The list endpoint includes `pending`; the messages endpoint returns 404 for it. Deleted sessions are not returned on either endpoint. Treat unrecognized values as an unknown state rather than an error.129130  - `updated_at: string`131132    When the session was last modified (RFC 3339, UTC)133134    format: date-time135136  - `user: object or null`137138    A user associated with a remote session.139140    - `id: string`141142      User identifier143144    - `email_address: string or null`145146      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.147148- `next_page: string or null`149150  Opaque page token; pass as `page` to retrieve the next page. Null when no rows exist after this page. Treat this value as opaque; do not parse or store it long-term, as the format may change without notice.151152### Example153154```bash155curl https://api.anthropic.com/v1/compliance/apps/sessions/remote \156    -H 'anthropic-version: 2023-06-01' \157    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"158```159160#### Response (200)161162```json163{164  "data": [165    {166      "id": "cse_01A0000000000000000000000",167      "organization_uuid": "00000000-0000-0000-0000-000000000000",168      "user": {169        "id": "user_01A0000000000000000000000",170        "email_address": "user@example.com"171      },172      "status": "active",173      "created_at": "2026-01-02T03:04:05.000000Z",174      "updated_at": "2026-01-02T03:04:05.000000Z",175      "product_surface": "cowork_remote",176      "claude_project_id": "claude_proj_01Nm7PqRsTuVwXyZaBcDeFgH"177    }178  ],179  "next_page": "page_AAE..."180}181```182183## Domain types184185### Remote List Response186187- `RemoteListResponse object`188189  Metadata for one remote session, as returned in the list response190  and in the messages response's `session` field.191192  Carries session attributes only, not transcript content. Use the193  messages endpoint to retrieve a session's transcript.194195  - `id: string`196197    Remote session identifier198199  - `agent_id: string or null`200201    Identifier of the automated agent that owns the session. Null for user-owned sessions. At most one of `user` and `agent_id` is set.202203  - `claude_project_id: string or null`204205    ID of the project the session is bound to. Null when the session has no project binding.206207  - `created_at: string`208209    When the session was created (RFC 3339, UTC)210211    format: date-time212213  - `organization_uuid: string`214215    UUID of the organization the session belongs to216217  - `product_surface: string or null`218219    The Claude product the session was created from. Currently `cowork_remote`, for Cowork sessions started on claude.ai web or mobile. More values will appear as other surfaces launch, so treat any unrecognized value as an unclassified surface rather than an error. Null for sessions created before this field was recorded, for surfaces that do not stamp it, and for unrecognized tag values.220221  - `started_by_user: object or null`222223    A user associated with a remote session.224225    - `id: string`226227      User identifier228229    - `email_address: string or null`230231      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.232233  - `status: string`234235    Session lifecycle state. One of `active`, `paused`, `archived`, or `failed` — the lifecycle states the owning product surface exposes — plus `pending`, a brief transient state that resolves before any transcript content exists. The list endpoint includes `pending`; the messages endpoint returns 404 for it. Deleted sessions are not returned on either endpoint. Treat unrecognized values as an unknown state rather than an error.236237  - `updated_at: string`238239    When the session was last modified (RFC 3339, UTC)240241    format: date-time242243  - `user: object or null`244245    A user associated with a remote session.246247    - `id: string`248249      User identifier250251    - `email_address: string or null`252253      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.254255## Remote › Messages256257### Retrieve remote session messages258259**GET** `/v1/compliance/apps/sessions/remote/{claude_remote_session_id}/messages`260261Retrieve one remote session's transcript: user prompts, assistant262responses, and tool calls and results. Thinking blocks and images are263not included.264265Messages are returned oldest first by default; pass `order=desc` to266reverse. Pagination uses the same `page`/`next_page` scheme as the267list endpoint, with at most `limit` messages per page (default 100,268maximum 1000); keep paginating until `next_page` is null.269`tool_use_input_max_bytes` and `tool_result_max_bytes` cap how many270bytes of each tool-use input and each tool-result text item are271returned; a block shortened by either cap carries `truncated: true`.272273The response embeds the session's metadata under `session` alongside274the paginated `data` array. On this endpoint `session.user.email_address`275and `session.started_by_user` are always null; read them from the list276endpoint instead.277278Returns 404 while the session is still `pending`, for deleted sessions,279and for sessions outside the organizations the key may read. A280malformed session identifier returns 400.281282#### Path parameters283284- `claude_remote_session_id: string`285286  The remote session identifier (`cse_...`) to retrieve287288#### Query parameters289290- `limit: optional number`291292  Maximum results (default: 100, max: 1000)293294  default: 100, maximum: 1000, minimum: 1295296- `order: optional "asc" or "desc"`297298  Sort direction. `asc` (oldest-first) or `desc`.299300  default: asc301302  - `"asc"`303304  - `"desc"`305306- `page: optional string`307308  Opaque pagination token from a previous response's `next_page` field. Pass this to retrieve the next page of results. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.309310- `tool_result_max_bytes: optional number`311312  Truncate each text item inside a tool result to at most this many bytes (cut on a code-point boundary). Pass `-1` to request the server maximum. `0` is not a valid value.313314  default: 10000, maximum: 2147483647, minimum: -1315316- `tool_use_input_max_bytes: optional number`317318  Truncate each tool-use input to at most this many bytes (cut on a code-point boundary so the result is valid UTF-8). Pass `-1` to request the server maximum. `0` is not a valid value.319320  default: 10000, maximum: 2147483647, minimum: -1321322#### Headers323324- `"x-api-key": optional string`325326#### Returns327328- `data: array of object`329330  Transcript turns for this page, ordered by transcript position. `created_at` is a commit timestamp and may tie or invert under concurrent writes; do not re-sort by it.331332  - `id: string`333334    Unique identifier for the message, e.g. `csev_abc123`335336  - `content: array of Text or ToolUse or ToolResult`337338    Content blocks within the message339340    - `Text object`341342      Text content block.343344      - `type: "text"`345346        default: text347348      - `text: string`349350        Text content from the user or the assistant351352      - `truncated: boolean`353354        True when `text` exceeded the server-defined maximum (approximately 1 MiB) and was shortened.355356        default: false357358    - `ToolUse object`359360      Tool invocation requested by the assistant.361362      - `type: "tool_use"`363364        default: tool_use365366      - `id: string or null`367368        Tool-use ID, e.g. 'toolu_01AbC...'369370      - `input: string`371372        Arguments passed to the tool, as a JSON-encoded string. May be shortened — see the `truncated` field373374      - `name: string`375376        Name of the tool invoked377378      - `truncated: boolean`379380        True when `input` was shortened. Pass `tool_use_input_max_bytes=-1` to request full content, subject to the server-side maximum.381382        default: false383384    - `ToolResult object`385386      Result returned by a tool invocation.387388      - `type: "tool_result"`389390        default: tool_result391392      - `content: array of object`393394        Text content returned by the tool. Non-text item types are omitted.395396        - `type: "text"`397398          default: text399400        - `text: string`401402          Text returned by the tool403404      - `is_error: boolean`405406        True when the tool reported an error407408      - `name: string`409410        Name of the tool that produced this result411412      - `tool_use_id: string or null`413414        ID of the tool_use block this result responds to415416      - `truncated: boolean`417418        True when one or more text items in `content` were shortened. Pass `tool_result_max_bytes=-1` to request full content, subject to the server-side maximum.419420        default: false421422  - `content_unavailable: boolean`423424    True when the stored content could not be returned — it could not be decrypted, or it exceeded the server's per-event size bound. `content` is empty in that case; this distinguishes 'no content' from 'content withheld'.425426    default: false427428  - `created_at: string`429430    When the message was recorded (RFC 3339, UTC)431432    format: date-time433434  - `role: "assistant" or "user"`435436    Message sender (`user` or `assistant`)437438    - `"assistant"`439440    - `"user"`441442  - `sent_by_user_id: string or null`443444    Identifier of the human account that sent this turn on an agent-owned session. Null on user-owned sessions, where every user-role turn was sent by the session's `user`.445446- `next_page: string or null`447448  Opaque page token; pass as `page` to retrieve the next page. Null when no rows exist after this page. Treat this value as opaque; do not parse or store it long-term, as the format may change without notice.449450- `session: object`451452  Session metadata. `started_by_user`, `user.email_address`, and `claude_project_id` are always null on this endpoint; the messages endpoint resolves neither email addresses nor project bindings.453454  - `id: string`455456    Remote session identifier457458  - `agent_id: string or null`459460    Identifier of the automated agent that owns the session. Null for user-owned sessions. At most one of `user` and `agent_id` is set.461462  - `claude_project_id: string or null`463464    ID of the project the session is bound to. Null when the session has no project binding.465466  - `created_at: string`467468    When the session was created (RFC 3339, UTC)469470    format: date-time471472  - `organization_uuid: string`473474    UUID of the organization the session belongs to475476  - `product_surface: string or null`477478    The Claude product the session was created from. Currently `cowork_remote`, for Cowork sessions started on claude.ai web or mobile. More values will appear as other surfaces launch, so treat any unrecognized value as an unclassified surface rather than an error. Null for sessions created before this field was recorded, for surfaces that do not stamp it, and for unrecognized tag values.479480  - `started_by_user: object or null`481482    A user associated with a remote session.483484    - `id: string`485486      User identifier487488    - `email_address: string or null`489490      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.491492  - `status: string`493494    Session lifecycle state. One of `active`, `paused`, `archived`, or `failed` — the lifecycle states the owning product surface exposes — plus `pending`, a brief transient state that resolves before any transcript content exists. The list endpoint includes `pending`; the messages endpoint returns 404 for it. Deleted sessions are not returned on either endpoint. Treat unrecognized values as an unknown state rather than an error.495496  - `updated_at: string`497498    When the session was last modified (RFC 3339, UTC)499500    format: date-time501502  - `user: object or null`503504    A user associated with a remote session.505506    - `id: string`507508      User identifier509510    - `email_address: string or null`511512      User's email address. Null when the user is no longer a member of an organization the key may read — `id` remains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.513514#### Example515516```bash517curl https://api.anthropic.com/v1/compliance/apps/sessions/remote/$CLAUDE_REMOTE_SESSION_ID/messages \518    -H 'anthropic-version: 2023-06-01' \519    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"520```521522##### Response (200)523524```json525{526  "data": [527    {528      "id": "id",529      "content": [530        {531          "text": "text",532          "truncated": true,533          "type": "text"534        }535      ],536      "content_unavailable": true,537      "created_at": "2019-12-27T18:11:19.117Z",538      "role": "assistant",539      "sent_by_user_id": "sent_by_user_id"540    }541  ],542  "next_page": "next_page",543  "session": {544    "id": "id",545    "agent_id": "agent_id",546    "claude_project_id": "claude_project_id",547    "created_at": "2019-12-27T18:11:19.117Z",548    "organization_uuid": "organization_uuid",549    "product_surface": "product_surface",550    "started_by_user": {551      "id": "id",552      "email_address": "email_address"553    },554    "status": "status",555    "updated_at": "2019-12-27T18:11:19.117Z",556    "user": {557      "id": "id",558      "email_address": "email_address"559    }560  }561}562```563
Files main
Menu

Theme