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

# Run file actions

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

## Path parameters

- `instance_id` string, required

## Headers

- `x-api-key` string, required

## Request body

- object
  - `command` string, required
  - `path` string
  - `content` string
  - `mode` string
  - `encoding` string
  - `view_range` integer[]
  - `recursive` boolean
  - `src` string
  - `dst` string
  - `old_str` string
  - `new_str` string
  - `line` integer
  - `text` string
  - `lines` integer[]
  - `all_occurrences` boolean
  - `pattern` string
  - `case_sensitive` boolean
  - `line_numbers` boolean

## Response `200`

Successful Response

- TypeFileResponse — Response model for file 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)
