Workspace
Revoke a named workspace key
Revokes one NAMED workspace key; it stops working on the next request. Owner or Admin (apikeys:rotate). Revoking a key that is already revoked also answers 200 with its original revokedAt. The primary key cannot be revoked (409 PRIMARY_KEY_NOT_REVOCABLE) — rotate it with POST /v1/api-keys/regenerate.
Requires an account key (ps_account_, created in Profile → API). Workspace keys, number keys and OAuth/MCP tokens get 403 ACCOUNT_KEY_REQUIRED. Sent with Cache-Control: no-store.
DELETE
/
v1
/
workspaces
/
{workspaceId}
/
api-keys
/
{keyId}
Revoke a named workspace key
curl --request DELETE \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}', 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://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cmh2ab7770004ak8example9m",
"revokedAt": "2026-10-28T12:00:00.000Z"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires an account API key (ps_account_…), created in Profile → API. Workspace keys, number keys and OAuth tokens cannot use it | Este endpoint exige uma API key de conta (ps_account_…), criada em Perfil → API. Chaves de workspace, de número e tokens OAuth não podem usá-lo",
"code": "ACCOUNT_KEY_REQUIRED"
}{
"error": "API key not found | API key não encontrada",
"code": "API_KEY_NOT_FOUND"
}{
"error": "The primary workspace key cannot be revoked; rotate it with POST /v1/api-keys/regenerate | A chave principal do workspace não pode ser revogada; gere uma nova com POST /v1/api-keys/regenerate",
"code": "PRIMARY_KEY_NOT_REVOCABLE"
}Was this page helpful?
⌘I
Revoke a named workspace key
curl --request DELETE \
--url https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId} \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}', 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://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/workspaces/{workspaceId}/api-keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cmh2ab7770004ak8example9m",
"revokedAt": "2026-10-28T12:00:00.000Z"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires an account API key (ps_account_…), created in Profile → API. Workspace keys, number keys and OAuth tokens cannot use it | Este endpoint exige uma API key de conta (ps_account_…), criada em Perfil → API. Chaves de workspace, de número e tokens OAuth não podem usá-lo",
"code": "ACCOUNT_KEY_REQUIRED"
}{
"error": "API key not found | API key não encontrada",
"code": "API_KEY_NOT_FOUND"
}{
"error": "The primary workspace key cannot be revoked; rotate it with POST /v1/api-keys/regenerate | A chave principal do workspace não pode ser revogada; gere uma nova com POST /v1/api-keys/regenerate",
"code": "PRIMARY_KEY_NOT_REVOCABLE"
}