Campaigns
GET /establishments/[establishmentId]/campaigns
Retrieves all campaigns associated with a specific establishment. Useful for listing active, upcoming, and past campaigns in dashboards or reporting tools.
Endpoint
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| establishmentId | string | path | Yes |
Responses
200
Campaigns retrieved successfully.
400
Invalid establishment ID.
500
Server error while fetching campaigns.
POST /establishments/[establishmentId]/campaigns
Creates a new campaign for a given establishment. Supports multiple campaign types including daily rewards and tournaments, along with associated prize structures and targeting conditions.
Endpoint
Request Body
{
"title": "string",
"modalTitle": "string",
"description": "string",
"duration": "next_weekend",
"startDate": "2026-01-01",
"endDate": "2026-01-01",
"type": "daily_reward_simple",
"multiplier": 0,
"budget": 0,
"legalTerms": "string",
"termsAccepted": false,
"prizes": [
{
"coinPrize": 0,
"catalogPrize": "string",
"productPrize": "string",
"quantity": 0,
"day": 0,
"rank": "string"
}
],
"targeting": {
"conditions": [
{
"parameter": "bets_amount",
"groupId": 0,
"operator": "equals",
"value": "string",
"logic": "AND"
}
],
"includedUsers": [
"string"
],
"excludedUsers": [
"string"
],
"conditionsExcludeUsers": false
}
}| Attribute | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | |
| modalTitle | string | No | |
| description | string | No | |
| duration | string [next_weekend, next_week, next_month, next_year, custom] | No | |
| startDate | string(date) | No | |
| endDate | string(date) | No | |
| type | string [daily_reward_simple, daily_reward_progressive, tournament] | Yes | |
| multiplier | integer | No | |
| budget | number | No | |
| legalTerms | string | No | |
| termsAccepted | boolean | Yes | |
| prizes | array<object> | Yes | |
| prizes[] | object | Yes | |
| prizes[].coinPrize | integer | Yes | |
| prizes[].catalogPrize | string | Yes | |
| prizes[].productPrize | string | Yes | |
| prizes[].quantity | integer | Yes | |
| prizes[].day | integer | Yes | |
| prizes[].rank | string | Yes | |
| targeting | object | No | |
| targeting.conditions | array<object> | No | |
| targeting.conditions[] | object | No | |
| targeting.conditions[].parameter | string [bets_amount, total_bets, created_at, bet_result, game_played, event_participation, user_level, language, login_time, source_platform, deposit, cashback] | Yes | |
| targeting.conditions[].groupId | integer | No | |
| targeting.conditions[].operator | string [equals, contains, not_equals, greater_than, less_than, greater_than_or_equals, less_than_or_equals, between, top, sum_greater_than, sum_greater_than_or_equals, sum_less_than, sum_less_than_or_equals, last_x_days, on_date, between_dates, last_login] | Yes | |
| targeting.conditions[].value | string | Yes | |
| targeting.conditions[].logic | string [AND, OR] | No | |
| targeting.includedUsers | array<string> | No | |
| targeting.includedUsers[] | string | No | |
| targeting.excludedUsers | array<string> | No | |
| targeting.excludedUsers[] | string | No | |
| targeting.conditionsExcludeUsers | boolean | No |
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| establishmentId | string | path | Yes |
Responses
200
Campaigns retrieved successfully.
[
{
"campaignId": "00000000-0000-0000-0000-000000000000",
"name": "string",
"modalTitle": "string",
"status": "in_progress",
"type": "daily_reward_simple",
"startDate": "2026-01-01",
"endDate": "2026-01-01",
"budget": 0,
"totalAwarded": 0,
"isTemplate": false,
"duration": "string"
}
]| Attribute | Type | Required | Description |
|---|---|---|---|
| items[] | object | No | |
| items[].campaignId | string(uuid) | No | |
| items[].name | string | No | |
| items[].modalTitle | string | No | |
| items[].status | string [in_progress, paused, cancelled, draft, completed] | No | |
| items[].type | string [daily_reward_simple, daily_reward_progressive, tournament] | No | |
| items[].startDate | string(date) | No | |
| items[].endDate | string(date) | No | |
| items[].budget | number | No | |
| items[].totalAwarded | number | No | |
| items[].isTemplate | boolean | No | |
| items[].duration | string | No |
400
Invalid establishment ID.
500
Server error while fetching campaigns.
POST /establishments/[establishmentId]/campaigns/insert-activity
Triggers background processing or insertion of activity data related to campaigns for a specific establishment. Used for syncing or recalculating rewards.
Endpoint
Request Body
{
"mode": "player",
"player_id": "string",
"campaign_id": "string",
"amount": 0,
"bet_won": false,
"bets_number": 0,
"referred_by": "string",
"login_time": "2026-01-01T00:00:00.000Z",
"points": 0
}| Attribute | Type | Required | Description |
|---|---|---|---|
| mode | string [player, campaign, session, tournament] | Yes | Tracking context for the event. Affects required fields. |
| player_id | string | Yes | ID of the player performing the action. |
| campaign_id | string | No | Optional campaign ID, required for some modes. |
| amount | number | No | Optional monetary amount involved in the action. |
| bet_won | boolean | No | Flag indicating if the bet was won. |
| bets_number | number | No | Number of bets made in the session or event. |
| referred_by | string | No | Referrer ID. Required if mode is 'player'. |
| login_time | string(date-time) | No | Login timestamp in 'Y-m-d H:i:s'. Required if mode is 'session'. |
| points | integer | No | Point value awarded or logged. Required if mode is 'tournament'. |
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| establishmentId | string | path | Yes |
Responses
200
Activity inserted or task triggered successfully.
400
Invalid request parameters.
500
Internal server error while inserting activity.
GET /establishments/[establishmentId]/campaigns/[campaignId]
Retrieves a specific campaign by ID for a given establishment. Returns full campaign configuration including rules, prizes, and targeting.
Endpoint
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| campaignId | string | path | Yes | |
| establishmentId | string | path | Yes |
Responses
200
Campaign data retrieved successfully.
400
Invalid campaign or establishment ID.
500
Error while retrieving campaign.
PUT /establishments/[establishmentId]/campaigns/[campaignId]
Updates a campaign's configuration such as prizes, dates, or rules. The full campaign object should be re-sent with updated values.
Endpoint
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| establishmentId | string | path | Yes | |
| campaignId | string | path | Yes |
Responses
200
Campaign updated successfully.
400
Invalid or incomplete update request.
500
Server error during campaign update.
DELETE /establishments/[establishmentId]/campaigns/[campaignId]
Deletes a campaign identified by ID from a given establishment. This operation is irreversible and may affect analytics or audit trails.
Endpoint
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| campaignId | string | path | Yes | |
| establishmentId | string | path | Yes |
Responses
200
Campaign deleted successfully.
400
Invalid campaign or establishment ID.
500
Error while deleting campaign.
PUT /establishments/[establishmentId]/campaigns/[campaignId]/update-status
Updates the current status of a campaign (e.g., cancel, pause, mark as in-progress). Status transition rules must be respected according to business logic.
Endpoint
Request Body
{
"status": "cancelled"
}| Attribute | Type | Required | Description |
|---|---|---|---|
| status | string [cancelled, paused, in_progress] | Yes |
Parameters
| Attribute | Description | Type | Location | Required |
|---|---|---|---|---|
| campaignId | string | path | Yes | |
| establishmentId | string | path | Yes |
Responses
200
Campaign status updated successfully.
400
Invalid status update request.
500
Error occurred while updating campaign status.