# Add document

## JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({content: '<string>'})
};

fetch('https://api.supermemory.ai/v3/documents', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Response

```json
{
  "id": "<string>",
  "status": "<string>"
}
```

## Authorizations

**Authorization**  
`string`  
`header`  
**required**  
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

## Body

**application/json**  
**content**  
`string`  
**required**  
The content to extract and process into a document. This can be a URL to a website, a PDF, an image, or a video.

**containerTag**  
`string`  
Optional tag this document should be containerized by. Max 100 characters, alphanumeric with hyphens, underscores, and dots only.

**entityContext**  
`string`  
Optional entity context for this container tag. Max 1500 characters. Used during document processing to guide memory extraction.

**customId**  
`string`  
Optional custom ID of the document. Max 100 characters, alphanumeric with hyphens, underscores, and dots only.

**metadata**  
`object`  
Optional metadata for the document.

**taskType**  
`enum<string>`  
Task type: "memory" (default) for full context layer with SuperRAG built in, "superrag" for managed RAG as a service.  
Available options: `memory`, `superrag`

## Response

**200**  
**application/json**  
Document added successfully

**id**  
`string`  
**required**  
Unique identifier of the document

**status**  
`string`  
**required**  
Status of the document

---

## Documentation Index  
Fetch the complete documentation index at: [https://supermemory.ai/docs/llms.txt](/content/docs/llms.txt)  
Use this file to discover all available pages before exploring further.
