Skip to content

Update a collection

Updating collection properties

This endpoint allows you to modify certain properties of an existing collection, such as its description or configuration settings. The collection name cannot 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/v1/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

There are several situations where updating a collection is useful:

  • 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 cannot be changed after creation
  • Schema changes happen automatically as objects are indexed, not through this endpoint
  • Certain system-level properties cannot 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

Collections > Get a collection

The GET endpoint retrieves detailed collection information including metadata schema and object counts by using a unique collection name while returning a JSON response with appropriate status codes and error handling.

Collections > Create a collection

Collections must be created with unique names before adding objects to Tallyfy Answers which automatically detects data types like strings and string lists when indexing through a POST API endpoint.

Collections > Delete a collection

The DELETE endpoint permanently removes collections and their objects through a straightforward API call while offering best practices and alternatives to mitigate risks of irreversible data loss.

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.