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

# Ottenere, elencare ed eliminare documenti

> Leggi un documento, scorri le pagine di un namespace ed elimina per id o per filtro.

Per eliminare tutto in un namespace, [elimina il namespace](https://docs.conare.ai/it/namespaces.md#eliminare-un-namespace).

## Ottenere un documento

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

Restituisce un documento con il suo testo completo, oppure `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
}
```

| Campo | Significato |
| - | - |
| `id`, `text`, `metadata` | Il documento |
| `updated_at` | Quando è cambiato l'ultima volta, in UTC |
| `version` | Aumenta a ogni modifica |
| `user`, `seq` | Come [scritti](https://docs.conare.ai/it/write.md), se impostati |

Schema completo: [Ottenere un documento](https://docs.conare.ai/it/api-reference/documents/get-a-document.md).

## Elencare i documenti

`GET /namespaces/:namespace/documents`

Restituisce i documenti in ordine di id, senza il loro testo.

```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
}
```

| Opzione | Tipo | Cosa fa |
| - | - | - |
| `limit` | integer, predefinito 50 | Documenti per pagina, 1-100 |
| `cursor` | string | Il `next_cursor` della pagina precedente, che è `null` nell'ultima pagina |

Schema completo: [Elencare i documenti](https://docs.conare.ai/it/api-reference/documents/list-documents.md).

## Eliminare un documento

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

Elimina un documento, oppure restituisce `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 }
```

Schema completo: [Eliminare un documento](https://docs.conare.ai/it/api-reference/documents/delete-a-document.md).

## Eliminarne molti

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

Elimina un elenco di id, o tutti i documenti che corrispondono a un filtro: invia `ids` oppure `filter`, non entrambi.

```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 }
```

| Opzione | Tipo | Cosa fa |
| - | - | - |
| `ids` | array | Da 1 a 1.000 id di documenti; gli id mancanti vengono ignorati |
| `filter` | object | Un [filtro](https://docs.conare.ai/it/filters.md), senza `$ne` o `$nin` |

* `deleted` indica quanti documenti ha eliminato questa chiamata.
* Un filtro elimina a lotti: finché `more` è `true`, invialo di nuovo.

> [!WARNING]
>
> Una chiave di filtro scritta male non corrisponde a nulla, quindi non viene eliminato nulla.

Schema completo: [Eliminare documenti per id o filtro](https://docs.conare.ai/it/api-reference/documents/delete-documents-by-id-or-filter.md).


## Related topics

- [MCP](https://docs.conare.ai/it/mcp-server.md)
- [Sorgenti](https://docs.conare.ai/it/sources.md)
- [Namespace](https://docs.conare.ai/it/namespaces.md)
- [Scrivere documenti](https://docs.conare.ai/it/write.md)
- [Panoramica dell'API](https://docs.conare.ai/it/api.md)


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