Skip to main content
Create a small file in your context repository, then read it back by ID.

1. Create an API key

In the Qontext app, open Clients → API Keys and select + Create API key. Copy the key and store it as an environment variable:
The key needs permission to create and read files at the example path. See Authentication for access controls.

2. Create a file

This request creates /api-example/hello.md. Missing parent folders are created automatically.
A successful request returns 201 and a file object. These are the fields you need next:
This is an excerpt; see Create a file for the full response. Save the returned id and lastChangeId.
Running the example again at the same path returns 409 path_already_exists. Choose another path, or find the existing file with the path filter. Creating a file never overwrites existing content.

3. Read the file

Replace the example ID with the id returned by your create request.
The Python and JavaScript examples continue from the previous step. The response includes the full content and the file’s lastChangeId.

Next steps