Skip to main content
POST
Add a document to a project

Path Parameters

project_id
string
required

The project's id (not its slug). GET /admin/api/projects lists each project's id and slug.

Body

application/json
name
string
required
Maximum string length: 200
text
string

The document as UTF-8 text or Markdown. Send text or content_base64, not both.

content_base64
string

A PDF, Word (.docx), HTML, Markdown or text file, base64-encoded (at most 10 MiB decoded). Needs content_type.

content_type
enum<string>

The file's type. Optional with text (text/plain or text/markdown); required with content_base64.

Available options:
text/plain,
text/markdown,
application/pdf,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
text/html
kind
enum<string>
default:other
Available options:
prd,
spec,
adr,
runbook,
agentic_context,
generated,
other
source
enum<string>
default:upload
Available options:
upload,
repo,
agent
source_ref
string

Where it came from, such as a repository path and commit.

Maximum string length: 500
share_scope
enum<string>
default:project
Available options:
project,
workspace
replaces
string<uuid>

The id of a document in this project that this is a new version of (#683). It takes that document's place, which is kept as a version; the same text again changes nothing. The new version keeps the document's share_scope, so it need not be sent. Not for a repository mirror.

Response

Successful operation

The response is of type object.