Upload Text
This endpoint is used to directly upload text content to Supavec.
POST/upload_text
Request Body
- Name
contents
- Required
Required
- Type
- string
- Description
The text content to upload. Minimum length:
5
.
- Name
name
- Type
- string
- Description
The name of the content.
- Name
chunk_size
- Type
- integer
- Description
The chunk size (in tokens) applied when splitting the document.
- Name
chunk_overlap
- Type
- integer
- Description
The chunk overlap (in tokens) applied when splitting the document.
Before you can make requests to the Supavec API, you will need to grab your API key from your dashboard.
JavaScript
const res = await fetch("https://api.supavec.com/upload_text", {
method: "POST",
headers: {
"Content-Type": "application/json",
authorization: apiKey,
},
body: JSON.stringify({ name, contents }),
});
Response
{
"success": true,
"message": "Text uploaded and processed successfully",
"file_id": "939b2cd7-56d5-4c44-b491-14bfc202e9a0"
}