Skip to main content
PUT
Write a file

Authorizations

Authorization
string
header
required

An org API key (gh_live_…) from Settings → API keys in the console.

Path Parameters

agent_id
string
required

The agent’s id, e.g. billing.

path
string
required

The file’s path, like notes/customers.md (with its slashes as they are, or encoded as %2F).

Body

application/json
content
string

The whole text of a text file.

Example:

"# Returns\nWithin 30 days, with the receipt."

data
string

Any file the file system keeps, base64-encoded (a data: URL works too). What it is comes from its bytes and its path’s extension.

content_type
string

With data: the file’s type, if you know it.

Response

OK

object
any
agent_id
string
Example:

"billing"

path
string

Always starts with /.

Example:

"/notes/customers.md"

bytes
integer

Its size: a text file’s in UTF-8, any other file’s as it was saved.

created_at
string<date-time>
updated_at
string<date-time>
updated_by
Person · object

Who wrote the file: a person, an API key, or the agent itself (task_id; with procedure and conversation_id when a procedure let it).

content
string | null

Only when you get or write one file. A text file’s text; an Excel, Word or PowerPoint file’s text as the agent reads it (a spreadsheet as CSV, sheet by sheet); null for a PDF or an image. GET with ?download=1 for the file itself.

kind
enum<string>

text: any text file (notes, CSV, JSON, Markdown…). spreadsheet, document, slides: an Excel, Word or PowerPoint file (.xlsx, .docx, .pptx), read as text. pdf and image: the model sees them in a chat.

Available options:
text,
spreadsheet,
document,
slides,
pdf,
image
content_type
string
Example:

"text/markdown"