Skip to main content
POST
/
library
/
{library_id}
/
document
Add Document
curl --request POST \
  --url https://api.libraria.ai/library/{library_id}/document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "text": "<string>",
  "title": "<string>",
  "sourceUrl": "<string>",
  "imageSnippet": "<string>"
}
'
{
  "status": "queued",
  "message": "Your document is being processed"
}

Documentation Index

Fetch the complete documentation index at: https://docs.libraria.ai/llms.txt

Use this file to discover all available pages before exploring further.

Parameters

library_id
string
required
The ID of the library to add the document to

Body

You may choose one of:
  1. A URL to scrape
  2. A raw text document
If you add both a url and a raw text document, an error will be returned. Scrape URL
url
string
The url to scrape from
Raw text
text
string
The text body of the document you want to add
title
string
The text body of the document you want to add
sourceUrl
string
The source of the document. Used for the ‘Learn More’ snippet
imageSnippet
string
The url of the image snippet you want to add in responses

Response

status
string
One of queued, success, failed
message
string
{
  "status": "queued",
  "message": "Your document is being processed"
}