---
title: "Execute a Cloud Agent workspace operation"
method: POST
path: "/v2/agents/{agent_id}/workspace"
tags: ["Cloud Agents"]
---

# Execute a Cloud Agent workspace operation

`POST /v2/agents/{agent_id}/workspace`

## Request

- Base URL: `https://api.runta.com`
- URL: `https://api.runta.com/v2/agents/{agent_id}/workspace`
- Auth: HTTP bearer

## Path parameters

- `agent_id` string, required

## Request body

- RuntimeWorkspaceOperationRequest
  - `kind` 'list_directory' | 'read_text' | 'search_files' | 'read_media' | 'list_ports', required
  - `path` string
  - `query` string
  - `offset` integer

## Response `200`

Workspace operation result.

- RuntimeWorkspaceOperationResult
  - `kind` 'list_directory' | 'read_text' | 'search_files' | 'read_media' | 'list_ports', required
  - `entries` RuntimeWorkspaceFileEntry[], required
    - `name` string, required
    - `path` string, required
    - `kind` 'directory' | 'text' | 'image' | 'video' | 'file', required
    - `size` integer, required
  - `text` string
  - `matches` RuntimeWorkspaceSearchMatch[], required
    - `path` string, required
    - `line` integer, required
    - `preview` string, required
  - `media_base64` string
  - `media_type` string
  - `next_offset` integer
  - `ports` RuntimeWorkspacePort[], required
    - `port` integer, required
    - `forwardable` boolean: Whether the listener accepts traffic addressed to the Runtime rather than loopback only. Omitted by older Runtime agents.
  - `truncated` boolean, required

## Other responses

- `401`: Missing, malformed, or rejected bearer token
- `403`: The bearer token is not allowed to perform this action
- `404`: The requested resource was not found
- `409`: The request conflicts with current resource state
- `422`: Validation or application error
- `429`: Rate limit exceeded
- `501`: Operation is not implemented
- `503`: Upstream service is unavailable
- `504`: Upstream request timed out
- `default`: Error response

## Changes

- **2026-11-05** `fb5a0ecd3fc2`: 20 warning
  - added the new `FEATURE_TEMPORARILY_DISABLED` enum value to the `error/code` response property for the response status `401`
  - added the new `FEATURE_TEMPORARILY_DISABLED` enum value to the `error/code` response property for the response status `403`
  - added the new `FEATURE_TEMPORARILY_DISABLED` enum value to the `error/code` response property for the response status `404`
  - added the new `FEATURE_TEMPORARILY_DISABLED` enum value to the `error/code` response property for the response status `409`
  - …16 more

[Operation history](https://skmtc.dev/runta/apis/runta-public-rest-api/changes/v2/agents/:agent_id/workspace/post.md)

---

[API](https://skmtc.dev/runta/apis/runta-public-rest-api.md) - [All operations](https://skmtc.dev/runta/apis/runta-public-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/runta/apis/runta-public-rest-api/revisions/fb5a0ecd3fc2?raw)
