Subscribe to a trigger
Changed onCreates a subscription to one trigger, either for one connected account or for the whole connection. Use this endpoint after ListAvailableTriggers and ListEligibleAccounts have shown that the trigger and account can be used. Pass the connection ID in the path, and trigger_name in the body. For an account-scoped trigger, pass connected_account_id; for a connection-scoped trigger, omit it. Use config to set the trigger's filter values, with keys spelled exactly as the trigger's config_fields declare them. For a polled trigger, interval_seconds sets the polling interval, and defaults to the trigger's default interval. An interval below the trigger's minimum is refused, not rounded up. Each refusal says what to change, for example the missing scope, the minimum interval, or that the account was authorized under a different app. Returns the new subscription with its status, its requested and effective intervals, and the account's health for this trigger.
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_id": "ca_123456789012345",
"interval_seconds": 300,
"trigger_name": "slack_message_posted"
}Response
The created subscription, including its status, intervals, filter values and the subscribed account's health
Example response
{
"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