the API endpoint POST /v1/list-corpora returns a 401.
I have tried this with both an API key and OAUTH key and get the same “JWT Token failed to authenticate” message. I have used the API key successfully with the query gRPC so I know it is correct.
Am I missing something on my end or does my account need special permission to get this endpoint?
Just quickly (this is unrelated to the error you’re seeing) but Content-Typ should read Content-Type. Also, you’ll want to double check that you have a valid string for filter and pageKey in the payload object (or just drop these; they can be empty) and presumably you want some non-zero number for numResults as well.
In terms of authentication/authorization, as you note there are 2 types that Vectara supports: API key and OAuth. We haven’t enabled API key authentication for administrative actions (such as listing corpora), so for this particular API, you’ll need to use OAuth. When using OAuth tokens, you’ll need Authorization: Bearer <token>. The token you use there/that the OAuth service returns is a JWT token which should start with the characters ey if you look at it. e.g. your Authorization header should look something like Authorization: Bearer eyJ....
(If/when you use API keys for other APIs like adding content to a corpus or searching, you’ll want to drop the Authorization header entirely and instead have an x-api-key header.)