---
docId: doc_6a0d40cc665548e8a86c6cdacc4d62ff
title: List agent files
description: "Lists an agent’s files with each connection’s state and schedule."
api:
  group: agentes/archivos
  auth: bearer
  operations:
    - operationId: listAgentFiles
      method: GET
      path: '/v1/agents/{agentId}/files'
      postmanName: List agent files
---

<script>
  import { Ways } from '$lib/components';
</script>

# List agent files

Check which files an agent uses and which are paused or scheduled. Each result includes a file summary in `file` and its connection in `link`. You only need permission to read the agent.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/agents/$AGENT_ID/files?state=active" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.files.list("agent_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |

## Query parameters

| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| `state` | string | Only connections that are `active` or `paused` | (all) |
| `fileId` | string | Only the connection with that file | - |
| `limit` | integer | From 1 to 200 | `50` |
| `pageToken` | string | `nextPageToken` from the previous page | - |

## Response

```json
{
  "status": "success",
  "data": [
    {
      "link": {
        "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
        "fileId": "fH3kL9mQ2xR7",
        "state": "active",
        "attachedAt": "2026-10-30T16:02:11.000Z",
        "activateOnReady": false,
        "schedule": {
          "activateAt": null,
          "pauseAt": "2026-12-01T06:00:00.000Z",
          "last": null
        }
      },
      "file": {
        "fileId": "fH3kL9mQ2xR7",
        "title": "Return policy",
        "description": "Deadlines, conditions and exceptions for returning a product.",
        "kind": "url",
        "lifecycle": "available",
        "activeVersionId": "vr_2Lp9Qs",
        "pipelineStatus": "ready",
        "latestUploadId": "up_4Tn8Vb2Kc1",
        "hasUsableContent": true,
        "sourceUrl": "https://acme.com/policies/returns",
        "refresh": {
          "intervalHours": 24,
          "nextRunAt": "2026-11-02T10:12:45.000Z",
          "lastRunAt": "2026-11-01T10:12:45.000Z",
          "lastResult": "unchanged",
          "lastError": null
        }
      }
    }
  ],
  "nextPageToken": null
}
```

## Response fields

Each item in `data` carries the connection in `link` and a summary of the file in `file`. `nextPageToken` is `null` on the last page.

### Connection fields (`link`)

| Field | Type | Description |
|-------|------|-------------|
| `agentId`, `fileId` | string | The agent and the file. |
| `state` | string | `active` (the agent uses it) or `paused` (it doesn't use it, but it stays connected). |
| `attachedAt` | string | When it was connected. |
| `activateOnReady` | boolean | `true` while the connection waits for ready content before activating automatically. It is always `false` for an active connection. |
| `schedule` | object \| null | This agent’s activation and pause schedule; `null` if no schedule has ever been set. |
| `schedule.activateAt` | string \| null | When it will activate on its own. `null` if nothing is pending. |
| `schedule.pauseAt` | string \| null | When it will pause on its own. |
| `schedule.last` | object \| null | The last thing that was applied: `action` (`activate` or `pause`), `ranAt`, `outcome` (`applied` or `failed`) and `message` (why it failed). |

### File fields (`file`)

A summary of the file: `fileId`, `title`, `description`, `kind`, `lifecycle`, `activeVersionId`, `pipelineStatus`, `latestUploadId`, `sourceUrl` and `refresh`, as in [Get a file](/api-reference/files/get#response-fields), plus:

| Field | Type | Description |
|-------|------|-------------|
| `hasUsableContent` | boolean | It has content ready. Without it, the agent doesn't use it even if the connection is active. |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_INPUT` | A parameter isn't valid. `details.fields` names it. |
| `403` | `RESOURCE_NOT_ACCESSIBLE` | You can't read the agent. |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist or belongs to another workspace. |
| `409` | `KNOWLEDGE_NOT_ENABLED` | Files aren't enabled in this workspace. |

The ones that apply to all operations are in [common errors](/api-reference/files#common-errors).

## Notes

- Files live in the workspace and are connected to the agents that use them. They are created with [Create a file](/api-reference/files/create) or [Upload a file](/api-reference/files/upload); the [workspace list](/api-reference/files/list) carries all of them, with their `fileId`.
- Connecting, pausing, resuming, scheduling or disconnecting a file **applies immediately, without publishing**, and doesn't create a version of the agent. The agent only uses active connections.
- A connected file can serve several agents: changing its content or name changes it in all of them. Pausing, resuming, scheduling or disconnecting it only touches this agent.
- The agent uses a file when the connection is `active` **and** the file has content ready.
- To connect a file, use [Connect a file](/api-reference/agents/files/connect). From an AI agent, the tool is [`list_agent_files`](/mcp/tools#files).
