LogoLogo
  • 🔬Activeloop
  • 🏠Setup
    • Quickstart
  • Models & Pricing
  • 📖User Guide
    • Ingesting with Metadata
      • Modalities
    • Filtering Query
      • Query Syntax
    • Streaming Output
  • 🏗️API Reference
    • Chat Completions
    • Files
    • Workspaces
Powered by GitBook
On this page
Export as PDF
  1. API Reference

Files

PreviousChat CompletionsNextWorkspaces

Last updated 1 day ago

🏗️

Retrieve File

get

Returns information about a specific file, verifying organization access.

Authorizations
Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

Get file from workspace

Default: default
Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
GET /files/{file_id} HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
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

Delete a file, verifying organization access.

Authorizations
Path parameters
file_idstringRequired

The ID of the file

Query parameters
workspacestringOptional

Delete file from workspace

Default: default
Responses
200
Successful Response
application/json
422
Validation Error
application/json
delete
DELETE /files/{file_id} HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
Accept: */*
{
  "id": "text",
  "object": "file",
  "deleted": true
}

Retrieve File Content

get

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

Authorizations
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
Responseany
422
Validation Error
application/json
get
GET /files/{file_id}/content HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
Accept: */*

No content

  • POSTUpload File
  • GETList Files
  • GETRetrieve File
  • DELETEDelete File
  • GETRetrieve File Content
  • PATCHUpdate File Metadata

List Files

get

Returns a list of files, filtered by the organization.

Authorizations
Query parameters
workspacestringOptional

List files in workspace

Default: default
afterany ofOptional

Cursor for pagination

stringOptional
or
nullOptional
limitinteger · min: 1 · max: 10000Optional

Limit the number of returned files

Default: 10000
orderstringOptional

Sort order by creation timestamp

Default: desc
purposeany ofOptional

Filter by purpose

string · enumOptionalPossible values:
or
nullOptional
filterany ofOptional

Filter by metadata

stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
GET /files HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
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
}

Upload File

post

Upload a file with optional metadata.

Authorizations
Body
filestring · binary[]Optional
purposestring · enumOptionalDefault: user_dataPossible values:
metadataany ofOptional

JSON string with file metadata

stringOptional
or
nullOptional
instructionsany ofOptional

Instructions used to process the file

stringOptional
or
nullOptional
workspacestringOptionalDefault: default
Responses
200
Successful Response
application/json
Responseany of
or
422
Validation Error
application/json
post
POST /files HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
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"
    }
  }
]

Update File Metadata

patch

Update metadata for a specific file, verifying organization access.

Authorizations
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
Responseany of
or
nullOptional
422
Validation Error
application/json
patch
PATCH /files/{file_id}/metadata HTTP/1.1
Host: api.activeloop.ai
Authorization: Bearer JWT
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"
  }
}