Files

Manage tenant-scoped files that can be attached to agent runs. Upload files to your tenant store, then reference them when creating agents or running tests to copy them into the agent workspace.

Overview

There are two file storage contexts. The tenant file store is a shared space where you upload files via the API. The agent workspace is a private sandbox that each agent gets for the duration of its execution. Files flow from the tenant store into agent workspaces, not the other way around.

To get files into an agent, upload them to the tenant store first, then reference their paths when creating an agent or running a test. The system copies the referenced files into the agent's workspace before execution begins. Once in the workspace, the agent can read, write, and organize files freely. It can also download files from the web and upload files to form inputs on pages.

Limits

Individual file uploads are limited to 50 MB. Total tenant storage is subject to your plan's quota. Uploads that would exceed the quota are rejected with a 507 Insufficient Storage response.

GET /api/v1/files

List directory entries

Lists non-placeholder files and directories under a tenant-relative path.

Parameters

ParameterTypeInRequiredDescription
pathstringqueryNoRelative directory path; omitted for the tenant root.

Example Request

curl
curl "http://app.aiqaramba.com/api/v1/files" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
200Directory entries.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
filesobject[]
files[].namestring
files[].is_dirboolean
files[].sizeinteger
DELETE /api/v1/files

Delete a file or directory

Deletes a file or an empty directory. Deleting a directory that still contains files requires recursive=true and otherwise fails with 409.

Parameters

ParameterTypeInRequiredDescription
pathstringqueryYesTenant-relative file path.
recursivebooleanqueryNoAlso delete a non-empty directory together with everything under it.

Example Request

curl
curl -X DELETE "http://app.aiqaramba.com/api/v1/files?path=<path>" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
204File or directory deleted.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
409The directory is not empty and recursive was not set.
500The server could not complete the request.
GET /api/v1/files/download

Download a file

Streams one tenant file as an octet stream.

Parameters

ParameterTypeInRequiredDescription
pathstringqueryYesTenant-relative file path.

Example Request

curl
curl "http://app.aiqaramba.com/api/v1/files/download?path=<path>" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
200Raw file content.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.
POST /api/v1/files/mkdir

Create a directory

Creates a storage placeholder for an otherwise-empty directory.

Request Body (application/json)

FieldTypeRequiredDescription
pathstringYesPath of the directory to create

Example Request

curl
curl -X POST "http://app.aiqaramba.com/api/v1/files/mkdir" \
  -H "Authorization: Bearer $AIQA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "path": "<string>"
  }'

Status Codes

CodeDescription
200Directory created.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
successboolean
POST /api/v1/files/move

Move or rename a file

Request Body (application/json)

FieldTypeRequiredDescription
src_pathstringYesCurrent path of the file
dst_pathstringYesNew path for the file

Example Request

curl
curl -X POST "http://app.aiqaramba.com/api/v1/files/move" \
  -H "Authorization: Bearer $AIQA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "src_path": "<string>",
    "dst_path": "<string>"
  }'

Status Codes

CodeDescription
200File moved.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
successboolean
POST /api/v1/files/upload

Upload files

Stores one or more multipart files under an optional relative directory prefix.

Request Body (multipart/form-data)

FieldTypeRequiredDescription
pathstringNoDirectory prefix to place files under
filesfile[]YesOne or more files (multipart form field name: 'files')

Example Request

curl
curl -X POST "http://app.aiqaramba.com/api/v1/files/upload" \
  -H "Authorization: Bearer $AIQA_API_KEY" \
  -F 'files=@./files'

Status Codes

CodeDescription
200Stored files.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
413The request body or uploaded artifact is too large.
500The server could not complete the request.
507The tenant does not have enough storage quota.

Response Fields (200)

FieldTypeDescription
uploadedobject[]
uploaded[].pathstring
uploaded[].sizeinteger