Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
files
/
find
Search for a pattern inside file contents (grep)
import requests

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

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

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

print(response.text)
[
  {
    "file": "<string>",
    "line": 123,
    "content": "<string>"
  }
]

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
path
string
required

Directory to search in. Relative paths resolve using the same filesystem contract as PathRequest.path.

pattern
string
required

Regex or literal to match in file contents

user
string

Optional sandbox user for relative-path resolution and ownership.

Response

200 - application/json

Search matches

file
string
required

Absolute path to the matching file within the addressed filesystem surface.

line
integer<uint32>
required
content
string
required