Groups API v4

Organize and manage user segments by creating, updating, fetching, and deleting groups using the Groups API v4.

Read time 15 minutes

Use this API to manage mediation groups on the LevelPlay dashboard. The API supports the following:

  • Managing mediation groups setup
  • Managing Waterfall per mediation group

Requests are limited to 1 application per call.

Rate limits

The API returns a 429 HTTP status code if a request exceeds 4000 requests in a time period of 30 minutes.

Authentication Type

Bearer API authentication

GET

Description

Get the list of your application groups. 

Method

GET https://platform.ironsrc.com/levelPlay/groups/v4/{appKey}

Request Parameters

NameTypeDescriptionExample
appKeyStringapplication key (as seen on the platform)142401ac1

Request Example URL

https://platform.ironsrc.com/levelPlay/groups/v4/142401ac1/

Response Parameters

NameDescriptionExample
groupIdUnique group ID generated by LevelPlay platform on group creation2432228
groupNameThe group nameSpeakingEnglish
mediationAdUnitIdID of the ad unit to which the group belongsfgx25t56dq201bd2
mediationAdUnitNameName of the ad unit to which the group belongsinterstitial-1
adFormatrewarded, interstitial, banner or nativeinterstitial
abTestThe group test it is related toA
positionThe position of group in the list1
floorPriceThe minimum bid per impression, expressed as CPM 1.3
countriesList of country codes which belong to the groupUS, GB
segmentsList of segments names which belong to the groupunder30, femaleOnly
instances List of instances which belong to the group
These are the following instance fields in the ‘instances' array
idInstance ID as sent in LevelPlay Instances API128395
nameThe instance nameRewarded50
networkNameThe ad network the instance belongs tounityAds
isBiddertrue for bidder instances, otherwise falsefalse
groupRate

Used to prioritize the instance in your waterfall. Should be in the range 0.01-3000. Refer to Mediation management.

11.9
countriesRateList of countries rates which Different from the group level rate
These are the following countryRate fields in the ‘countriesRate' array
countryCode

Country code which is defined by a 2 letter country code as per ISO 3166-1 Alpha-2

GB
rate

Used to prioritize the instance in your waterfall and for reporting. Should be in the range 0.01-3000. Refer to Mediation management.

9

Response Example 

[code-snippet lang="jsonp"]

[
  {
    "groupId": 12673,
    "groupName": "newGroup",
    "mediationAdUnitId": "fgx25t56dq201bd2",
    "mediationAdUnitName": "interstitial-1",
    "adFormat": "interstitial",
    "abTest": "A",
    "countries": ["FR","US"],
    "position": 1,
    "segments": [],
    "floorPrice": 0.3,
    "instances": [
      {
        "id": 3681,
        "name": "",
        "networkName": "ironSource",
        "isBidder": true
      },
      {
        "id": 2,
        "name": "Default",
        "isBidder": false,
        "networkName": "unityAds",
        "groupRate": 5,
        "countriesRate": [
          {
            "countryCode": "FR",
            "rate": 1
          }
        ]
      }
    ]
  }
]

[/code-snippet]

CREATE

Use this API to create mediation groups. This API allows you to create multiple groups with a single API call. Use the “instances” parameter to determine each instance to include/exclude in a group. The instance ID value is reachable using the Instances API.

  • This API allows you to create multiple groups with a single API call.
  • The Group Id value is reachable using Get call to this API
  • The instance ID value is reachable using the Instances API.

Method

POST https://platform.ironsrc.com/levelPlay/groups/v4/{appKey}

Request Parameters

NameTypeDescriptionExample
appKeyStringapplication key (as seen on the platform)142401ac1

Request Example URL

https://platform.ironsrc.com/levelPlay/groups/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
groupNameStringThe newly created group's name  Length should be in range 1 to 32.Tier 1
adFormatStringrewarded, interstitial, banner, nativeinterstitial
mediationAdUnitIdStringID of the ad unit to which the group belongs Mandatory if multiple ad units exist for the ad formatxfgx25t56dq201bd2
positionNumberThe position of group in the list of groups Should be between 1 to maximum groups at the list (except allCountries group)2
abTestStringThe AB test group it is related to. "A", "B" xB
floorPriceNumberThe minimum bid per impression, expressed as a CPMx15
countriesArray of String

An array of country codes  which is defined by a 2 letter country code as per ISO 3166-1 Alpha-2. If not specified, the default will include allCountries

xUS, GB
segmentsArray of StringAn array of segments names xunder30, femaleOnly
instancesArrayList of instances to update. If not specified, the default will include all instances configured to the ad formatx
These are the following instance fields in the ‘instances' array
idNumberInstance ID as sent in LevelPlay Instances API124526
groupRateNumber

Used to prioritize the instance in your waterfall. Should be in the range 0.01-3000. Refer to Mediation management.

