Writing a document with an existing id replaces it. To update a document, write it again.
Concepts
Documents
A document is an id, text and metadata.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
A document is an id, text and metadata.
{ "id": "refunds", "text": "Refunds are available for 30 days after purchase.", "metadata": { "team": "support" } }
| Field | Rules |
|---|---|
id | 1-256 characters of A-Z a-z 0-9 . _ : -, starting with a letter or digit. Optional: Conare generates one if you leave it out. |
text | Required. Up to 256 KB. |
metadata | Optional. Up to 32 keys. Values are strings, numbers, booleans or arrays of strings. Use it to filter. |
await docs.add([
{ id: "refunds", text: "Refunds are available for 30 days.", metadata: { team: "support" } },
{ id: "shipping", text: "Orders ship within two business days.", metadata: { team: "ops" } },
]);
// ["refunds", "shipping"]
curl https://api.conare.ai/namespaces/docs/documents \
-H "Authorization: Bearer $CONARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"documents": [{"id": "refunds", "text": "Refunds are available for 30 days."}]}'
await docs.get("refunds"); // { id, text, metadata, updatedAt } or null
for await (const doc of docs.list()) { // every document, page by page
console.log(doc.id, doc.updatedAt);
}
await docs.delete("refunds");
curl https://api.conare.ai/namespaces/docs/documents/refunds -H "Authorization: Bearer $CONARE_API_KEY"
# Pages: pass next_cursor back as cursor until it is null.
curl "https://api.conare.ai/namespaces/docs/documents?limit=100" -H "Authorization: Bearer $CONARE_API_KEY"
curl -X DELETE https://api.conare.ai/namespaces/docs/documents/refunds -H "Authorization: Bearer $CONARE_API_KEY"