Made in 10Docs
GuidesAPI
ReferenceDocuments

Add a document

Makes a document from a file (`multipart/form-data`), a web address (`{ "url" }`) or pasted text (`{ "text" }`).

POST
/documents

Authorization

secretKey
headerAuthorizationBearer <sk_live_… or sk_test_… (a prefix and 40 base62 characters)>

A secret key from the dashboard, sent as Authorization: Bearer sk_live_…. Live keys run real, charged calls; test keys (sk_test_…) run calls of at most 60 seconds, 20 a day per organization, never charged. Each key sees only its own env's calls, meetings, webhooks, memories and analytics. Publishable keys (pk_…) are refused.

Request Body

  1. body

A file to read, as multipart/form-data.

file*string

One .txt, .md, .pdf or .docx file, with its file name (the extension says how it is read). At most 10 MB (2 MB through the public address).

title?string

Left out, the file's name without its extension.

Lengthlength <= 200
tags?array<string>

Repeat the field, or send one field with commas.

Response Body

The document, with its text (empty while processing or failed).

application/json
  1. response

One document, with its text.

Example
{  "id": "doc_1Qm6Tx3KcW8vRp5ZbN2h",  "title": "Opening hours",  "source": "url",  "file_name": null,  "url": "https://example.com/help/opening-hours",  "format": "html",  "size_bytes": 48211,  "char_count": 5120,  "status": "ready",  "error": null,  "tags": [    "faq",    "hours"  ],  "character_ids": [    "chr_4fT9kQ2mXw7LbN3pZs8V"  ],  "fetched_unix": 1793300000,  "created_unix": 1793300000,  "updated_unix": 1793300000}
id*DocumentId
Match^doc_[0-9A-Za-z]{20}$
Example"doc_1Qm6Tx3KcW8vRp5ZbN2h"
title*string
Lengthlength <= 200
source*string
Value in"upload""url""text"
file_name*string|null
url*string|null
format*string

images: pictures uploaded together as a deck (no text).

Value in"txt""md""pdf""docx""html""text""images"
size_bytes*integer
char_count*integer

The text's length in characters (what counts against a character's budget).

status*DocumentStatus

processing (being read), ready, or failed (kept, with error saying why; no text).

Value in"processing""ready""failed"
error*|

Why it failed, in words you can show.

tags*array<>

At most 20 tags of 1 to 40 characters, kept lower-case; repeats dropped.

Itemsitems <= 20
character_ids*array<>

The characters that take it.

fetched_unix*|

When a link was last fetched successfully.

Formatint64
created_unix*Unix

Unix seconds, UTC.

Formatint64
Example1793300000
updated_unix*Unix

Unix seconds, UTC.

Formatint64
Example1793300000
slides?|

Its slides, when it is a deck (an uploaded PDF, or pictures); null otherwise. Independent of status: a scanned PDF has no text and ready slides.

text*string

The extracted text (empty while processing or when failed).

Lengthlength <= 500000
curl -X POST 'https://api.daxov.com/v1/documents' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://example.com/help/opening-hours",  "tags": [    "faq",    "hours"  ]}'
Example Response
{  "id": "doc_1Qm6Tx3KcW8vRp5ZbN2h",  "title": "Opening hours",  "source": "url",  "file_name": null,  "url": "https://example.com/help/opening-hours",  "format": "html",  "size_bytes": 48211,  "char_count": 5120,  "status": "ready",  "error": null,  "tags": [    "faq",    "hours"  ],  "character_ids": [    "chr_4fT9kQ2mXw7LbN3pZs8V"  ],  "fetched_unix": 1793300000,  "created_unix": 1793300000,  "updated_unix": 1793300000,  "text": "string"}