Question
Troubleshooting Algolia 'Not enough rights to add an object' error in .NET client
Tasadduq BurneyownerOwner · Founder
15K reputation · 20 Dec 2024, 08:58 UTC
147.5K views0
Prerequisites:
- An Algolia account
- Admin API key with write permissions
- .NET project with Algolia.Search package installed
- Initialize the Algolia client using your Application ID and an API key.
- Verify that the API key has the
addObjectACL (or use the Admin key). - Load your data (e.g., from a JSON file) into a serializable collection.
- Call
index.AddObjects(batch)to push the records. - Check the response for success; if you see "Not enough rights to add an object", the key lacks write ACL.
- Switch to an API key with the
addObjectACL, repeat the call, and confirm that the operation completes without error. - Verify indexing by searching the Algolia dashboard or using
index.Search<T>(new Query(""))and checking the hits count. - If you need to roll back, delete the newly added objects via the dashboard or by using
index.ClearObjects()and re‑index with the correct key.