API reference
Sample: Delete a ticket
Permanently delete a ticket and its replies. This can't be undone. To hide a ticket without losing it, close it instead.
This is a sample page
"Acme Tickets" is a made-up API. This page shows a
DELETE endpoint with a path parameter, documented with the PinkDocs API blocks.DEL
https://api.example.com/v1/tickets/{ticket_id}https://api.example.com/v1/tickets/{ticket_id}Request
curl -X DELETE "https://api.example.com/v1/tickets/tkt_8f2a91" \
-H "Authorization: Bearer YOUR_API_KEY"await fetch('https://api.example.com/v1/tickets/tkt_8f2a91', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});import requests
requests.delete(
"https://api.example.com/v1/tickets/tkt_8f2a91",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)wp_remote_request('https://api.example.com/v1/tickets/tkt_8f2a91', [
'method' => 'DELETE',
'headers' => ['Authorization' => 'Bearer YOUR_API_KEY'],
]);Response
Deleted (no content)
(empty body)Your API key can’t delete tickets
{
"error": "forbidden",
"message": "This key has the tickets:read scope only."
}No ticket with this ID
{
"error": "not_found",
"message": "Ticket tkt_8f2a91 does not exist or was already deleted."
}Authentication
- Header
AuthorizationstringrequiredAn API key with thetickets:writescope, as a bearer token.
Path parameters
- Path
ticket_idstringrequiredThe ticket’s ID, e.g.tkt_8f2a91. Ticket numbers like1042don’t work here.
Deleting is permanent
Replies, attachments and the ticket's history are deleted too. Export the ticket first if you might need it later.
Was this page helpful?
Great! What worked best for you?
Please provide additional details about your experience.
Thank you for your feedback!
We appreciate your input.
