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

# Lister les documents et leur statut

Renvoie le tableau des documents de l’agent, depuis son RAG interne ou son Vector Store, triés du plus récent au plus ancien (résultats **paginés**). À utiliser pour suivre l’ingestion (`status` passe de `PENDING` → `PROCESSING` → `READY`, ou `FAILED`).

## Paramètres

<ParamField path="agentUUID" type="string" required>
  UUID de l’agent. Il doit appartenir à la société propriétaire du token.
</ParamField>

<ParamField query="externalId" type="string">
  Ne renvoyer que le document portant cet identifiant externe.
</ParamField>

<ParamField query="status" type="string">
  Filtrer par statut : `PENDING`, `PROCESSING`, `READY` ou `FAILED`.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  Taille de page. Défaut **100**, plafonné à **200**.
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Décalage pour la pagination (défaut 0). Combinez avec `limit` pour parcourir
  tout.
</ParamField>

## Réponses

| Code | Corps JSON |
| - | - |
| 200 | Tableau des documents (voir l’exemple de réponse) |
| 400 | `status`, `limit` ou `offset` invalide |
| 401 | `{ "error": "Provide Auth via Authorization with \"Bearer YOUR_MOUSTACHE_AI_API_TOKEN\"" }` |
| 404 | `{ "error": "Agent not found for your company" }` |
| 429 | `{ "error": "Rate limit exceeded" }` (en-tête `Retry-After`) |
| 500 | `{ "error": "Failed to list RAG resources" }` |

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://api.moustacheai.com/api/v1/agents/28ce3b2d-5791-4905-8d66-123456789abc/rag-resources?externalId=notion-page-42' \
    -H "Authorization: Bearer MON_API_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "id": 123,
      "external_id": "notion-page-42",
      "file_name": "guide.pdf",
      "file_type": "application/pdf",
      "file_size_bytes": 20480,
      "status": "READY",
      "chunk_count": 18,
      "error_message": null,
      "created_at": "2026-06-18T09:00:00.000Z",
      "updated_at": "2026-06-18T09:01:12.000Z"
    }
  ]
  ```
</ResponseExample>


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