Skip to content

Update a collection

Updating collection properties

This endpoint allows you to modify certain properties of an existing collection in Tallyfy Answers, such as its description or configuration settings. The collection name can’t be changed once it’s created.

API endpoint

PATCH /v1/collections/{collection_name}

Path parameters

ParameterTypeRequiredDescription
collection_namestringYesName of the collection to update

Request body

The request body should contain a JSON object with the properties you want to update:

ParameterTypeRequiredDescription
descriptionstringNoNew description for the collection

Example request body:

{
"description": "Updated collection of premium electronics products"
}

Response

A successful update returns a 200 OK status code and a JSON response containing the updated collection:

{
"name": "products",
"description": "Updated collection of premium electronics products",
"schema": {
"name": {
"type": "string"
},
"price": {
"type": "number"
},
"categories": {
"type": "string[]"
}
},
"created_at": "2023-08-15T14:32:21Z",
"updated_at": "2023-09-05T10:15:42Z"
}

Error scenarios

StatusDescription
404Collection not found
400Invalid request format or parameters

Example request

Terminal window
curl -X PATCH https://go.tallyfy.com/api/collections/products \
-H "X-Answers-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated collection of premium electronics products"
}'

Common update scenarios

Updating a collection is useful in several situations:

  • Improving documentation: Add or update the description to better explain the collection’s purpose
  • Adjusting configurations: Modify search settings or other configuration parameters
  • Refining metadata: Update metadata fields to provide better context for the collection

Limitations

  • The collection name can’t be changed after creation
  • Schema changes happen automatically as objects are indexed1, not through this endpoint
  • Certain system-level properties can’t be modified

Best practices

  • Make incremental updates to avoid disrupting existing processes
  • Use descriptive descriptions to help users understand the collection’s purpose
  • Document changes to collection properties for future reference

Answers > Collections

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

Footnotes

  1. Tallyfy auto-detects data types (string, number, array) when new objects are added to collections