Subscribe several accounts to a trigger
Changed onSubscribes many connected accounts to one trigger with one filter, and reports what happened to each account separately. Use this instead of repeating the single-account call when onboarding a connection that already has many accounts. The call is best-effort rather than all-or-nothing: a refused account does not undo one that succeeded, because refusals here are ordinary rather than exceptional — an account may hold a revoked credential, lack a scope, or already carry this exact filter. Each result names its own outcome, and a refusal names its remedy. Retrying the whole request is safe: an account subscribed by an earlier attempt comes back as already subscribed rather than as an error. A connection-scoped trigger is subscribed on the connection itself rather than per account: send an empty connected_account_ids for it, and the one subscription comes back as a single result with an empty connected_account_id.
Request
- Base URLhttps://$SCALEKIT_ENVIRONMENT_URL
- AuthOAuth 2Client credentialsToken URLhttps://$SCALEKIT_ENVIRONMENT_URL/oauth/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
ID of the connection, in this environment. Up to 64 characters.
Request body
Example request
{
"config": {
"channel": "C0123456789"
},
"connected_account_ids": [
"ca_123456789012345",
"ca_123456789012346"
],
"interval_seconds": 300,
"trigger_name": "slack_message_posted"
}Response
One result per requested account, in request order, and the number of subscriptions this call created. Individual accounts can still be REFUSED, NOT_FOUND or FAILED
Example response
{
"created_count": 98,
"results": [
{
"connected_account_id": "ca_123456789012345",
"reason": "connected account not found",
"subscription": {
"config": {
"channel": "C0123456789"
},
"connected_account_id": "ca_123456789012345",
"connected_account_identifier": "user_123",
"connection_id": "conn_123456789012345",
"effective_interval_seconds": 60,
"id": "trgs_123456789012345",
"poll_state": {
"last_error": "The provider is rate-limiting requests. Polling resumes automatically after a backoff."
},
"provider": "slack",
"requested_interval_seconds": 60,
"trigger_name": "slack_message_posted"
}
}
]
}Changes
- info
endpoint added
- info