---
title: "Upload a knowledge file"
method: POST
path: "/knowledge-files"
tags: ["KnowledgeFiles", "Beta"]
---

# Upload a knowledge file

`POST /knowledge-files`

## Request

- Base URL: `https://public.escape.tech/v3`
- URL: `https://public.escape.tech/v3/knowledge-files`
- Auth: API key in header `X-ESCAPE-API-KEY`

Add a file to the organization knowledge library. Files are used as context by AI pentests.

This is a two-step flow:

1. Create a signed upload URL with `POST /v3/upload/signed-url`.
2. `PUT` the file content to the returned `url`.
3. Call this endpoint with the returned `id` as `temporaryObjectKey`.

The file is processed asynchronously: poll the list endpoint until the status is `COMPLETED` or `FAILED`.

Each upload is stored under its own object, so uploading a file with an already used name adds a new file instead of overwriting the previous one. Uploads are limited to 35MB.

## Request body

- object
  - `name` string, required: The name of the file, including its extension
  - `kind` 'CSV' | 'DOC' | 'DOCX' | 'FILE' | 'GRAPHQL' | 'HTML' | 'JSON' | 'MD' | 'ODT' | 'PDF' | 'PPT' | 'PPTX' | 'TAR_GZ' | 'TXT' | 'XLS' | 'XLSX' | 'XML' | 'ZIP', required: The kind of the file, derived from its extension
  - `temporaryObjectKey` string, uuid, required: The id returned by POST /v3/upload/signed-url after the file content was uploaded to it

## Response `200`

OK

- object
  - `id` string, uuid, required: The id of the knowledge file
  - `name` string, required: The name of the knowledge file
  - `kind` 'CSV' | 'DOC' | 'DOCX' | 'FILE' | 'GRAPHQL' | 'HTML' | 'JSON' | 'MD' | 'ODT' | 'PDF' | 'PPT' | 'PPTX' | 'TAR_GZ' | 'TXT' | 'XLS' | 'XLSX' | 'XML' | 'ZIP', required: The kind of the knowledge file
  - `status` 'COMPLETED' | 'FAILED' | 'PENDING' | 'PROCESSING', required: The processing status of the knowledge file
  - `sizeInBytes` integer, nullable, required: The size of the knowledge file in bytes, known once processing has run
  - `createdAt` string, date-time, required: The date and time the knowledge file was created
  - `lastProcessingStartAt` string, date-time, nullable, required: The date and time the last processing of the knowledge file started
  - `lastProcessingEndAt` string, date-time, nullable, required: The date and time the last processing of the knowledge file ended

## Other responses

- `400`: Bad Request
- `401`: Unauthorized

---

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