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.

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"
}

Was this page helpful?