---
title: "Add File To Agent Auto Collection"
method: POST
path: "/api/knowledge/agents/{agent_id}/files"
tags: ["knowledge", "knowledge"]
---

# Add File To Agent Auto Collection

`POST /api/knowledge/agents/{agent_id}/files`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/knowledge/agents/{agent_id}/files`
- Auth: none declared

Add a file to an agent's auto-collection. Creates the auto-collection if needed.

## Path parameters

- `agent_id` integer, required

## Request body

- AddAgentFileRequest: Request to add a file to an agent's auto-collection.
  - `file_id` integer, required
  - `priority` integer

## Response `200`

Successful Response

- CollectionFileResponse: File within a collection.
  - `file_id` integer, required
  - `title` string, nullable
  - `original_filename` string, nullable
  - `mime_type` string, nullable
  - `byte_size` integer, nullable
  - `status` string, required
  - `chunk_count` integer
  - `priority` integer
  - `is_enabled` boolean
  - `is_pinned` boolean
  - `added_at` string, date-time, required
  - `thumbnail_url` string, nullable
  - `web_url` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
