> ## 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.

# Add Document

> Add a new document to your library via scraping or raw text

### Parameters

<ParamField path="library_id" type="string" required={true}>
  The ID of the library to add the document to
</ParamField>

### 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**

<ParamField body="url" type="string">
  The url to scrape from
</ParamField>

<Divider />

**Raw text**

<ParamField body="text" type="string">
  The text body of the document you want to add
</ParamField>

<ParamField body="title" type="string" optional={true}>
  The text body of the document you want to add
</ParamField>

<ParamField body="sourceUrl" type="string" optional={true}>
  The source of the document. Used for the 'Learn More' snippet
</ParamField>

<ParamField body="imageSnippet" type="string" optional={true}>
  The url of the image snippet you want to add in responses
</ParamField>

### Response

<ResponseField name="status" type="string">
  One of queued, success, failed
</ResponseField>

<ResponseField name="message" type="string" />

<ResponseExample>
  ```json Example Response
  {
    "status": "queued",
    "message": "Your document is being processed"
  }
  ```
</ResponseExample>
