Skip to content

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_destroy

Costs 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-TokenstringRequired

    API key for authentication

Request body

  • intent_idsarray of stringsRequired

    Array of intent IDs to delete

Returns

  • successboolean
    Example: true
  • deleted_countinteger

    Number 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"
    ]
  }'
Response
{
  "success": true,
  "deleted_count": 2
}