Skip to content

Create a collection

Creating collections

Before adding objects to Tallyfy Answers, you must first create a collection. Each collection requires a unique name, and the system will automatically detect the data types of your objects as you index them.

API endpoint

POST /v1/collections

Request body

The request body should contain a JSON object with the following properties:

ParameterTypeRequiredDescription
namestringYesUnique name for the collection (can include letters, numbers, hyphens, and underscores)
descriptionstringNoOptional description explaining the collection’s purpose

Example request body:

{
"name": "products",
"description": "Collection of product information including names, descriptions, and pricing"
}

Response

A successful request returns a 201 Created status code and a JSON response containing:

{
"name": "products",
"description": "Collection of product information including names, descriptions, and pricing",
"created_at": "2023-08-15T14:32:21Z"
}

Error scenarios

StatusDescription
400Invalid request format or collection name
409Collection name already exists

Example request

Terminal window
curl -X POST https://go.tallyfy.com/api/v1/collections \
-H "X-Answers-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "products",
"description": "Collection of product information"
}'

Supported data types

Tallyfy Answers automatically detects the following data types when you index objects:

Data TypeExampleDescription
string”Wireless Headphones”Text values that can be searched and filtered
list of strings[“electronics”, “audio”]Arrays of text values for multi-value fields

Collection naming best practices

  • Use lowercase letters, numbers, hyphens, and underscores
  • Choose descriptive names that reflect the content (e.g., “products”, “users”, “articles”)
  • Avoid spaces and special characters
  • Keep names concise but meaningful
  • Use consistent naming conventions across collections

Collections > Get a collection

The GET endpoint retrieves detailed collection information including metadata schema and object counts by using a unique collection name through the /v1/collections/[collection_name] path.

Collections > Get all collections

A paginated API endpoint that retrieves summaries of all collections sorted by creation date with support for limiting results and skipping records for efficient data browsing.

Answers > Objects

Objects in Tallyfy Answers serve as JSON-formatted data records with unique identifiers that can be flexibly structured indexed and searched within collections while supporting both custom and auto-generated IDs for efficient data management.

Answers > Collections

Collections in Tallyfy Answers serve as organizational containers that group similar objects together while enabling operations like searching filtering and managing data through dynamic schemas and efficient organization methods.