Skip to main content
POST
/
v3
/
documents
Add document
const url = 'https://api.supermemory.ai/v3/documents';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"content":"<string>"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "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 and underscores only.

containerTags
string[]
deprecated
customId
string

Optional custom ID of the document. Max 100 characters, alphanumeric with hyphens and underscores only.

metadata
object

Optional metadata for the document.

Response

Document added successfully

id
string
required

Unique identifier of the document

status
string
required

Status of the document