REST APIs
While gRPC provides low latency and excellent scalability, REST APISs provide a more traditional and sometimes simpler integration path. REST is often the choice for web-based applications that do not require real-time communication.
API Formatting Guidelines
You can find all of our APIs at https://api.vectara.io/<version>/<api-endpoint>
The API endpoints are outlined in the various subsections of this API Reference
section. These endpoints are automatically derived from the protobuf definitions
and take the same parameters. At a high level, the api-endpoint
derives from
services.proto
specifically, and the API parameters are in other .proto
files.
The translation from the protobuf definitions to REST is:
- The only
version
currently available isv1
. api-endpoint
is lowercase and has hyphens. For example, the gRPC callCreateCorpus
in services.proto is/create-corpus
.- API parameters can be sent in either
camelCase
or lowercase withunderscores
.
For example, you could submit eithernumResults
ornum_results
in the Search API. - JSON responses are always returned in
camelCase
form.
API Authentication
All Vectara APIs are authenticated. Indexing and Search APIs can be authenticated via API Keys. However, Admin actions for creating and deleting corpora must be done via OAuth 2.0.
API Playground and OpenAPI Specifications
You can find up-to-date OpenAPI specifications at https://docs.vectara.com/vectara-oas.yaml. These REST API specifications are automatically derived from the gRPC protobuf definitions as well.
You can use these with tools of your choosing like Insomnia or Postman.
- Download the OpenAPI YAML file.
- Import the file into Insomonia or Postman.
- Start making API calls directly from the tool.
Want to try the REST APIs live in your browser? Head over to our our API Playground and make real-time API calls from your browser.