/admin/projects/{project_id}/api-keysCreate an API keyCreate an API key for a project to authenticate Data Plane and Control Plane requests.
Parameters
X-Pinecone-Api-VersionstringheaderrequiredRequired date-based version header
project_idstring · uuidpathrequiredProject ID
Request body
requiredThe details of the new API key.
application/json
namestringrequiredThe name of the API key. The name must be 1-80 characters long.
rolesarray of stringThe roles to create the API key with. Default is `["ProjectEditor"]`.
Show child attributes
{
"name": "devkey",
"roles": [
"ProjectEditor"
]
}Responses
The details of an API key, including the secret. Only returned on API key creation.
keyobjectrequiredThe details of an API key, without the secret.
Show child attributes
idstring · uuidrequiredThe unique ID of the API key.
namestringrequiredThe name of the API key.
project_idstring · uuidrequiredThe ID of the project containing the API key.
rolesarray of stringrequiredThe roles assigned to the API key.
Show child attributes
valuestringrequiredThe value to use as an API key. New keys will have the format `"pckey_<public-label>_<unique-key>"`. The entire string should be used when authenticating.
{
"key": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"project_id": "00000000-0000-0000-0000-000000000000",
"roles": [
"ProjectEditor"
]
},
"value": "string"
}The response shape used for all error responses.
errorobjectrequiredDetailed information about the error that occurred.
Show child attributes
codestringrequiredThe error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
detailsobjectAdditional information about the error. This field is not guaranteed to be present.
messagestringrequiredstatusintegerrequiredThe HTTP status code of the error.
{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Bad request. The request body included invalid request parameters."
},
"status": 400
}The response shape used for all error responses.
errorobjectrequiredDetailed information about the error that occurred.
Show child attributes
codestringrequiredThe error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
detailsobjectAdditional information about the error. This field is not guaranteed to be present.
messagestringrequiredstatusintegerrequiredThe HTTP status code of the error.
{
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid API key."
},
"status": 401
}The response shape used for all error responses.
errorobjectrequiredDetailed information about the error that occurred.
Show child attributes
codestringrequiredThe error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
detailsobjectAdditional information about the error. This field is not guaranteed to be present.
messagestringrequiredstatusintegerrequiredThe HTTP status code of the error.
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}The response shape used for all error responses.
errorobjectrequiredDetailed information about the error that occurred.
Show child attributes
codestringrequiredThe error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
detailsobjectAdditional information about the error. This field is not guaranteed to be present.
messagestringrequiredstatusintegerrequiredThe HTTP status code of the error.
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}The response shape used for all error responses.
errorobjectrequiredDetailed information about the error that occurred.
Show child attributes
codestringrequiredThe error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`.
detailsobjectAdditional information about the error. This field is not guaranteed to be present.
messagestringrequiredstatusintegerrequiredThe HTTP status code of the error.
{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}