x0.6
countriesRateArrayList of country rate to updatex
These are the following countryRate fields in the ‘countriesRate' array
countryCodeString

country code. which is defined by a 2 letter country code as per ISO 3166-1 Alpha-2

AU
rateNumber

Used only to prioritize the instance in your waterfall. Should be in the range 0.01-3000. Refer to Mediation management.

2.4

Request Example 

[code-snippet lang="jsonp"]

[
  {
    "groupName": "new group",
    "adFormat": "rewarded",
    "mediationAdUnitId": "fgx25t56dq201bd2",
    "countries": ["FR","US"],
    "position": 1,
    "segments": ["nonPaying"],
    "abTest": "B",
    "floorPrice": 0.3,
    "instances": [
      {
        "id": 7983541,
        "groupRate": 2,
        "countriesRate": [
          {
            "countryCode": "FR",
            "rate": 1
          }
        ]
      },
      {
        "id": 4896357
      },
      {
        "id": 62624583,
        "countriesRate": [
          {
            "countryCode": "US",
            "rate": 5.3
          }
        ]
      }
    ]
  }
]

[/code-snippet]

UPDATE

Use this API to update mediation groups setup configuration and waterfalls

  • Multiple groups can be updated with a single API call
  • To remove the groupRate/countryRate, add the field parameter with null value.
  • To update an array field, include all values (new and existing).

Method

PUT https://platform.ironsrc.com/levelPlay/groups/v4/{appKey}

Request Parameters

NameTypeDescriptionExample
appKeyStringapplication key (as seen on the platform)142401ac1

Request Example URL

https://platform.ironsrc.com/levelPlay/groups/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
groupIdNumberGroup ID as sent in the GET request12673
groupNameStringThe newly created group's name  Length should be in range 1 to 32xSpeaking English
positionNumberThe position of group in the list of groups Should be between 1 to maximum groups at the list (except allCountries group)x2
floorPriceNumberThe minimum bid per impression, expressed as CPMx15
countriesArray of String

An array of country codes  which is defined by a 2 letter country code as per ISO 3166-1 Alpha-2. If not specified, the default will include allCountries

xUS, GB
segmentsArray of StringAn array of segment names xunder30, femaleOnly
instancesArrayList of instances to update. If not specified, the default will include all instances configured to the ad formatx
These are the following instance fields in the ‘instances' array
idNumberInstance ID as sent in LevelPlay Instances API123658
groupRateNumber

Used only to prioritize the instance in your waterfall. Should be in the range 0.01-3000. Refer to Mediation management.

x0.6
countriesRateArrayList of countryRate to updatex
These are the following countryRate fields in the ‘countriesRate' array
countryCodestring

Country code which is defined by a 2 letter country code  as per ISO 3166-1 Alpha-2

AU
rateNumber

Used only to prioritize the instance in your waterfall. Should be in the range 0.01-3000. Refer to Mediation management.

2.5

Request Example

[code-snippet lang="jsonp"]

[
  {
    "groupId": 123,
    "groupName": "new group",
    "countries": ["FR","US"],
    "position": 1,
    "segments": [],
    "floorPrice": 0.3,
    "instances": [
      {
        "id": 1,
        "groupRate": null,
        "countriesRate": [
          {
            "countryCode": "FR",
            "rate": 1
          }
        ]
      },
      {
        "id": 2,
        "countriesRate": [
          {
            "countryCode": "FR",
            "rate": 1.4
          }
        ]
      }
    ]
  }
]

[/code-snippet]

Success

A successful response will be sent with HTTP code 200.

DELETE

Use this API to delete an instance.

  • The AllCountries group cannot be deleted.
  • Deleted groups cannot be restored.

Method

DELETE https://platform.ironsrc.com/levelPlay/groups/v4/{appKey}

Request Parameters

NameTypeDescriptionExample
appKeyStringapplication key (as seen on the platform)142401ac1

Request Example URL

https://platform.ironsrc.com/levelPlay/groups/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
idsArray of numberGroup IDs as sent in the GET request12473, 47238

Request body example

[code-snippet lang="jsonp"]

{
    "ids": [1458, 5769]
}

[/code-snippet]

Success

A successful response will be sent with HTTP code 200.

Errors

If one of the groups sent in the request is failing, an error array will be sent with HTTP code 400 and will cause the whole request to be rejected.

Each error will be followed with an error message.

Example

[code-snippet lang="jsonp"]

{
    "errorsArray": [
        {
            "code": ERR-208,
            "errorMessage": "Group name value is required",
            "params": {
                "[0].groupName": ""
            }
        },
        {
            "code": ERR-311,
            "errorMessage": "Group position value is not valid",
            "params": {
                "[0].position": ""
            }
        }
    ],
    "code": 400
}

[/code-snippet]