> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# List knowledge documents

GET https://api.jelliu.co/api/agents/{agentId}/knowledge

Returns the agent's knowledge documents (deleted ones excluded), newest first by
`created_at`. Use it to show what an agent knows and to poll indexing progress after
`POST /api/agents/{agentId}/knowledge`: a document moves from `processing` to `ready`
(or `failed`) without any further call from you.

Offset pagination with `limit` and `offset`. The response carries no pagination metadata:
request the next page until one comes back with fewer than `limit` items. See
[Pagination](/pagination).

**Consistency.** Pages are cached for up to 5 minutes, but uploads and deletes clear every
cached page of the agent before they respond, and the background indexer clears them when a
status changes, so a document you just uploaded is visible on the next read.

**Idempotency.** Read-only and safe to retry.

**Access**

* **Required scope:** `read` (or `write`). Any workspace role.
* **Rate limit:** General API — 120 (Starter), 200 (Growth), 300 (Business) or 600 (Enterprise) requests/min per workspace. See [Rate limits](/rate-limits).
* **Plan:** Available on every plan.

Reference: https://developer.jelliu.co/api-reference/knowledge/get-agents-by-agent-id-knowledge

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Path parameters

- `agentId` (string, required) — UUID of the agent. It must belong to the authenticated workspace; an id from another workspace answers `404`, exactly like an unknown one. Returned as `id` by `GET /api/agents`.

### Query parameters

- `limit` (integer, optional, default: 50) — Maximum number of documents to return (1–100). Non-integer or out-of-range values are rejected with 400; they are not clamped.
- `offset` (integer, optional, default: 0) — Number of documents to skip (0–100000). Out-of-range values are rejected with 400.

## Response

### 200

The agent's documents, newest first.

- `data` (list of object, required)
  - `id` (string, optional) — Unique identifier of the document.
  - `agent_id` (string, optional) — The agent the document belongs to.
  - `name` (string, optional) — The uploaded file name, sanitized (path components and NUL bytes removed, at most 255 characters).
  - `size` (integer, optional) — File size in bytes. Counts toward the plan's total knowledge size.
  - `status` (enum, optional) — Summary status derived from indexing: `processing` (index pending or in progress), `ready` (indexed, or permanently not indexable such as `document_too_small`, in which case the agent still reads the whole document) or `failed` (retryable indexing failure).
    - Allowed values: `processing`, `ready`, `failed`
  - `rag_index_status` (enum, optional) — Raw retrieval-index state reported by the voice engine — `pending`, `processing`, `succeeded` or `failed`.
    - Allowed values: `pending`, `processing`, `succeeded`, `failed`
  - `rag_index_error` (string, optional, nullable) — Why indexing failed, `null` otherwise. `document_too_small`, `rag_limit_exceeded` and `cannot_index_folder` are permanent (the document then reports `status: ready`); any other text is a provider error that will be retried.
  - `created_at` (datetime, optional) — When the document was uploaded.
  - `updated_at` (datetime, optional) — Last change to the document row.

## Errors

### 400 Bad Request Error

`agentId` is not a UUID (no `details`), or `limit`/`offset` is invalid (field issues in `details`, with `path` as a dot-joined string).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

The API key has neither `read` nor `write`, or the workspace is suspended.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 404 Not Found Error

The agent does not exist in this workspace.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

General API rate limit exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "5c4b3a29-1807-4f6e-9d5c-4b3a29180716",
      "agent_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "name": "lista-de-precios-septiembre-2026.pdf",
      "size": 482113,
      "status": "processing",
      "rag_index_status": "processing",
      "rag_index_error": null,
      "created_at": "2026-09-14T15:04:05.000Z",
      "updated_at": "2026-09-14T15:04:06.000Z"
    },
    {
      "id": "81d2e6f0-3b7a-4c19-a5e8-2f6d90c4b173",
      "agent_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "name": "preguntas-frecuentes.md",
      "size": 18342,
      "status": "ready",
      "rag_index_status": "succeeded",
      "rag_index_error": null,
      "created_at": "2026-09-10T11:20:31.000Z",
      "updated_at": "2026-09-10T11:20:44.000Z"
    },
    {
      "id": "c3a91f57-0d6e-4b28-9e14-7a5b2c8d6e09",
      "agent_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "name": "horario.txt",
      "size": 212,
      "status": "ready",
      "rag_index_status": "failed",
      "rag_index_error": "document_too_small",
      "created_at": "2026-09-02T09:12:00.000Z",
      "updated_at": "2026-09-02T09:12:03.000Z"
    }
  ]
}
```

**SDK Code**

```python Knowledge_getAgentsByAgentIdKnowledge_example
import requests

url = "https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge"

querystring = {"limit":"50","offset":"0"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Knowledge_getAgentsByAgentIdKnowledge_example
const url = 'https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Knowledge_getAgentsByAgentIdKnowledge_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Knowledge_getAgentsByAgentIdKnowledge_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Knowledge_getAgentsByAgentIdKnowledge_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Knowledge_getAgentsByAgentIdKnowledge_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Knowledge_getAgentsByAgentIdKnowledge_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Knowledge_getAgentsByAgentIdKnowledge_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/agents/2f2d8b4d-aa6f-41e0-9d3e-4d61e1b07a11/knowledge?limit=50&offset=0")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```