Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
files
/
replace
Find and replace text in files (sed)
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/files/replace"

payload = {
    "files": ["<string>"],
    "pattern": "<string>",
    "replacement": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "replacements": 123,
  "files_modified": 123,
  "files_skipped": 123,
  "binary_files_skipped": 123
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

Body

application/json
files
string[]
required

File paths to apply replacement. Each path follows the same filesystem contract as PathRequest.path.

pattern
string
required
replacement
string
required
user
string

Optional sandbox user for relative-path resolution and ownership.

Response

200 - application/json

Replacement result

replacements
integer<uint64>
required
files_modified
integer<uint64>
required
files_skipped
integer<uint64>
required
binary_files_skipped
integer<uint64>
required