Skip to content

Get all collections

Listing all collections

This endpoint retrieves a summary of all collections in your Tallyfy Answers account. Collections are sorted by creation date in descending order1 (newest first), making it easy to find recently created collections.

API endpoint

GET /v1/collections

Query parameters

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

Response

A successful request returns 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 large numbers of 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

Collections > Get a collection

The Tallyfy Answers API provides a GET endpoint to retrieve detailed information about specific collections including metadata schema information and object counts using the collection’s unique name.

Answers > Collections

Collections in Tallyfy Answers are organizational structures that group similar objects together like database tables and provide features for searching filtering and managing data with automatic schema detection and complete CRUD operations.

Collections > Create a collection

To create collections in Tallyfy Answers you must first make a POST request to the /v1/collections endpoint with a unique collection name and optional description before adding any objects to the collection.

Objects > Get an object

The Tallyfy Answers API endpoint retrieves complete individual object data from collections using unique identifiers through a GET request that returns full object properties including system-generated timestamps.

Footnotes

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