Skip to content

Delete intents (single or multiple)

LegacyAPI v1 is the older API. It still works and is supported, but new integrations should use API v2. Migrating from v1 to v2

DELETE
/external/intents/bulk_destroy
curl --request DELETE \
--url https://app.stoqapp.com/api/v1/external/intents/bulk_destroy \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <X-Auth-Token>' \
--data '{ "intent_ids": [ "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70", "1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809" ] }'

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.

X-Auth-Token
required
string

API key for authentication

Media typeapplication/json
object
intent_ids
required

Array of intent IDs to delete

Array<string>

Example

{
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
]
}

All intents deleted successfully

Media typeapplication/json
object
success
boolean
deleted_count

Number of intents successfully deleted

integer

Example

{
"success": true,
"deleted_count": 2
}

Bad request - invalid parameters

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}

Unauthorized

No valid intents found

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}

Cannot delete intents that have already been sent

Media typeapplication/json
object
error
string
sent_intent_ids

IDs of intents that have already been sent and cannot be deleted

Array<string>

Example generated

{
"error": "example",
"sent_intent_ids": [
"example"
]
}
Was this page helpful?

Still stuck? Ask Quinn or chat with support