Delete workspace API key
Revoke and delete the workspace's API key. The key is immediately invalidated and can no longer be used for authentication. Returns 404 if no key exists.
Requires a platform API key (sk_user_...). Workspace keys are rejected with 403. Only owners and admins can manage API keys.
curl -X DELETE "https://api.sendkit.ai/v1/workspaces/example_string/api-key" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY"
import requests
import json
url = "https://api.sendkit.ai/v1/workspaces/example_string/api-key"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/workspaces/example_string/api-key", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.sendkit.ai/v1/workspaces/example_string/api-key", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.sendkit.ai/v1/workspaces/example_string/api-key')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"message": "API key deleted"
}
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
DELETE
/v1/workspaces/{workspaceId}/api-keyDELETE
API Key (header: X-Api-Key)
X-Api-Keystring
RequiredPlatform API key (sk_user_...) only. Workspace keys are rejected.
Platform API key (sk_user_...) only. Workspace keys are rejected.
path
workspaceIdstring
RequiredWorkspace ID
Request Preview
Response
Response will appear here after sending the request
Authentication
header
X-Api-Keystring
RequiredAPI Key for authentication. Platform API key (sk_user_...) only. Workspace keys are rejected.
Path Parameters
workspaceIdstring
RequiredWorkspace ID
Responses
successboolean
dataobject
messagestring
successboolean
errorobject
codestring
messagestring
successboolean
Allowed values:
falseerrorobject
codestring
messagestring
detailsobject[]
Was this page helpful?
Last updated today
Built with Documentation.AI