Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

Delete a workspace

Delete an existing workspace. Deletion is asynchronous: the workspace transitions to the Terminating state and its contexts are deleted, after which the workspace itself is removed.

DELETE /workspaces/{workspace_name}

cURL
curl --request DELETE \
  --url https://api.pinecone.io/workspaces/{workspace_name} \
  --header 'Api-Key: <api-key>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>'
Python
import requests

url = "https://api.pinecone.io/workspaces/{workspace_name}"

headers = {
    "Api-Key": "<api-key>",
    "X-Pinecone-Api-Version": "<x-pinecone-api-version>"
}

response = requests.delete(url, headers=headers)

print(response.text)
JavaScript
const options = {method: "DELETE", headers: {"Api-Key": "<api-key>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>"}};

fetch("https://api.pinecone.io/workspaces/{workspace_name}", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.pinecone.io/workspaces/{workspace_name}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "Api-Key: <api-key>",
    "X-Pinecone-Api-Version: <x-pinecone-api-version>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
Go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinecone.io/workspaces/{workspace_name}"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Api-Key", "<api-key>")
	req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
Java
HttpResponse<String> response = Unirest.delete("https://api.pinecone.io/workspaces/{workspace_name}")
  .header("Api-Key", "<api-key>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .asString();
Ruby
require 'uri'
require 'net/http'

url = URI("https://api.pinecone.io/workspaces/{workspace_name}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Api-Key"] = '<api-key>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'

response = http.request(request)
puts response.read_body
401
{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "Invalid API key."
  },
  "status": 401
}
403
{
  "error": {
    "code": "FORBIDDEN",
    "message": "This project has reached its workspace limit. Delete an existing workspace or contact support to raise the limit."
  },
  "status": 403
}
404
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Workspace example-workspace not found."
  },
  "status": 404
}
500
{
  "error": {
    "code": "UNKNOWN",
    "message": "Internal server error"
  },
  "status": 500
}
Api-Keystringrequired

An API Key is required to call Pinecone APIs. Get yours from the console.

X-Pinecone-Api-Versionstringrequired

Required date-based version header

Typestring
Default2026-07
workspace_namestringrequired

The name of the workspace to delete.

Required string length: 1 - 45. Example: example-workspace

Typestring

202 — The request to delete the workspace has been accepted.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu