Skip to main content
Retrieves a paginated list of active earning rules (campaigns) for your organisation. Results are sorted by created_at in descending order. GET /public/earning-rules

Authorizations

Authorization string header required Bearer authentication header of the form Bearer <token>, where <token> is your REST API token.

Query Parameters

campaign_type enum<string> Filter results to only earning rules of the given type. Available options: purchase, signup, review, daily_visit, birthday, anniversary, twitter_follow, twitter_share, instagram_follow, instagram_share, facebook_like, facebook_share, newsletter_subscribe per_page integer default: 20 The number of results per page. Required range: 1 <= x <= 100 page integer default: 1 The page number to retrieve.

Response

200 - application/json data object[] Hide child attributes data.id string<uuid> Unique UUID identifier for the earning rule. Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" data.name string The display name of the earning rule. Example: "Place an order" data.description string | null A short description shown to customers. Example: "Earn 5 points for every $1 spent." data.campaign_type enum<string> The type of action that triggers this earning rule. Example: "purchase" data.earning_rule object | null Defines how points are calculated when the rule is triggered. Show child attributes data.earning_rule.type enum<string> The method used to calculate points awarded. Available options: fixed, variable Example: "variable" data.earning_rule.value number Points awarded. For variable type, this is points earned per per_amount unit. Example: 5 data.earning_rule.per_amount number | null Only present for variable type. The unit amount required to earn the value of points. Example: 1 data.conditions object | null Optional conditions that must be met for the rule to trigger. Example: null data.is_active boolean Whether this earning rule is currently active. Example: true data.created_at string<date-time> Example: "2026-01-10T09:00:00.000Z" meta object Hide child attributes meta.pagination object Hide child attributes meta.pagination.current_page integer Example: 1 meta.pagination.per_page integer Example: 20 meta.pagination.total integer Example: 4 meta.pagination.last_page integer Example: 1 meta.pagination.has_more boolean Example: false
curl --request GET \
  --url "https://api.yukoapp.com/api/v1/public/earning-rules?campaign_type=purchase" \
  --header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Place an order",
      "description": "Earn 5 points for every $1 spent.",
      "campaign_type": "purchase",
      "earning_rule": {
        "type": "variable",
        "value": 5,
        "per_amount": 1
      },
      "conditions": null,
      "is_active": true,
      "created_at": "2026-01-10T09:00:00.000Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
      "name": "Sign up",
      "description": "Earn 200 points when you create an account.",
      "campaign_type": "signup",
      "earning_rule": {
        "type": "fixed",
        "value": 200,
        "per_amount": null
      },
      "conditions": null,
      "is_active": true,
      "created_at": "2026-01-10T09:00:00.000Z"
    }
  ],
  "meta": {
    "pagination": {
      "current_page": 1,
      "per_page": 20,
      "total": 2,
      "last_page": 1,
      "has_more": false
    }
  }
}