Create a new project
Create a new project.
/admin/projectsCreate a new project
1 parameter
- X-Pinecone-Api-Versionstringheaderrequired
Required date-based version header
curl --request POST \
--url https://api.pinecone.io/admin/projects \
--header 'Authorization: Bearer <token>' \
--header 'X-Pinecone-Api-Version: <x-pinecone-api-version>' \
--header 'Content-Type: application/json' \
--data '{
"name": "chatbot-prod",
"max_pods": 123,
"force_encryption_with_cmek": true
}'import requests
url = "https://api.pinecone.io/admin/projects"
payload = {
"name": "chatbot-prod",
"max_pods": 123,
"force_encryption_with_cmek": True
}
headers = {
"Authorization": "Bearer <token>",
"X-Pinecone-Api-Version": "<x-pinecone-api-version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {method: "POST", headers: {"Authorization": "Bearer <token>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>", "Content-Type": "application/json"}, body: JSON.stringify({
"name": "chatbot-prod",
"max_pods": 123,
"force_encryption_with_cmek": true
})};
fetch("https://api.pinecone.io/admin/projects", options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pinecone.io/admin/projects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"name\":\"chatbot-prod\",\"max_pods\":123,\"force_encryption_with_cmek\":true}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Pinecone-Api-Version: <x-pinecone-api-version>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pinecone.io/admin/projects"
payload := strings.NewReader("{\"name\":\"chatbot-prod\",\"max_pods\":123,\"force_encryption_with_cmek\":true}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pinecone.io/admin/projects")
.header("Authorization", "Bearer <token>")
.header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
.header("Content-Type", "application/json")
.body("{\"name\":\"chatbot-prod\",\"max_pods\":123,\"force_encryption_with_cmek\":true}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pinecone.io/admin/projects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\"name\":\"chatbot-prod\",\"max_pods\":123,\"force_encryption_with_cmek\":true}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"max_pods": 123,
"force_encryption_with_cmek": true,
"organization_id": "<string>",
"created_at": "<string>"
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Bad request. The request body included invalid request parameters."
},
"status": 400
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid API key."
},
"status": 401
}{
"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
}{
"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
}{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}{
"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
}Authorizations
Section titled “Authorizations”AuthorizationstringrequiredAn access token must be provided in the Authorization header using the Bearer scheme.
Headers
Section titled “Headers”X-Pinecone-Api-VersionstringrequiredRequired date-based version header
The details of the new project.
namestringrequiredThe name of the new project.
Required string length: 1 - 512. Example: chatbot-prod
max_pods?integerThe maximum number of Pods that can be created in the project. Default is 0 (serverless only).
force_encryption_with_cmek?booleanWhether to force encryption with a customer-managed encryption key (CMEK). Default is false.
Response
Section titled “Response”200 — The project was successfully created.
The details of a project.
idstringrequiredThe unique ID of the project.
namestringrequiredThe name of the project.
Required string length: 1 - 512
max_podsintegerrequiredThe maximum number of Pods that can be created in the project.
force_encryption_with_cmekbooleanrequiredWhether to force encryption with a customer-managed encryption key (CMEK).
organization_idstringrequiredThe unique ID of the organization that the project belongs to.
created_at?stringThe date and time when the project was created.