Delete several trigger subscriptions Beta
This endpoint is in beta. Its request and response may change.
Deletes trigger subscriptions on one connection and returns a result for each. Name them in one of two ways: by subscription_ids, or by trigger_name together with connected_account_ids, which deletes every subscription those accounts have to that trigger. A subscription that's already gone, such as one you deleted earlier, comes back as BATCH_DELETE_OUTCOME_NOT_FOUND, so retrying the request is safe. Up to 60 requests a minute per environment.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Path parameters
connection_idstringrequiredBody
connected_account_idsarray of stringca_) whose subscriptions to trigger_name to delete, at most 100, with no repeats. One account can hold several subscriptions to one trigger, one per filter; each is deleted and gets its own result. Results are grouped by account in the order sent and, within an account, ordered by ascending subscription ID. An account with no matching subscription gets one NOT_FOUND result with an empty subscription_id. A connection-scoped subscription names no account, so it is never matched here: delete it by subscription_ids.subscription_idsarray of stringtrgs_) to delete, at most 100, with no repeats. One of the two selectors: send either this, or trigger_name with connected_account_ids, never both. Results come back one per ID, in the order sent. Works for account-scoped and connection-scoped subscriptions alike.trigger_namestringscalekit_client.actions.triggers.batch_delete_subscriptions
Delete many trigger subscriptions in one call. Choose one selector: subscription_ids (up to 100), or trigger_name with connected_account_ids (up to 100). Each subscription gets its own outcome in results (DELETED, NOT_FOUND, FAILED, NOT_ATTEMPTED), and those never raise. Safe to call again.
scalekit_client.actions.triggers.batch_delete_subscriptions( connection_id: str, subscription_ids: Sequence[str] | None = None, trigger_name: str | None = None, connected_account_ids: Sequence[str] | None = None,) -> BatchDeleteTriggerSubscriptionsResponseParameters
connection_idstrrequiredconn_...).subscription_idsSequence[str] | Nonetrgs_...).trigger_namestr | Noneconnected_account_ids: the trigger to unsubscribe.connected_account_idsSequence[str] | Nonetrigger_name: the accounts (ca_...).Returns BatchDeleteTriggerSubscriptionsResponse: Per-subscription results and deleted_count.
From scalekit-sdk-python 2.23.0.
Response 200
deleted_countintegerresultsarray of objectShow 4 child attributes
connected_account_idstringoutcomestring (enum)BATCH_DELETE_OUTCOME_DELETEDBATCH_DELETE_OUTCOME_NOT_FOUNDBATCH_DELETE_OUTCOME_FAILEDBATCH_DELETE_OUTCOME_NOT_ATTEMPTEDreasonstringsubscription_idstringErrors
Every error has the same body: code, message and details. See Errors and rate limits.
400Invalid request, nothing deleted - both selectors or neither were sent, or trigger_name and connected_account_ids were not sent together; a list holds more than 100 IDs or repeats one, including two spellings of the same ID; connection_id is not a valid connection ID, an entry of subscription_ids is not a trigger subscription ID (trgs_), or an entry of connected_account_ids is not a connected account ID (ca_); or the named accounts hold more than 1000 subscriptions to the trigger, so fewer connected_account_ids must be sent per request. A well-formed ID naming a subscription that does not exist, was already deleted, or belongs to another connection is not this case: it comes back as a NOT_FOUND result with a 200, so one stale ID does not discard the rest of the batch.404Not found - Triggers isn't turned on for your environment, or connection_id can never name a connection. Nothing was deleted. A missing subscription is not this case: it is a NOT_FOUND result with a 200.429Too many requests - this environment has sent too many batch delete requests in the last minute. Nothing was deleted; retry after a short wait.500Internal error - the subscriptions that trigger_name and connected_account_ids name could not be read, so nothing was deleted. Only that selector fails this way; retrying is safe.