---
title: "Upload AI agent knowledge base"
method: POST
path: "/test_framework/v2/aiagents/{id}/upload_knowledge_base/"
tags: ["test_framework"]
---

# Upload AI agent knowledge base

`POST /test_framework/v2/aiagents/{id}/upload_knowledge_base/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/test_framework/v2/aiagents/{id}/upload_knowledge_base/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer

Upload one or more files to the agent's knowledge base. Accepts either a `multipart/form-data` body (used by the web dashboard) or an `application/json` body where each entry carries base64-encoded file content.

## Path parameters

- `id` integer, required

## Query parameters

- `page` integer
- `page_size` integer

## Request body

- object
  - `files` object[], required: List of files to upload, each provided as base64-encoded content.
    - `name` string, required: Filename including extension (e.g. `manual.pdf`).
    - `content_base64` string, byte, required: Base64-encoded file content. Accepts a raw base64 string or a `data:<mime>;base64,...` data URI.

## Response `201`

- PaginatedKnowledgeBaseFileList
  - `count` integer, required
  - `next` string, uri, nullable
  - `previous` string, uri, nullable
  - `results` KnowledgeBaseFile[], required
    - `id` integer
    - `agent` integer, required
    - `file` string, uri, required: Knowledge base file
    - `file_url` string: URL of the Knowledge file
    - `file_name` string: Name of the Knowledge file
    - `file_type` string: MIME type of the Knowledge file
    - `file_size` integer: Size in bytes. Example: `1048576`
    - `created_at` string, date-time: When this record was created. Example: `2024-03-15T10:30:45Z`
    - `updated_at` string, date-time: When this record was last updated. Example: `2024-03-15T10:35:11Z`

## Other responses

- `400`

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/test_framework/v2/aiagents/:id/upload_knowledge_base/post.md)

---

[API](https://skmtc.dev/cekura/apis/cekura-api.md) - [All operations](https://skmtc.dev/cekura/apis/cekura-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cekura/apis/cekura-api/revisions/a6fb6a739212?raw)
