Skip to main content
POST
Create a context file

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Query Parameters

userId
string<uuid>

Requires an Organization API key. ID of the user who will own the file.

Body

application/json
content
string
required

The file's markdown body, up to 20000 characters. Blank or whitespace-only content is refused.

Pattern: \S
Example:

"Fiscal years start in February."

name
string
required

A unique name for the new file. .md is added if not included.

If the specified scope already has a file with the same name, the API returns an error.

Example:

"finance.md"

scope
enum<string>
required

Defines the file's scope:

  • organiztion - Organization-level files used by default in all agent sessions in the organization
  • personal - Files owned by the caller or the specified userId, which the agent only reads in sessions with that user
Available options:
organization,
personal
Example:

"personal"

Response

The created file, without its body

file
object
required