> ## Documentation Index
> Fetch the complete documentation index at: https://docs.conare.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Conare's API is at https://api.conare.ai. Authenticate with `Authorization: Bearer $CONARE_API_KEY`.
> The full OpenAPI spec is at https://api.conare.ai/openapi.yaml; each endpoint has a page under /api-reference, and appending .md to any page URL returns its Markdown.
> Embed with model conare-embed-1; send input_type "query" for search queries. Rerank with conare-rerank-1.
> Prefer the TypeScript SDK (`npm install conare`) or plain HTTP in examples.
> Install the Conare skill with `npx skills add https://docs.conare.ai`; search these docs over MCP at https://docs.conare.ai/mcp; the whole site is at https://docs.conare.ai/llms-full.txt.

# جلب المستندات وسردها وحذفها

> اقرأ مستندًا واحدًا، وتصفّح مساحة أسماء صفحةً صفحة، واحذف حسب المعرّف أو حسب عامل تصفية.

لحذف كل شيء في مساحة أسماء، [احذف مساحة الأسماء](https://docs.conare.ai/ar/namespaces.md#حذف-مساحة-أسماء).

## جلب مستند

`GET /namespaces/:namespace/documents/:id`

يُرجع مستندًا واحدًا بنصّه الكامل، أو `404 document_not_found`.

```bash curl theme={null}
curl https://api.conare.ai/namespaces/docs/documents/refunds \
  -H "Authorization: Bearer $CONARE_API_KEY"
```

```ts TypeScript theme={null}
const doc = await docs.get("refunds"); // null if it doesn't exist
```

```json Response theme={null}
{
  "id": "refunds",
  "text": "Refunds are available for 30 days.",
  "metadata": { "team": "support" },
  "updated_at": "2026-10-21T21:38:52Z",
  "version": 1
}
```

| الحقل | المعنى |
| - | - |
| `id`، `text`، `metadata` | المستند |
| `updated_at` | آخر وقت تغيّر فيه، بتوقيت UTC |
| `version` | يزداد مع كل تغيير |
| `user`، `seq` | كما [كُتبت](https://docs.conare.ai/ar/write.md)، عند تعيينها |

المخطط الكامل: [جلب مستند](https://docs.conare.ai/ar/api-reference/documents/get-a-document.md).

## سرد المستندات

`GET /namespaces/:namespace/documents`

يُرجع المستندات مرتّبة حسب المعرّف، دون نصوصها.

```bash curl theme={null}
curl "https://api.conare.ai/namespaces/docs/documents?limit=100" \
  -H "Authorization: Bearer $CONARE_API_KEY"
```

```ts TypeScript theme={null}
for await (const doc of docs.list()) {
  console.log(doc.id, doc.version); // reads every page
}
```

```json Response theme={null}
{
  "documents": [
    { "id": "refunds", "metadata": { "team": "support" }, "updated_at": "2026-10-21T21:38:52Z", "version": 1 },
    { "id": "shipping", "metadata": { "team": "ops" }, "updated_at": "2026-10-21T21:38:52Z", "version": 1 }
  ],
  "next_cursor": null
}
```

| الخيار | النوع | ما يفعله |
| - | - | - |
| `limit` | integer، الافتراضي 50 | عدد المستندات في كل صفحة، 1-100 |
| `cursor` | string | قيمة `next_cursor` من الصفحة السابقة، وتكون `null` في الصفحة الأخيرة |

المخطط الكامل: [سرد المستندات](https://docs.conare.ai/ar/api-reference/documents/list-documents.md).

## حذف مستند

`DELETE /namespaces/:namespace/documents/:id`

يحذف مستندًا واحدًا، أو يُرجع `404 document_not_found`.

```bash curl theme={null}
curl -X DELETE https://api.conare.ai/namespaces/docs/documents/refunds \
  -H "Authorization: Bearer $CONARE_API_KEY"
```

```ts TypeScript theme={null}
await docs.delete("refunds");
```

```json Response theme={null}
{ "deleted": true }
```

المخطط الكامل: [حذف مستند](https://docs.conare.ai/ar/api-reference/documents/delete-a-document.md).

## حذف عدة مستندات

`POST /namespaces/:namespace/documents/delete`

يحذف قائمة من المعرّفات، أو كل مستند يطابقه عامل تصفية: أرسل `ids` أو `filter`، لا كليهما.

```bash curl theme={null}
curl https://api.conare.ai/namespaces/docs/documents/delete \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["refunds", "shipping"]}'

curl https://api.conare.ai/namespaces/docs/documents/delete \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filter": {"team": "support"}}'
```

```ts TypeScript theme={null}
await docs.deleteMany(["refunds", "shipping"]); // how many were deleted
await docs.deleteWhere({ team: "support" });    // repeats until done
```

```json Response theme={null}
{ "deleted": 2, "more": false }
```

| الخيار | النوع | ما يفعله |
| - | - | - |
| `ids` | array | من 1 إلى 1,000 معرّف مستند؛ تُتخطّى المعرّفات غير الموجودة |
| `filter` | object | [عامل تصفية](https://docs.conare.ai/ar/filters.md)، دون `$ne` أو `$nin` |

* `deleted` هو عدد ما حذفه هذا الاستدعاء.
* يحذف عامل التصفية على دفعات: ما دامت `more` بقيمة `true`، أرسله مجددًا.

> [!WARNING]
>
> مفتاح التصفية المكتوب خطأً لا يطابق شيئًا، فلا يُحذف شيء.

المخطط الكامل: [حذف المستندات حسب المعرّف أو عامل التصفية](https://docs.conare.ai/ar/api-reference/documents/delete-documents-by-id-or-filter.md).


## Related topics

- [MCP](https://docs.conare.ai/ar/mcp-server.md)
- [المصادر](https://docs.conare.ai/ar/sources.md)
- [كتابة المستندات](https://docs.conare.ai/ar/write.md)
- [مساحات الأسماء](https://docs.conare.ai/ar/namespaces.md)
- [الملفات](https://docs.conare.ai/ar/files.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.