Skip to main content
POST
Read file
Read file bytes, optionally starting at an offset. Set stream=true to receive raw bytes instead of JSON.
See error examples and recovery steps. The complete OpenAPI contract includes every response schema.

Authorizations

Authorization
string
header
required

The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default local mode with no token accepts requests without one.

Path Parameters

workspace_id
string
required

Workspace ID.

Query Parameters

session_id
string

Session ID to use. If omitted, the default session is used.

explain
boolean
default:false

Return what the call would do without running it.

Body

application/json
path
string
required
offset
integer

Byte offset to start reading at. Defaults to 0.

size
integer | null

Number of bytes to read. null or omitted reads to the end.

raw
boolean

Read the stored bytes, skipping any rendering the mount registers for the file type. Use it to read a file you will write back.

stream
boolean

Answer the bytes themselves as application/octet-stream. Ignored with explain=true.

Response

data is what the call returns. With explain=true, explanation says what the call would do; nothing runs.

data
string
required

The bytes, base64.