Skip to content

Get all collections

Listing all collections

This endpoint retrieves a summary of all collections in your Tallyfy Answers account. It sorts collections by creation date in descending order1 (newest first), so you’ll find recently created ones at the top.

API endpoint

GET /v1/collections

Query parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo20Maximum number of collections to return (1-100)
offsetintegerNo0Number of collections to skip (for pagination)

Response

On success, you’ll receive a 200 OK status code and a JSON response containing:

{
"collections": [
{
"name": "products",
"description": "Collection of product information",
"object_count": 142,
"created_at": "2023-08-15T14:32:21Z"
},
{
"name": "customers",
"description": "Customer account information",
"object_count": 1253,
"created_at": "2023-07-28T09:15:33Z"
}
],
"meta": {
"total_collections": 5,
"limit": 20,
"offset": 0
}
}

Response fields

FieldTypeDescription
collectionsarrayList of collection summary objects
meta.total_collectionsintegerTotal number of collections in your account
meta.limitintegerLimit value used in the request
meta.offsetintegerOffset value used in the request

Error scenarios

StatusDescription
400Invalid query parameters

Example request

Terminal window
# Get first page of collections
curl -X GET https://go.tallyfy.com/api/collections \
-H "X-Answers-API-Key: your_api_key"
# Get second page with 10 collections per page
curl -X GET "https://go.tallyfy.com/api/collections?limit=10&offset=10" \
-H "X-Answers-API-Key: your_api_key"

Pagination

To paginate through many collections:

  1. Make an initial request with desired limit
  2. Check the meta.total_collections value to determine total pages
  3. Increase the offset parameter by the limit value for each subsequent page
  4. Continue until you’ve processed all collections

Example pagination calculation:

  • If you have 45 total collections with a limit of 10:
    • Page 1: offset=0, limit=10 (collections 1-10)
    • Page 2: offset=10, limit=10 (collections 11-20)
    • Page 3: offset=20, limit=10 (collections 21-30)
    • Page 4: offset=30, limit=10 (collections 31-40)
    • Page 5: offset=40, limit=10 (collections 41-45)

Usage scenarios

  • Displaying a list of collections in a management interface
  • Generating reports on collection usage
  • Performing operations across all collections
  • Finding collections by name when browsing

Answers > Collections

Collections in Tallyfy Answers group similar objects together, like database tables. They…

Objects > Get an object

Retrieve a specific object from a Tallyfy Answers collection using its unique identifier…

Footnotes

  1. Uses PostgreSQL’s JSONB indexing for efficient sorting even with large datasets