---
title: "Run edit actions"
method: POST
path: "/v1/instance/{instance_id}/edit"
tags: ["instance"]
---

# Run edit actions

`POST /v1/instance/{instance_id}/edit`

## Path parameters

- `instance_id` string, required

## Headers

- `x-api-key` string, required

## Request body

- object
  - `command` 'view' | 'create' | 'str_replace' | 'insert' | 'undo_edit', required
  - `path` string, required
  - `file_text` string
  - `view_range` integer[]
  - `old_str` string
  - `new_str` string
  - `insert_line` integer

## Response `200`

Successful Response

- TypeEditResponse — Response model for edit actions.
  - `output` string
  - `error` string
  - `base64_image` string
  - `system` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/scrapybara/apis/api-reference.md) · [All operations](https://skmtc.dev/scrapybara/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scrapybara/api-reference/revisions/3d9197361372/schema)
