POST
/
add
curl --request POST \
  --url https://ragapi.sno.ai/v1/add \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<string>",
  "spaces": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "id": "<string>",
  "metadata": {},
  "images": [
    "<string>"
  ],
  "prefetched": {
    "contentToVectorize": "<string>",
    "contentToSave": "<string>",
    "title": "<string>",
    "type": "page",
    "description": "<string>",
    "ogImage": "<string>"
  }
}'
{
  "message": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "type": "page"
}

Adds new content to the RAG system. Supports URLs, plain text, and various file types. Content can be assigned to specific spaces and include metadata or prefetched information.

Supported Content Types:

  • URLs: Web pages, Twitter/X posts
  • Text: Plain text notes
  • Files: PDF, DOC, DOCX, TXT, RTF, ODT, MD

The prefetched Object

The optional prefetched object in the request body allows you to send information about the content that your client application might have already processed. This can speed up ingestion by preventing the API from re-fetching or re-parsing data.

  • prefetched.contentToVectorize (string): The specific text to be used for generating vector embeddings. This might be a cleaned-up or key excerpt of the full content.
  • prefetched.contentToSave (string): The full content to be stored. Can differ from contentToVectorize (e.g., full HTML vs. main article text).
  • prefetched.title (string): The title of the content.
  • prefetched.type (enum: “page”, “tweet”, “note”, “document”): Specifies the nature of the content.
  • prefetched.description (string): A short summary or description of the content.
  • prefetched.ogImage (string): URL of a representative image for the content.

Providing prefetched data is particularly useful for efficiency if your client has already performed tasks like URL fetching, text extraction, or summarization.

Authorizations

Authorization
string
header
required

Enter your API key as a Bearer token. Example: 'Bearer YOUR_API_KEY'

Body

application/json

Response

200
application/json

Content added successfully

The response is of type object.