Create an API key
POST/v2/api_keys
An API key is to authenticate when calling Vectara APIs.
Request
Header Parameters
Possible values: >= 1
The API will make a best effort to complete the request in the specified seconds or time out.
Possible values: >= 1
The API will make a best effort to complete the request in the specified milliseconds or time out.
- application/json
Body
The human-readable name of the API key.
Possible values: [serving
, serving_and_indexing
, personal
]
Role of the API key. A serving API key can only perform query type requests on its corpora. A serving and indexing key can perform both indexing and query type requests on its corpora. A personal API key has all the same permissions as the creator of the API key.
Possible values: <= 50 characters
, Value must match regular expression [a-zA-Z0-9_\=\-]+$
Corpora this API key has roles on if it is not a Personal API key.
This property should be null or missing if this api_key_role
is
personal
.
Responses
- 201
- 400
- 403
An API key object, used to query the Vectara API with the assigned roles.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
Possible values: Value must match regular expression aky_.*
The ID of the API key.
The human-readable name of the API key.
The key used in API requests. The key should be kept secure.
If this API key is enabled.
Possible values: [serving
, serving_and_indexing
, personal
]
Role of the API key. A serving API key can only perform query type requests on its corpora. A serving and indexing key can perform both indexing and query type requests on its corpora. A personal API key has all the same permissions as the creator of the API key.
api_policy object
What actions a principal can take on the Vectara platform.
The name of the API role.
allowed_operations objectrequired
Operations that are allowed by the API role. Each operation may only allow certain resources that are described by a resource path to resource value map. If the value is null, then the operation is allowed on any resource.
property name* ApiOperationPolicy
Policy to allow operations if only using the specified resource.
Default value: true
If any resource is allowed for the operation.
allowed_resources object
Object with keys of resource paths to a list of allowed resources. A resource path starts with either body, path, or implicit. A body or path resource is within the operation body, and an implicit resource is a resource implied by the request.
property name* string[]
string
{
"id": "string",
"name": "string",
"secret_key": "string",
"enabled": true,
"api_key_role": "serving",
"api_policy": {
"name": "string",
"allowed_operations": {}
}
}
API key creation request was malformed.
- application/json
- Schema
- Example (from schema)
Schema
field_errors object
The errors that relate to specific fields in the request.
The ID of the request that can be used to help Vectara support debug what went wrong.
{
"field_errors": {},
"messages": [
"string"
],
"request_id": "string"
}
Permissions do not allow creating the API key.
- application/json
- Schema
- Example (from schema)
Schema
The messages describing why the error occurred.
The ID of the request that can be used to help Vectara support debug what went wrong.
{
"messages": [
"Internal server error."
],
"request_id": "string"
}