Skip to content

Index a single object

Indexing individual objects

This endpoint allows you to add a single object to a specific collection in Tallyfy Answers. Use this method when you need to index objects in response to real-time events or user actions in your application.

When to use this endpoint

This endpoint is ideal for:

  • Adding individual records as they’re created
  • Updating existing objects with new information
  • Testing your integration with Tallyfy Answers
  • Low-volume indexing operations

For high-volume operations, the import objects endpoint offers significantly better performance.

API endpoint

POST /v1/collections/{collection_name}/objects

Request parameters

ParameterTypeRequiredDescription
collection_namepathYesName of the collection where the object will be indexed

Request body

The request body should contain a JSON object with the data you want to index. For example:

{
"id": "product-123",
"name": "Wireless Headphones",
"description": "Premium noise-canceling headphones with 20-hour battery life",
"price": 79.99,
"categories": ["electronics", "audio", "wireless"]
}

Response

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

{
"id": "product-123",
"status": "success"
}

Error scenarios

StatusDescription
400Malformed request or invalid object format
404Collection not found
409Object ID conflict (when using custom IDs)
413Object size too large

Example request

Terminal window
curl -X POST https://go.tallyfy.com/api/collections/products/objects \
-H "X-Answers-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"id": "product-123",
"name": "Wireless Headphones",
"price": 79.99,
"categories": ["electronics", "audio"]
}'

Performance considerations

For indexing multiple objects, consider using the bulk import endpoint instead of making multiple individual requests. The bulk endpoint is optimized for higher throughput and will significantly reduce API request overhead.

Objects > Index multiple objects

This endpoint enables efficient bulk indexing of multiple objects into Tallyfy Answers collections using JSONLines format which significantly outperforms individual object creation requests for large datasets.

Collections > Create a collection

Creating collections in Tallyfy Answers requires using a POST API endpoint with a unique collection name and optional description where the system automatically detects data types as objects are indexed.

Objects > Get an object

The Tallyfy Answers API provides a GET endpoint that retrieves individual objects from collections using their unique identifier and returns complete object data with all properties including system-generated timestamps.

Answers > Objects

Objects in Tallyfy Answers are fundamental JSON-formatted data records that belong to collections and can be indexed retrieved and searched with flexible schemas that automatically detect properties and support both custom and auto-generated unique identifiers.