List Folders

Get all document folders (vectors) available to you. You need folder IDs to use RAG (search your documents).

Endpoint

GET /api/public/vectors

Request

curl BOX_URL/api/public/vectors \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "vectors": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Company Documents",
      "description": "Internal policies and procedures",
      "folder": "/path/to/folder",
      "iconName": "Folder",
      "accentColor": "#E0F2FE",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "Research Papers",
      "description": "Academic papers collection",
      "folder": "/path/to/research",
      "createdAt": "2024-01-20T14:00:00Z"
    }
  ]
}

Response Fields

FieldTypeDescription
idstringUse this in chat requests as vector parameter
namestringFolder display name
descriptionstringFolder description
folderstringFile system path
createdAtstringCreation timestamp

Get Folder by ID

Get details for a specific folder.

GET /api/public/vectors/:id

Request

curl BOX_URL/api/public/vectors/550e8400-e29b-41d4-a716-446655440000 \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "vector": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Company Documents",
    "description": "Internal policies and procedures",
    "folder": "/path/to/folder",
    "topK": 5,
    "filter": 0,
    "strategy": "CHUNK"
  }
}

Use in Chat

Once you have a folder ID, use it in the Chat endpoint:

curl -N -X POST BOX_URL/api/ai/chat \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-chat",
    "messages": [{"role": "user", "content": "What do my documents say about X?"}],
    "boxAddress": "BOX_URL",
    "vector": ["550e8400-e29b-41d4-a716-446655440000"]
  }'

You can search multiple folders at once:

"vector": ["folder-id-1", "folder-id-2", "folder-id-3"]