Delete intents (single or multiple)
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
DELETE
/external/intents/bulk_destroyCosts 2 rate-limit points · Rate limits
Delete one or more intents by their IDs. Only intents that have not been sent (notified_at is null) can be deleted. If any of the intents have been sent, the entire operation will fail and return a 422 error with the IDs of sent intents. You can pass a single intent ID in the array to delete just one intent.
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Request body
intent_idsarray of stringsRequiredArray of intent IDs to delete
Returns
successbooleanExample:truedeleted_countintegerNumber of intents successfully deleted
Errors
400
Bad request - invalid parameters
401
Unauthorized
404
No valid intents found
422
Cannot delete intents that have already been sent
DELETE/external/intents/bulk_destroy
curl -X DELETE "https://app.stoqapp.com/api/v1/external/intents/bulk_destroy" \
-H "X-Auth-Token: $STOQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
]
}'const res = await fetch("https://app.stoqapp.com/api/v1/external/intents/bulk_destroy", {
method: "DELETE",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
]
}),
});
const data = await res.json();import os
import requests
res = requests.delete(
"https://app.stoqapp.com/api/v1/external/intents/bulk_destroy",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
]
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/intents/bulk_destroy")
req = Net::HTTP::Delete.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
intent_ids: [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
]
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)Response
{
"success": true,
"deleted_count": 2
}No body
No body
No body
No body