Skip to main content
POST
/
v1
/
documents
Create a markdown document
curl --request POST \
  --url https://api.devic.ai/v1/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "markdownContent": "<string>",
  "projectId": "<string>",
  "parentDocumentId": "<string>",
  "folderId": "<string>"
}
'
{
  "_id": "<string>",
  "clientUID": "<string>",
  "projectId": "<string>",
  "name": "<string>",
  "fileName": "<string>",
  "mimeType": "<string>",
  "size": 123,
  "markdownContent": "<string>",
  "summary": "<string>",
  "tokenCount": 123,
  "currentVersion": 123,
  "folderId": "<string>",
  "parentDocumentId": "<string>",
  "createdByUserUID": "<string>",
  "creationTimestampMs": 123,
  "lastEditTimestampMs": 123
}

Authorizations

Authorization
string
header
required

Use JWT token for authentication

Body

application/json
name
string
required

Document name (without extension)

markdownContent
string
required

Markdown content to store and index for RAG

projectId
string

Optional project ID to scope the document

parentDocumentId
string

Optional parent document ID (for subdocuments referenced via @ mentions)

folderId
string

Optional folder ID to file the document

Response

Document created successfully

_id
string

Document ID

clientUID
string

Client UID

projectId
string | null

Project ID the document is scoped to

name
string

Document name

fileName
string

File name (with extension)

fileType
enum<string>

File type

Available options:
md,
pdf,
txt,
docx
mimeType
string

MIME type

size
integer

File size in bytes

status
enum<string>

Processing / indexing status

Available options:
pending,
ready,
failed
markdownContent
string

Markdown content (for markdown documents)

summary
string

Auto-generated summary

tokenCount
integer

Token count

currentVersion
integer

Current version number

folderId
string | null

Folder ID the document is filed in

parentDocumentId
string | null

Parent document ID (for subdocuments referenced via @ mentions)

createdByUserUID
string

UID of the user that created the document

creationTimestampMs
integer<int64>

Creation timestamp (ms)

lastEditTimestampMs
integer<int64>

Last edit timestamp (ms)