Skip to main content
POST
/
campaigns
/
{campaign_id}
/
rules
curl --request POST \
  --url https://api-sandbox.y.uno/v1/campaigns/{campaign_id}/rules \
  --header 'Content-Type: application/json' \
  --header 'private-secret-key: <api-key>' \
  --header 'public-api-key: <api-key>' \
  --data '
{
  "rules": [
    {
      "rule_type": "PAYMENT_STATUS",
      "values": [
        "DECLINED"
      ],
      "conditional": "EQUAL"
    },
    {
      "rule_type": "PAYMENT_METHOD",
      "values": [
        "CARD"
      ],
      "conditional": "EQUAL"
    }
  ]
}
'
{
  "data": [
    {
      "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "rule_type": "PAYMENT_STATUS",
      "values": [
        "DECLINED"
      ],
      "conditional": "EQUAL",
      "metadata_key": null,
      "status": "ACTIVE",
      "created_at": "2025-07-01T12:05:00Z",
      "updated_at": "2025-07-01T12:05:00Z"
    },
    {
      "id": "a9b8c7d6-e5f4-3210-abcd-ef1234567890",
      "rule_type": "CURRENCY",
      "values": [
        "COP"
      ],
      "conditional": "EQUAL",
      "metadata_key": null,
      "status": "ACTIVE",
      "created_at": "2025-07-01T12:05:00Z",
      "updated_at": "2025-07-01T12:05:00Z"
    },
    {
      "id": "11223344-5566-7788-99aa-bbccddeeff00",
      "rule_type": "AMOUNT",
      "values": [
        "50000"
      ],
      "conditional": "GREATER_THAN",
      "metadata_key": null,
      "status": "ACTIVE",
      "created_at": "2025-07-01T12:05:00Z",
      "updated_at": "2025-07-01T12:05:00Z"
    }
  ]
}
Creates one or more rules for a campaign. All active rules must pass for a payment to trigger the campaign (AND logic). Visit the conditional operators reference for more information on how to use them.

Authorizations

public-api-key
string
header
required
private-secret-key
string
header
required

Path Parameters

campaign_id
string
required

The campaign identifier (UUID).

Body

application/json
rules
object[]
required

Array of rule objects

Response

201 - application/json

Created

data
object[]