Skip to main content

Folders

Create a Folder

curl -X POST https://api.travila.ai/api/v1/storage/gateway/create-folder \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"folder_path": "/documents/work"
}'

Intermediate folders are created automatically — creating /documents/work also creates /documents if it doesn't exist.

Delete a Folder

curl -X POST https://api.travila.ai/api/v1/storage/gateway/delete-folder \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"folder_path": "/documents/work",
"recursive": true
}'

Set recursive to true to delete all files and subfolders inside. Without it, the folder must be empty.