Collections > Create a collection
Authentication
Authentication with Tallyfy Answers
Section titled “Authentication with Tallyfy Answers”Send the API key Tallyfy gave you in the Authorization header. Managing collections and objects, batch import, recommendations and tasks need the key.
Search doesn’t need it, and neither do the routes for featured objects, per-source object counts and AI overview status. So a search box in a browser can call Tallyfy Answers without exposing your key.
Required API key header
Section titled “Required API key header”Add the following header to every Tallyfy Answers API request that needs the key:
Authorization: Bearer your_api_keyReplace your_api_key with the API key Tallyfy gave you. The service compares the whole header value with its key, so keep the word Bearer and the single space before the key.
Obtaining a Tallyfy Answers API key
Section titled “Obtaining a Tallyfy Answers API key”Tallyfy issues your key when you’re onboarded. There’s no screen or endpoint that creates keys, so contact Tallyfy for it.
API key security best practices
Section titled “API key security best practices”- Don’t share your Tallyfy API key in public repositories or client-side code
- Store your API key in environment variables or secure configuration files
- Ask Tallyfy to rotate the key if you suspect it’s been compromised
Example authenticated request
Section titled “Example authenticated request”curl -X GET https://answers.tallyfy.com/collections/mycollection \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json"Troubleshooting authentication errors
Section titled “Troubleshooting authentication errors”If you receive a 403 Forbidden response with the body {"error": "Forbidden"}, check that:
- You’re using the API key Tallyfy gave you
- You’ve included the
Authorization: Bearerheader, with one space before the key
A 400 that says the collection name is invalid comes before the key check. It means the name in the URL has characters other than lowercase letters and digits.
Related articles
Section titled “Related articles”Objects > Index multiple objects