For the complete documentation index, see llms.txt. This page is also available as Markdown.

Files

Upload File

post
/files

Upload a file with optional metadata.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Body
filestring · binary[]Optional
purposestring · enumOptionalDefault: user_dataPossible values:
metadatastring · nullableOptional

JSON string with file metadata

instructionsstring · nullableOptional

Instructions used to process the file

workspacestringOptionalDefault: default
Responses
200

Successful Response

application/json
or
post/files
POST /files HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 103

{
  "file": [
    "binary"
  ],
  "purpose": "user_data",
  "metadata": "text",
  "instructions": "text",
  "workspace": "default"
}
[
  {
    "id": "text",
    "object": "file",
    "bytes": 1,
    "created_at": 1,
    "filename": "text",
    "purpose": "user_data",
    "status": "uploaded",
    "status_details": "text",
    "expires_at": 1,
    "org_id": "text",
    "workspace_id": "default",
    "user_id": "text",
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
]

List Files

get
/files

Returns a list of files, filtered by the organization.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Query parameters
workspacestringOptional

List files in workspace

Default: default
afterstring · nullableOptional

Cursor for pagination

limitinteger · min: 1 · max: 10000Optional

Limit the number of returned files

Default: 10000
orderstringOptional

Sort order by creation timestamp

Default: desc
purposestring · enum · nullableOptional

Filter by purpose

Possible values:
filterstring · nullableOptional

Filter by metadata

Responses
200

Successful Response

application/json
objectstringOptionalDefault: list
totalintegerRequired
get/files
GET /files HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "data": [
    {
      "id": "text",
      "object": "file",
      "bytes": 1,
      "created_at": 1,
      "filename": "text",
      "purpose": "user_data",
      "status": "uploaded",
      "status_details": "text",
      "expires_at": 1,
      "org_id": "text",
      "workspace_id": "default",
      "user_id": "text",
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "object": "list",
  "total": 1
}

Retrieve File

get
/files/{file_id}

Returns information about a specific file, verifying organization access.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

Get file from workspace

Default: default
Responses
200

Successful Response

application/json
idstringRequired
objectstringOptionalDefault: file
bytesintegerRequired
created_atintegerRequired
filenamestringRequired
purposestring · enum · nullableOptionalDefault: user_dataPossible values:
statusstring · enumOptionalDefault: uploadedPossible values:
status_detailsstring · nullableOptional
expires_atinteger · nullableOptional
org_idstring · nullableOptional
workspace_idstringOptionalDefault: default
user_idstring · nullableOptional
get/files/{file_id}
GET /files/{file_id} HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "object": "file",
  "bytes": 1,
  "created_at": 1,
  "filename": "text",
  "purpose": "user_data",
  "status": "uploaded",
  "status_details": "text",
  "expires_at": 1,
  "org_id": "text",
  "workspace_id": "default",
  "user_id": "text",
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Delete File

delete
/files/{file_id}

Delete a file, verifying organization access.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

Delete file from workspace

Default: default
Responses
200

Successful Response

application/json
idstringRequired
objectstringOptionalDefault: file
deletedbooleanOptionalDefault: true
delete/files/{file_id}
DELETE /files/{file_id} HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "object": "file",
  "deleted": true
}

Retrieve File Content

get
/files/{file_id}/content

Returns the contents of the specified file, verifying organization access.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

The workspace id to get file content from

Default: default
Responses
200

Successful Response

application/json
anyOptional
get/files/{file_id}/content
GET /files/{file_id}/content HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update File Metadata

patch
/files/{file_id}/metadata

Update metadata for a specific file, verifying organization access.

Authorizations
AuthorizationstringRequired

Enter your bearer token in the format 'your-token' (without quotes or 'Bearer' prefix)

Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

The workspace id to update th file in

Default: default
Body

The metadata to update. instructions key is considered as an instruction to update metadata by AI.

Other propertiesanyOptional
Responses
200

Successful Response

application/json
idstringRequired
objectstringOptionalDefault: file
bytesintegerRequired
created_atintegerRequired
filenamestringRequired
purposestring · enum · nullableOptionalDefault: user_dataPossible values:
statusstring · enumOptionalDefault: uploadedPossible values:
status_detailsstring · nullableOptional
expires_atinteger · nullableOptional
org_idstring · nullableOptional
workspace_idstringOptionalDefault: default
user_idstring · nullableOptional
patch/files/{file_id}/metadata
PATCH /files/{file_id}/metadata HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "id": "text",
  "object": "file",
  "bytes": 1,
  "created_at": 1,
  "filename": "text",
  "purpose": "user_data",
  "status": "uploaded",
  "status_details": "text",
  "expires_at": 1,
  "org_id": "text",
  "workspace_id": "default",
  "user_id": "text",
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Last updated