Skip to content

Create New Campaign

This endpoint is used to create a new campaign of any type.

API Call Sample:

POST
/api/v1/campaign
curl -i -X POST \
  -u '<username>:<password>' \
  https://asia.stage.rubyplay.io/api/v1/campaign \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "New Year Promo",
    "externalCampaignId": "New Year Promo",
    "gameIds": [
      "rp_504"
    ],
    "startDateTime": "2027-01-01T08:00:00Z",
    "endDateTime": "2027-01-02T08:00:00Z",
    "bet": 20,
    "currencyCode": "EUR",
    "betNumber": 7,
    "strategy": "PLAYER_LIST",
    "strategyData": {
      "playerIds": [
        "player1"
      ]
    },
    "rulesUrl": "https://url-to-rules.com",
    "validForDays": 7,
    "startEvent": "ACCEPT",
    "allowPostExpirationCompletion": true,
    "type": "FREE_ROUNDS",
    "requestId": "1a845822-7340-41d0-8161-55e9f8ecf201"
  }'
Response
{ "id": 7, "type": "FREE_ROUNDS", "disabledAt": "2027-01-03T10:00:00Z", "disabledForcibly": true, "name": "New Year Promo", "externalCampaignId": "New Year Promo", "gameId": "rp_140", "gameIds": [ "rp_140" ], "startDateTime": "2027-01-01T08:00:00Z", "endDateTime": "2027-01-02T08:00:00Z", "expiresInDays": 7, "bet": 50, "currencyCode": "EUR", "betNumber": 7, "strategy": "PLAYER_LIST", "strategyData": { "eligiblePlayersNumber": 777, "playerIds": [ "player one" ] }, "countries": [ [ "BR", "US", "FR" ] ], "status": "UPCOMING", "rulesUrl": "https://url-to-rules.com", "validForDays": 7, "startEvent": "ACCEPT", "allowPostExpirationCompletion": true, "promotionSettings": { "expiresInEnabled": true, "optOutConfirmationPopupEnabled": true, "optOutEnabled": true, "valuedAtEnabled": true, "youWonEnabled": true, "playLaterEnabled": true, "playLaterExtraTextEnabled": true, "hideBetPanelDuringAwardedFeature": true } }

Request Schema:

namestring, [ 1 .. 255 ] charactersrequired

Campaign name

Example:"New Year Promo"
externalCampaignIdstring, [ 0 .. 512 ] characters

Campaign ID set by the operator.

Example:"New Year Promo"
gameIdsArray of strings, unique
startDateTimestring, (date-time)required

The start time of the campaign in UTC. It must not be earlier than the current time. Stored with second precision.

Example:"2027-01-01T08:00:00Z"
endDateTimestring, (date-time)required

The end time of the campaign in UTC. It must be greater than startDateTime. Stored with second precision.

Example:"2027-01-02T08:00:00Z"
betnumberrequired

Size of a single bet in major currency units, e.g. 1.00 for 1 EUR. For free rounds will be any supported game bet. For awarded features will be the actual cost of the feature e.g. 1 EUR x 50 Multiplier = 50 EUR.

Example:50
currencyCodestringrequired

ISO 4217 3-letter currency code.

Example:"EUR"
betNumberinteger, (int32)required

Number of free bets/features for each participating player.

Example:5
rulesUrlstring

Link for campaign rules

Example:"https://url-to-rules.com"
validForDaysinteger, (int32)

The number of days the offer remains valid, starting from the date of the startEvent

Example:7
startEventstring

The event that marks the starting point for counting the validity period validForDays.

Enum:"ASSIGN""ACCEPT"
Example:"ACCEPT"
allowPostExpirationCompletionboolean

Defines if accepted promotion can be completed after the campaign end date.

Example:true
promotionSettingsobject(CampaignPromotionSettings)

Promotion settings (UI customization).

typestring

Default value FREE_ROUNDS if absent. Possible values: FREE_ROUNDS, AWARDED_FEATURE

Default:"FREE_ROUNDS"
Enum:"FREE_ROUNDS""AWARDED_FEATURE"
Example:"FREE_ROUNDS"
requestIdstring, [ 0 .. 128 ] characters

Random request identifier, idempotency key. Several requests with the same requestId (if it is specified) will have the same campaign in response; only one campaign will be created.

Example:"1a845822-7340-41d0-8161-55e9f8ecf201"
gameIdstringdeprecated

Game ID - DEPRECATED: Use gameIds field instead. This field will be removed in future API versions.

Example:"rp_140"
expiresInDaysinteger, (int32)deprecated

Expires in x days from date of campaign start.

This field will be removed in future versions of the API and fields validForDays, startEvent and allowPostExpirationCompletion should be used instead

Example:7
countriesArray of stringsdeprecated

