Inserts a document into the specified external source if it doesn't contain a document with the specified doc_id; updates the specified document otherwise.
Note: This operation is only valid for external sources of type CUSTOM. Attempts to perform it in other types of external sources are rejected with a 400 Bad Request error.
The request returns 204 No Content as soon as the document is accepted for processing. Use GET /knowledge-management/external-sources/{external_source_id}/documents/{doc_id}/status to follow its processing.
Request formats
-
application/json: the document is sent inline incontent, as HTML (default) or Markdown
(content_type). -
multipart/form-data: partdocument(JSON, same fields as the JSON body) is required and
must be sent once. Optional partfileuploads a native file instead of inline content.
Exactly one ofdocument.contentorfilemust be provided.content_typeis ignored when a
filepart is sent. Accepted file formats: PDF, DOCX, PPTX, XLSX, plain text, Markdown and
CSV, detected from the file content. For text files, the filename extension only selects
Markdown (.md) or CSV (.csv); any other text file is treated as plain text. HTML is not
accepted as a file (send it inline instead). Files larger than 10 MiB are
rejected with400 Bad Request; request bodies larger than the maximum accepted request body
size are rejected with413 Payload Too Large.
Images (applies only when image processing is enabled for the knowledge base)
-
Applies only when image processing is enabled for the knowledge base: images referenced from
the content can come fromdata:URIs, from multipartimagesparts (referenced by
filename from HTML<img src>or Markdown), or fromhttpsURLs. -
Applies only when image processing is enabled for the knowledge base: supported formats are
png, jpeg, gif and webp; SVG is rejected. Each image may be up to 10 MiB and 16 megapixels,
and at most 20 images are processed per document. -
Applies only when image processing is enabled for the knowledge base:
imagespart filenames
must be unique and must not contain/,\or..;imagesparts cannot be combined with
afilepart. Sendingimagesparts when image processing is disabled is rejected with
400 Bad Request. -
Applies only when image processing is enabled for the knowledge base: invalid inline or
uploaded images are rejected with400 Bad Requestand a message of the form
Image <n>: <reason>. Failures to download images fromhttpsURLs are not fatal; the
document is still processed. -
Applies only when image processing is enabled for the knowledge base: Markdown content larger
than 64 KB that containsdata:URI images or references multipartimagesparts is
rejected with400 Bad Request; images referenced only byhttpsURLs are processed
asynchronously and do not trigger this limit.
Rate limiting
Requests may be rate limited by the API gateway or by the service. A rate-limited request is rejected with 429 Too Many Requests and a Retry-After header with the number of seconds to wait before retrying.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
204Document successfully created/updated.
413Payload Too Large - the request body exceeds the maximum accepted size. The response has no body.