Discard an agent draft
curl --request DELETE \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId} \
--header 'Authorization: <api-key>'import requests
url = "https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}', 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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}",
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: <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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}Agent Versions & Drafts
Discard Agent Draft
Discards a draft. You can discard your own draft at any time, and someone else’s proposal with agents:discard_draft (its author is emailed, with your note). A discarded draft can be brought back by its author for 30 days with Restore Agent Draft.
DELETE
/
v2
/
voice-agents
/
{voiceAgentId}
/
drafts
/
{draftId}
Discard an agent draft
curl --request DELETE \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId} \
--header 'Authorization: <api-key>'import requests
url = "https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}', 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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}",
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: <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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<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://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/drafts/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}Authorizations
Path Parameters
Query Parameters
Response
Discarded. No body.
Was this page helpful?