A list of ISO 3166-2 country codes.

This filed will be removed in future versions of the API and we will no longer support this functionality.

Example:
[ "BR", "US", "FR" ]
strategystringdeprecated

PLAYER_LIST or FIRST_N_PLAYERS.

This field will be removed in future versions of the API and default to PLAYER_LIST as FIRST_N_PLAYERS will not be supported in the future.

Default:"PLAYER_LIST"
Enum:"PLAYER_LIST""FIRST_N_PLAYERS"
Example:"PLAYER_LIST"
strategyDataobject(StrategyDataDto)deprecated

Strategy specific data.

This field will be removed in future versions of the API and the following operation should be used to add players instead : PUT /campaign/{campaignId}/participant

Response Schema:

idinteger, (int64)

ID of the campaign.

Example:7
typestring

Possible values: FREE_ROUNDS, AWARDED_FEATURE

Enum:"FREE_ROUNDS""AWARDED_FEATURE"
Example:"FREE_ROUNDS"
disabledAtstring, (date-time)

Campaign deactivation time in UTC. Stored with second precision.

Example:"2027-01-03T10:00:00Z"
disabledForciblyboolean

Whether the campaign was disabled forcibly.

Example:true
namestring

Campaign name

Example:"New Year Promo"
externalCampaignIdstring

External campaign ID.

Example:"New Year Promo"
gameIdsArray of strings, unique
startDateTimestring, (date-time)

Campaign start time in UTC. Stored with second precision.

Example:"2027-01-01T08:00:00Z"
endDateTimestring, (date-time)

Campaign end time in UTC. Stored with second precision.

Example:"2027-01-02T08:00:00Z"
betnumber

Size of a single bet in major currency units, e.g. 1.00 for 1 EUR. For free rounds will be any supported game bet. For awarded features will be the actual cost of the feature e.g. 1 EUR x 50 Multiplier = 50 EUR.

Example:50
currencyCodestring

ISO 4217 3-letter currency code.

Example:"EUR"
betNumberinteger, (int32)

Number of free bets/features for each participating player.

Example:7
statusstring

Possible values: UPCOMING, ONGOING, ENDED, DISABLED.

Enum:"UPCOMING""ONGOING""ENDED""DISABLED"
Example:"UPCOMING"
rulesUrlstring

Link for campaign rules.

Example:"https://url-to-rules.com"
validForDaysinteger, (int32)

The number of days the offer remains valid, starting from the date of the startEvent

Example:7
startEventstring

The event that marks the starting point for counting the validity period validForDays.

Enum:"ASSIGN""ACCEPT"
Example:"ACCEPT"
allowPostExpirationCompletionboolean

Defines if accepted promotion can be completed after the campaign end date.

Example:true
promotionSettingsobject(CampaignPromotionSettings)

Promotion settings (UI customization).

gameIdstringdeprecated

Game ID - DEPRECATED: Use gameIds field instead. This field will be removed in future API versions.

Example:"rp_140"
expiresInDaysinteger, (int32)deprecated

Expires in x days from date of campaign start.

This field will be removed in future versions of the API and fields validForDays, startEvent and allowPostExpirationCompletion should be used instead

Example:7
strategystringdeprecated

PLAYER_LIST or FIRST_N_PLAYERS.

This field will be removed in future versions of the API and default to PLAYER_LIST as FIRST_N_PLAYERS will not be supported in the future.

Default:"PLAYER_LIST"
Enum:"PLAYER_LIST""FIRST_N_PLAYERS"
Example:"PLAYER_LIST"
strategyDataobject(StrategyDataDto)deprecated

Strategy specific data.

This field will be removed in future versions of the API and the following operation should be used to add players instead : PUT /campaign/{campaignId}/participant

countriesArray of stringsdeprecated

Determining Valid Bet Values

The bet field meaning differs depending on the campaign type:

Campaign TypeBet Value MeaningExample
FREE_ROUNDSThe single bet amount in major currency units1 EUR
AWARDED_FEATUREThe total feature cost (base bet × buy feature multiplier)1 EUR × 50 = 50 EUR
FREE_ROUNDS Campaigns

For FREE_ROUNDS campaigns, the bet field should be the single bet amount in major currency units (e.g., 1.00 for 1 EUR).

Use the Get Games API endpoint to retrieve available bet sizes for the game.

AWARDED_FEATURE Campaigns

For AWARDED_FEATURE campaigns, the bet field should be the total cost of the buy feature. This is calculated as:

Feature Cost = Base Bet × Buy Feature Multiplier

For example, if you want to award a feature with:

  • Base bet: 1 EUR
  • Buy feature multiplier: 50x

The bet value should be 50 EUR (not 1 EUR).

Use the Get Awarded Feature Configurations endpoint to retrieve available feature costs that can be used directly in campaign creation.