Skip to main content
POST
/
context
/
runtime
/
content
Read runtime sandbox file
curl --request POST \
  --url https://api.getcargo.io/v1/context/runtime/content \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": "<string>",
  "startLine": 4503599627370496,
  "endLine": 4503599627370496
}
'
{
  "path": "<string>",
  "content": "<string>",
  "startLine": 0,
  "endLine": 0,
  "totalLines": 0
}

Documentation Index

Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
path
string
required

Path of the file to read in the runtime sandbox, relative to the workspace working directory.

Minimum string length: 1
startLine
integer

1-indexed inclusive line at which to start reading. Defaults to the first line of the file.

Required range: 1 <= x <= 9007199254740991
endLine
integer

1-indexed inclusive line at which to stop reading. Defaults to the last line of the file. Must be greater than or equal to startLine when both are provided.

Required range: 1 <= x <= 9007199254740991

Response

Successful response

path
string
required
content
string
required

UTF-8 decoded content of the requested line range.

startLine
integer
required

1-indexed inclusive start line of the returned slice (after clamping to the file's bounds).

Required range: -9007199254740991 <= x <= 9007199254740991
endLine
integer
required

1-indexed inclusive end line of the returned slice. Equals startLine - 1 when the requested range starts past the end of the file.

Required range: -9007199254740991 <= x <= 9007199254740991
totalLines
integer
required

Total number of lines in the underlying file.

Required range: -9007199254740991 <= x <= 9007199254740991