Get a collection
Retrieving collection details
Section titled “Retrieving collection details”This endpoint returns the schema of a specific collection in Tallyfy Answers, found by its unique name. The schema lists the properties detected from the objects you’ve indexed. It doesn’t include an object count.
API endpoint
Section titled “API endpoint”GET /collections/{collection_name}This endpoint needs the API key.
Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
collection_name | string | Yes | Name of the collection to retrieve |
Response
Section titled “Response”On success, you’ll receive a 200 OK status code. message holds the collection’s class definition as Weaviate, the database behind Tallyfy Answers, returns it. The class name comes back title-cased, so products becomes Products, and each property carries a Weaviate data type. A shortened example:
{ "message": { "class": "Products", "properties": [ { "name": "uid", "dataType": ["text"] }, { "name": "title", "dataType": ["text"] } ] }, "status": 200}Weaviate adds more settings to the class definition than this example shows.
Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
message | object | The collection’s class definition from Weaviate, including its title-cased name and its properties |
status | number | 200 |
Error scenarios
Section titled “Error scenarios”| Status | Description |
|---|---|
| 404 | Collection not found |
| 400 | Invalid collection name format |
| 403 | The Authorization header is missing or doesn’t match the API key |
| 503 | The service couldn’t reach its database. Try again. |
Example request
Section titled “Example request”curl -X GET https://answers.tallyfy.com/collections/products \ -H "Authorization: Bearer your_api_key"Common uses
Section titled “Common uses”- Checking a collection’s current schema
- Retrieving collection details before performing operations
- Confirming a collection exists before adding objects
To count the objects in a collection, use GET /collections/{collection_name}/objects/metadata instead. It needs no key and returns a count per source. It answers [] for a collection that doesn’t exist, the same as for an empty one.
Related articles
Section titled “Related articles”Collections > Create a collection
Collections > Delete a collection