Security
API key management
API Keys enable controlled, anonymous access to several administrative tasks, indexing your data, and running semantic searches on your corpora—handy for platform admins setting up systems or app developers integrating public-facing websites. This greatly simplifies integration from public-facing systems like websites.
Assigning the wrong permissions, or using a key incorrectly, can result in errors or expose your system to unnecessary risk. If a key is compromised, you can quickly revoke the key and replace it in minutes.
If you create a new corpus, generate a new API key to access its data. You will not be able to access it with existing API keys. Existing keys are bound to their original corpus.
This guide helps you:
- Assign the right API and resource permissions for your use case
- Avoid permission errors tied to scoping or misuse
- Secure your credentials properly
Prerequisites
- Access to the Vectara Console
- Have at least one corpus
- Admin or Indexing privileges on the corpus
API key permissions and recommended usage
Create a personal API key with api_key_role: personal. For scoped API keys,
assign the required customer-level api_roles, corpus-specific corpus_roles,
and agent-specific agent_roles. The legacy api_key_role values serving and
serving_and_indexing are deprecated for creating keys.
| API key configuration | Allowed operations | Scope | Recommended usage |
|---|---|---|---|
| Personal API key | Inherits the creating user's permissions | The resources available to that user | Development, testing, and administrative work performed as that user |
| API key with query permissions | Operations granted by its assigned query roles | Resources named by its role assignments | Applications that only need query access |
| API key with indexing and query permissions | Operations granted by its assigned indexing and query roles | Resources named by its role assignments | Protected backend ingestion and query workloads |
Best practices
- ✅ Use unique keys per use case or microservice
- ✅ Apply the principle of least privilege by assigning the minimal set of permissions needed to accomplish your goal
- 🔄 Rotate API keys periodically and revoke unused ones