Delete an approval policy
1 min
DELETE
http://localhost:3002//projects/{project_id}/environments/{environment_id}/policies/{policy_id}
Path Parameters
- project_idintegerrequired
- environment_idintegerrequired
- policy_idintegerrequired
Responses
204
404
- ErrorResponse
- detailsstringrequiredDescription
- statusintegerrequiredExampleDescription
curl
curl --request DELETE \
--url http://localhost:3002//projects/{project_id}/environments/{environment_id}/policies/{policy_id} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow'
};
fetch("http://localhost:3002//projects/{project_id}/environments/{environment_id}/policies/{policy_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("http://localhost:3002//projects/{project_id}/environments/{environment_id}/policies/{policy_id}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "http://localhost:3002//projects/{project_id}/environments/{environment_id}/policies/{policy_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
204
// Policy deleted successfully
404
// Policy not found
{
"details": "",
"status": 400
}