# List Documents In Collection

GET https://api.credal.ai/api/v0/documentCollections/listDocumentsInCollection

List documents in a collection

Reference: https://docs.credal.ai/api-reference/api-reference/document-collections/list-documents-in-collection

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `collectionId` (UUID, required) — The ID of the document collection to list documents from.

## Response

### 200

- `resourceIdentifiers` (list of ResourceIdentifier, required)

## Types

### ResourceIdentifier

- `type`: `external-resource-id`
  - `externalResourceId` (string, required)
  - `resourceType` (enum, required)
    - Allowed values: `GOOGLE_DRIVE_ITEM`, `MICROSOFT_DRIVE_ITEM`, `ZENDESK_TICKET`, `ZENDESK_ARTICLE`, `ZENDESK_GROUP`, `ZENDESK_ARTICLE_SECTION`, `ZENDESK_ARTICLE_CATEGORY`, `CONFLUENCE_PAGE`, `CONFLUENCE_SPACE`, `JIRA_TICKET`, `JIRA_PROJECT`, `SALESFORCE_TASK`, `BOX_FILE`, `BOX_FOLDER`, `NOTION_PAGE`, `NOTION_DATABASE`, `SLACK_CHANNEL`, `MONGO_COLLECTION_SYNC`, `UNKNOWN`
- `type`: `url`
  - `url` (string, required)

## Examples

**Response**

```json
{
  "resourceIdentifiers": [
    {
      "type": "external-resource-id",
      "externalResourceId": "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
      "resourceType": "GOOGLE_DRIVE_ITEM"
    },
    {
      "type": "external-resource-id",
      "externalResourceId": "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
      "resourceType": "GOOGLE_DRIVE_ITEM"
    }
  ]
}
```

**SDK Code**

```typescript listDocumentsInCollectionExample
import { CredalClient } from "@credal/sdk";

async function main() {
    const client = new CredalClient({
        apiKey: "YOUR_TOKEN_HERE",
    });
    await client.documentCollections.listDocumentsInCollection({
        collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
    });
}
main();

```

```python listDocumentsInCollectionExample
from credal import CredalV0
import uuid

client = CredalV0(
    api_key="YOUR_TOKEN_HERE",
)

client.document_collections.list_documents_in_collection(
    collection_id=uuid.UUID("82e4b12a-6990-45d4-8ebd-85c00e030c24"),
)

```

## Related pages

- [Search Document Collection](./api-reference-2-api-reference-search-search-document-collection.md)
- [Add Documents To Collection](./api-reference-2-api-reference-document-collections-add-documents-to-collection.md)
- [Remove Documents From Collection](./api-reference-2-api-reference-document-collections-remove-documents-from-collection.md)
- [Create Collection](./api-reference-2-api-reference-document-collections-create-collection.md)
- [Delete Collection](./api-reference-2-api-reference-document-collections-delete-collection.md)
- [Create Mongo Collection Sync](./api-reference-2-api-reference-document-collections-create-mongo-collection-sync.md)
- [Update Mongo Collection Sync](./api-reference-2-api-reference-document-collections-update-mongo-collection-sync.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
