For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
API StudioContact Support
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • API Reference
      • GETList Collections
      • PUTCreate Collection
      • DELDelete Collection
      • PATCHChange Collection Environment
      • GETList Documents
      • DELWipe Collection Documents
      • DELDelete Document
LogoLogo
API StudioContact Support
API Referencecollections

List Collections

GET
https://api.runcaptain.com/v2/collections
GET
/v2/collections
1import requests
2import json
3
4BASE_URL = "https://api.runcaptain.com"
5API_KEY = "your_api_key"
6
7headers = {
8 "Authorization": f"Bearer {API_KEY}",
9}
10
11response = requests.get(
12 f"{BASE_URL}/v2/collections",
13 headers=headers,
14 timeout=30.0
15)
16
17if response.status_code == 200:
18 data = response.json()
19 collections = data.get("collections", [])
20 print(f"Total collections: {len(collections)}")
21 for col in collections:
22 name = col.get("database_name", "Unknown")
23 count = col.get("file_count", 0)
24 print(f" {name} ({count} files)")
25else:
26 print(f"Error: {response.status_code}")
27 print(response.text)
200Retrieved
1{
2 "collections": [
3 {
4 "database_name": "my-research-papers",
5 "file_count": 142,
6 "environment": "production",
7 "is_active": true,
8 "created_at": "2024-01-15T10:30:00Z",
9 "request_count": 1250,
10 "collection_id": "col_9f8e7d6c5b4a3",
11 "collection_name": "legal_contracts_2024",
12 "document_count": 42
13 }
14 ],
15 "total_count": 1,
16 "limit": 100,
17 "offset": 0
18}

List collections for an organization with pagination.

Returns a paginated array of collection objects. Use limit and offset query parameters to page through results. The total_count field in the response indicates the total number of collections available across all pages.

Was this page helpful?

Create Collection

Next
Built with

Authentication

AuthorizationBearer
Bearer token authentication using API key

Headers

X-Organization-IDstringOptional

Response

Successful Response
collectionslist of objects
List of collections
total_countinteger

Total number of collections across all pages (not just the current page)

limitinteger
Maximum number of collections per page
offsetinteger
Pagination offset