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 through the /v1/collections/[collection_name] path.

Collections > Create a collection

The process of creating collections in Tallyfy Answers involves specifying a unique name through a POST request which automatically detects data types and returns collection details upon successful creation.

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.

Collections > Delete a collection

A DELETE endpoint permanently removes collections and their objects through HTTP requests while providing status codes and best practices for safely managing irreversible data deletion operations.