Trigger Promotion Flows

Trigger one or more promotion flow actions.

POST https://api.sonorancms.com/v2/community/promotion-flows/trigger

Rate limit: 13 requests per minute

Authenticated v2 endpoints are rate limited per credential rather than per IP address.

Trigger one or more promotion flow actions.

Request Body

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| data | array | Yes | See example request for the shape. |

Example Request

local Sonoran = require("sonoran")

local sonoran = Sonoran.createClient({
  product = Sonoran.productEnums.CMS,
  apiKey = "YOUR_API_KEY",
  communityId = "YOUR_COMMUNITY_ID",
  defaultServerId = 1,
  timeoutMs = 30000,
})

local payload = {
  ["data"] = {
    {
      ["flowId"] = "flow-1",
      ["users"] = {
        "ExampleUser"
      },
      ["promote"] = true
    }
  }
}

local response = sonoran.cms:triggerPromotionFlowsV2(payload)

if response.success then
  print(response.data)
else
  print(response.reason)
end

Response

The data array contains one result object per flow/user combination. Each entry includes the users involved, the flow id, whether it was a promotion or demotion, the execution result, and the resolved flow config.

Last updated

Was this helpful?