Skip to main content
POST
/
orgs
/
{org_id}
/
k2
/
{kb_id}
/
directories
cURL
curl --request POST \
  --url https://api.timbal.ai/orgs/{org_id}/k2/{kb_id}/directories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "directory": "<string>"
}
'
{
  "created": true,
  "directory": "<string>",
  "placeholder_file_id": "<string>"
}
Folders appear in file listings with content_type set to application/vnd.timbal.k2-directory. Creating a folder that already exists is idempotent and returns 200. Folders and files share the same namespace: creating folder reports under docs/ returns 409 if a file named reports already exists there.

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required
kb_id
string
required

Body

application/json
directory
string
required

Folder path, same format as the directory field on file upload (e.g. docs/reports).

Response

Folder already exists

created
boolean
required

true if this call created the folder, false if it already existed.

directory
string
required
placeholder_file_id
string
required

Listing id for this folder; remove it with DELETE /orgs/{org_id}/k2/{kb_id}/files/{file_id}.