Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
workspace
/
multi_edit
Workspace: Multi Edit
curl --request POST \
  --url https://api.xpander.ai/v1/agents/{agent_id}/workspace/multi_edit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "edits": [
    {
      "path": "<string>",
      "old_text": "<string>",
      "new_text": "<string>"
    }
  ]
}
'
{
  "results": [
    {
      "path": "<string>",
      "replacements_made": 0
    }
  ]
}
Apply multiple file edits atomically. Each edit uses the same exact-match semantics as Workspace: File Edit. If any edit fails, all changes are rolled back.

Path Parameters

agent_id
string
required
Agent ID (UUID)

Request Body

edits
array
required
Ordered list of edits to apply. Each item has:

Response

status
string
Result status (e.g., ok).

Example Request

curl -X POST "https://api.xpander.ai/v1/agents/<agent-id>/workspace/multi_edit" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{
    "edits": [
      {
        "path": "app.py",
        "old_text": "DEBUG = True",
        "new_text": "DEBUG = False"
      }
    ]
  }'

Notes

  • Edits are applied in the order provided. Later edits can operate on content produced by earlier edits in the same request.
  • If any single edit fails (e.g., old_text not found), the entire batch is rolled back so the workspace is not left in a half-applied state.

See Also

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Body

application/json
edits
SingleEdit · object[]
required

List of edits to apply atomically. If any edit fails, all changes are rolled back.

Response

Successful Response

results
SingleEditResult · object[]

Results for each edit operation