Ingest text
const url = 'http://localhost:11044/api/v1/documents/text';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"content":"example","name":"example","tags":["example"]}'};
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/text \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "content": "example", "name": "example", "tags": [ "example" ] }'Create a document from inline text content, saved to the world’s data/documents directory under the given name; an existing file of that name is overwritten.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Inline text to keep and ingest. content is saved as data/documents/<name> in the world, overwriting any file of that name, then ingested from there; name doubles as the title when none can be parsed from the content. tags are trimmed, blanks dropped and duplicates collapsed; omitted or empty leaves the document untagged
Body of POST /documents/text: inline text saved as a file in the world’s data/documents directory and ingested from there.
object
The text to ingest, written to the file as given
File name to save the text under in the world’s data/documents directory, overwriting a file of that name; also the title when the text yields none
Tags to put on the document and its chunks. Blanks are dropped and duplicates collapsed; absent means none
Example generated
{ "content": "example", "name": "example", "tags": [ "example" ]}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
unavailableIngestion failed
An ingest that failed: the word error and the reason
object
What failed — the fetch or the conversion — in the failure’s own words
Always error
Example
error
