Delete Draft Thread
curl --request DELETE \
--url https://app.pixie.ai/api/threads/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pixie.ai/api/threads/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pixie.ai/api/threads/{id}', 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://app.pixie.ai/api/threads/{id}",
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 := "https://app.pixie.ai/api/threads/{id}"
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("https://app.pixie.ai/api/threads/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/threads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyUnibox
Delete Draft Thread
Permanently discard an unsent one-off email draft thread.
DELETE
/
api
/
threads
/
{id}
Delete Draft Thread
curl --request DELETE \
--url https://app.pixie.ai/api/threads/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pixie.ai/api/threads/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pixie.ai/api/threads/{id}', 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://app.pixie.ai/api/threads/{id}",
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 := "https://app.pixie.ai/api/threads/{id}"
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("https://app.pixie.ai/api/threads/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/threads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyCLI:
pixie thread discard --id <id>
Overview
Permanently deletes an unsent one-off email draft thread. This endpoint only works when the thread hasstatus: "draft" and has no inbound or outbound messages. It will not delete active conversations, archived conversations, sent one-off emails, campaign conversations, or drafts that already have message history.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Draft thread ID. |
Example
curl -X DELETE "https://app.pixie.ai/api/threads/3d986dd1-9d70-45b7-8e36-5d5b8b1c9337" \
-H "Authorization: Bearer $PIXIE_API_KEY"
{
"deleted": true
}
Error Notes
| Status | When it happens |
|---|---|
404 | The thread does not exist or does not belong to the workspace. |
409 | The thread is not an unsent draft. |
500 | Deletion failed unexpectedly. |
AI agent notes
Use this only to clean up unsent one-off drafts. To hide a real conversation, archive it with Update thread instead.Was this page helpful?