#community-help

Assigning an API Key for Backend Indexing Operations

TLDR Ross inquired about assigning an API key for backend service. After some confusion, Jason clarified that the documents:upsert, documents:update, documents:create, and documents:delete actions were necessary for document-only operations.

Powered by Struct AI

1

1

Nov 28, 2022 (13 months ago)
Ross
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Ross
08:53 PM
What would be the best actions to assign an API key intended for a backend service responsible for indexing operations to existing collections (i.e. only document delete/upsert, not collection creation). Document-only operations including upsert.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:37 PM
documents:write should be the only permission you need for this
Ross
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Ross
09:39 PM
Thank you Jason 🙂 I was looking at v23 docs, looks like v23.1 is where they got added to the actions table :man-facepalming:
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:40 PM
Yeah pre 0.23.1 we left it a little open and only listed a few example actions, but after getting a couple of similar questions I just added all the list of actions to the latest docs, last week
Nov 29, 2022 (13 months ago)
Ross
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Ross
04:15 PM
Follow-up here but i noticed write is not an action listed in the docs -- did you mean create?

> where verb can be one of create, delete, get, list, search, or *
https://typesense.org/docs/0.23.1/api/api-keys.html#sample-actions
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:17 PM
Oh wait, my bad. Typo in my Slack message
04:17
Jason
04:17 PM
There is no write action :man-facepalming:
04:17
Jason
04:17 PM
documents:create is what you’re looking for
Ross
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Ross
04:17 PM
create implies update/upsert as well? gotcha. Thank you!
07:11
Ross
07:11 PM
Jason FYI still having a hard time here. Getting 401 responses when trying to .update() with a key that has documents:create. Switching to an admin key with * allows the .update() to go through
07:12
Ross
07:12 PM
I can share our Cloud cluster details in a DM if that helps
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:16 PM
Could you try documents:upsert, documents:update, documents:create, documents:delete as the actions?
Ross
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Ross
07:18 PM
confirmed working with that actions list 👍
07:19
Ross
07:19 PM
so it's a 1:1 mapping between key actions and API verbs 👌 thanks for the help again

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:19 PM
Sorry about that, my previous responses were based on what I remembered off the top of my head. Now I looked at the code to double-confirm! It’s been so long since we came up with these :)

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

API Key Permissions for Typesense Docsearch Scraper

JP asked about configuring API key actions for reindexing a site using Typesense. Kishore Nallan clarified the required permission. Then, JP and Jason discussed specific permission configurations, and JP made a documentation update to illustrate their findings.

3

13
11mo

Correct API Key Generation and Usage on Cloud

Tom faced 401 errors while creating keys via the Cloud API. Kishore Nallan clarified the correct syntax and mechanics, and identified a header mislabeling on Tom's part that caused the issue. They also discussed using scoped API keys.

3

31
14mo

Handling Kinesis Stream Event Batching with Typesense

Dui had questions about how to handle Kinesis stream events with Typesense. Kishore Nallan suggested using upsert mode for creation/update and differentiating with logical deletion. After various discussions including identifying and resolving a bug, they finalized to introduce an `emplace` action in Typesense v0.23.

8

91
24mo

Issue with Embedding Error in Version 0.25.0.rc63

Bill reported a bug in version 0.25.0.rc63 regarding a problem with updating or emplacing a document and receiving an embedding error. This was resolved in version 0.25.0.rc65, but further discussion ensued regarding the function of 'index' in the update feature.

5

63
4mo

Resolving Issues with Scoped API Keys in Typesense with Golang

Suvarna had problems with generating and using scoped API keys in Typesense with Golang. Several bugs misleading the user were found and fixed by Kishore Nallan.

6

158
28mo