secret
Delete a secret
Deletes a secret and all of its environment values. The operation is logged in the audit trail. Cannot be undone. Recreate the secret to restore it.
DELETE
/
v1
/
workspace
/
{ws}
/
project
/
{prj}
/
secret
/
{secretId}
cURL
curl -X DELETE 'http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example' \
-H 'Authorization: Bearer ek_live_xxxxx'const response = await fetch('http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example', {
method: 'DELETE',
headers: {
Authorization: 'Bearer ek_live_xxxxx',
},
});
const data = await response.json();import requests
response = requests.delete(
'http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example',
headers={
'Authorization': 'Bearer ek_live_xxxxx',
},
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}Previous
List API tokensLists API tokens in a workspace. Admins see every token; non-admins see only tokens they own. Raw token values are never returned after creation.
Next
⌘I
cURL
curl -X DELETE 'http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example' \
-H 'Authorization: Bearer ek_live_xxxxx'const response = await fetch('http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example', {
method: 'DELETE',
headers: {
Authorization: 'Bearer ek_live_xxxxx',
},
});
const data = await response.json();import requests
response = requests.delete(
'http://localhost:8080/v1/workspace/ws_example/project/prj_example/secret/sec_example',
headers={
'Authorization': 'Bearer ek_live_xxxxx',
},
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/v1/workspace/{ws}/project/{prj}/secret/{secretId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}