Upload and ingest a file
const url = 'http://localhost:11044/api/v1/documents/upload';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/documents/upload \ --header 'Content-Type: multipart/form-data' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --form file=@fileUpload a file (PDF, text, HTML, etc.) for ingestion. The optional fromOrgDomain field records which org the file is really from (the upload dialog’s From field).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Domain of the organisation the file is really from, recorded as its publisher (the upload dialog’s From field); omitted or blank records none
Tags to stamp on the document and its chunks, as repeated tags fields or one comma-separated value; trimmed, blanks dropped, duplicates collapsed. Omitted leaves the document untagged
Request Body
Section titled “Request Body”object
The file to ingest (PDF, text, HTML and other formats the converter reads). Its original filename names the document, whose uri is upload://<world context>/<filename>; a part with no filename is called upload
Responses
Section titled “Responses”Document ingested. status is ingested, or ingested_incomplete when some chunks could not be embedded: the document is kept and text-searchable, chunksWithoutEmbeddings of chunks miss semantic search
A document ingested. Kept and text-searchable even when some chunks could not be embedded
object
How many chunks were stored, null where the stored record could not be read back
How many chunks have no embedding. Zero when every chunk was embedded
Present only for ingested_incomplete: how many chunks miss embeddings, and that re-ingesting embeds them
ingested, or ingested_incomplete when some chunks could not be embedded
The document’s title. For inline text, the given name where no title was found
The document’s URI
No embedding model is set, so nothing could be searched: the reason names the command that sets one
An ingest refused because this appliance has no embedding model yet. Not set up, rather than broken
object
The embedding status this was decided from: configured, model, dimensions and reason
object
Why, in the operator’s words, naming the command that sets a model
Always unavailable
Example
unavailable
