Instances API v4

Manage app mediation instances by retrieving, creating, updating, or deleting LevelPlay ad network instances programmatically via the Instances API v4.

Read time 32 minutes

Use the Instance API to manage instances on the LevelPlay dashboard. This API version supports the following:

  • Support for CRUD
  • Changing ad networks' application-level configurations
  • Adding or removing instances from waterfall groups (Supporting active AB test applications)

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 a list of all the application instances, bidding and non bidding. 

Method

GET https://platform.ironsrc.com/levelPlay/network/instances/v4/

Request Parameters

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

Request Example URL

https://platform.ironsrc.com/levelPlay/network/instances/v4/142401ac1/

Response Parameters

NameDescriptionExample
instanceIdUnique instance ID1072562
instanceNameThe instance nameRewarded50
adUnitThe ad unit type per instance (rewardedVideo, interstitial, or banner)banner
adFormatrewarded, interstitial, banner or nativeinterstitial
networkNameThe ad network the instance belongs toadColony
appConfig1 / appConfig2

For ad source app level configs naming convention refer to this section

instanceConfig1 / instanceConfig2

For ad source naming conventions refer to this article. This should be sent for each config field

isBidderthe instance a bidder instance (true or false)true
groupsAn array of group ids, as sent in the LevelPlay Groups API[2515, 6226]
isLiveInstance status can be active or inactive ‘false'
rate Instance level rate (if defined)15

Response Example 

[code-snippet lang="jsonp"]

[
  {
    "instanceId": 1072562,
    "instanceName": "",
    "adUnit": "rewardedVideo",
    "adFormat": "rewarded",
    "networkName": "unityAds",
    "appConfig1": "qtr",
    "instanceConfig1": "trb",
    "isBidder": true,
    "groups": [101663],
    "isLive": true
  },
  {
    "instanceId": 1014428,
    "instanceName": "Default",
    "adUnit": "interstitial",
    "adFormat": "interstitial",
    "networkName": "unityAds",
    "appConfig1": "qertb",
    "instanceConfig1": "qtrb",
    "isBidder": false,
    "groups": [101664],
    "isLive": true,
    "rate": 25
  },
  {
    "instanceId": 1845809,
    "instanceName": "Default",
    "adUnit": "rewardedVideo",
    "adFormat": "rewarded",
    "networkName": "adManager",
    "appConfig1": "bqw",
    "instanceConfig1": "qqr",
    "isBidder": false,
    "groups": [101663 ],
    "isLive": true,
    "rate": 4
  }
]

[/code-snippet]

CREATE 

Use this API to create instances for mediated ad sources. This API allows you to create multiple instances with a single API call. Keep in mind that when creating instances by using the API, you are limited to the number of instances the platform allows.

Use the "groups" parameter to determine each waterfall group to include/exclude instance. The "groups" ID value is reachable using the Mediation API.

  • Instances created without a ‘status' parameter set will be automatically set as ‘active'
  • Instances created for apps that are not live at the store will be automatically set as ‘inactive'
  • To create instances for mediated ad networks, refer to this article for naming convention.
  • Application configuration must have the same value for instances with the same ad network
  • For custom network instance creation, 'networkKey' parameter is required, this can be found on the network documentation

Method

POST https://platform.ironsrc.com/levelPlay/network/instances/v4/

Request Parameters

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

Request Example URL

https://platform.ironsrc.com/levelPlay/network/instances/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
instanceNameStringthe newly created instance's name ✓ - For non-bidding instanceshighestBidderinstance
networkNameString

for ad source naming convention refer to this section

adColony
adFormatStringrewarded, interstitial, banner or nativeinterstitial
isBidderBooleanIndicates if the instance is a bidder instanceTrue / False
appConfig1String

ad source application level configs naming convention, refer to this section

x‘123' / ‘abc'
appConfig2String

ad source application level configs naming convention, refer to this section

x‘123' / ‘abc'
instanceConfig1String

For ad source instance level configs naming convention, refer to this section

x‘123' / ‘abc'
instanceConfig2String

For ad source instance level configs naming convention, refer to this section

x‘123' / ‘abc'
groupsNumber ArrayIf not sent, regard as ‘all groups'. The recommended best practice is to send groupIds for both ‘A' & ‘B' groups if you're in the midst of an A/B test.x[12525]
isLiveBooleanMaking the instance active or inactive. If not sent regard as activexTrue / False
rateNumberBetween 0.01-3000x5

Request Example 

[code-snippet lang="jsonp"]

[
  {
      "instanceName": "newInstance",      
      "networkName": "unityAds",
      "adUnit": "rewardedVideo",
      "isBidder": true,
      "appConfig1": "414n",
      "instanceConfig1": "aaa1",
      "instanceConfig2": "aaa1",
      "groups": [12345],
      "isLive": true
  },
  {
      "instanceName": "newInstance_2",      
      "networkName": "unityAds",
      "adFormat": "rewarded",
      "isBidder": false,
      "appConfig1": "414n",
      "instanceConfig1": "bbb1",
      "groups": [12345],
      "isLive": true,
      "rate": 5
  }
]

[/code-snippet]

UPDATE

Use this API to update instances. Multiple instances can be updated with a single API call.

To remove instance level rate, add the rate parameter with a 'null' value. 

Method

PUT https://platform.ironsrc.com/levelPlay/network/instances/v4/

Request Parameters

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

Request Example URL

https://platform.ironsrc.com/levelPlay/network/instances/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
instanceIdNumberInstance Id as sent in the GET request
instanceNameStringthe newly created instance's name xhighestBidderinstance
appConfig1String
x‘123' / ‘abc'
appConfig2String
x‘123' / ‘abc'
instanceConfig1String

for ad source instance level configs naming convention refer to this section

x‘123' / ‘abc'
instanceConfig2String

for ad source instance level configs naming convention refer to this section

x‘123' / ‘abc'
groupsNumber ArrayIf not sent, regarded as ‘all groups'x[12525]
isLiveBooleanActive or inactive. If not sent regard as activextrue
rateNumberBetween 0.01-3000x100

Request Example

[code-snippet lang="jsonp"]

[
  {
      "instanceId": 122,
      "instanceName": "newInstance",
      "appConfig1": "414n",
      "instanceConfig1": "aaa1",
      "instanceConfig2": "aaa1",
      "groups": [1],
      "isLive": true,
      "rate": 2
  }
]

[/code-snippet]

DELETE

Use this API to delete an instance.

  • Default instances cannot be deleted.
  • Deleted instances cannot be restored.

Method

DELETE https://platform.ironsrc.com/levelPlay/network/instances/v4/

Requested Parameters

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

Request Example URL

https://platform.ironsrc.com/levelPlay/network/instances/v4/142401ac1/

Supported Parameters

NameTypeDescriptionMandatoryExample
idsArray of numberInstance IDs as sent in the GET request1458, 5769

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 instances 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-402,
            "errorMessage": "The instance name must be unique for the same ad format and network",
            "params": {
                "instanceName": "abc"
            }
        }
    ],
    "code": 400
}

[/code-snippet]

API v3 (previous version)

Instance API v3 does not support apps during a live A/B test.

Get Instances

Description Use this API to retrieve a list of all of your application's instances. The response will include all information from the Applications List API, as well as the following: instance name, instance ID, status, and pricing if relevant (pricing is only available for ironSource network instances)

Authentication Type

Bearer API authentication

Method GET platform.ironsrc.com/partners/publisher/instances/v3?

Required Parameters

NameTypeDescription
appKeyStringapplication Key (as seen on our platform)

Request Example URL

https://platform.ironsrc.com/partners/publisher/instances/v3?appKey=aa2209b1d

Response Parameters

NameDescription
appKeyapplication key (as seen on our platform)
appNamethe application name
appStatusthe application status 
platform platform can be iOS or android  
bundleIdthe native app store bundle id
creationDatethe date the app was added to ironSource platform
idunique instance ID generated by ironSource platform on instance creation
provider instance level config*

for ad source instance level configs naming convention refer to this article

namethe instance name
statusinstance status can be active or inactive 
rate instance level rate (if defined)
pricingpricing as set on the platform for ironSource network
abVersionA/B test version (optional values are: "A", "B", "N/A")

JSON Example Response

{
  "appKey": "aa2209b1d",
  "appName": "My Test App",
  "appStatus": "active",
  "platform": "Android",
  "bundleId": "com.test.app",
  "creationDate": "N/A",
  "adUnits": {
    "rewardedVideo": {
      "activeNetworks": [
        "ironSource",
        "AdColony"
      ],
      "activeBidderNetworks": [
        ""
      ],
      "networkInstances": {
        "ironSource": [
          {
            "id": 0,
            "name": "Default",
            "status": "active",
            "pricing": [
              {
                "eCPM": "10.5",
                "Countries": [
                  "FR",
                  "UK"
                ]
              }
            ],
            "abVersion": "N/A"
          }
        ],
        "AdColony": [
          {
            "id": 0,
            "zoneId": "zone_ID_US_High",
            "name": "US_high",
            "status": "active",
            "rate": 87,
            "abVersion": "N/A"
          },
          {
            "id": 2851429,
            "zoneId": "zone_ID_US_Low",
            "name": "US_Low",
            "status": "active",
            "rate": 12,
            "abVersion": "N/A"
          }
        ]
      },
      "networkBidderInstances": []
    },
    "offerWall": {
      "activeNetworks": [
        "ironSource"
      ]
    },
    "interstitial": {
      "activeNetworks": [],
      "activeBidderNetworks": [],
      "networkInstances": {
        "ironSource": [
          {
            "id": 0,
            "name": "Default",
            "status": "inactive",
            "pricing": [
              {
                "eCPM": "8.5",
                "Countries": [
                  "FR",
                  "UK"
                ]
              }
            ],
            "abVersion": "N/A"
          }
        ]
      },
      "networkBidderInstances": []
    },
    "banner": {
      "activeNetworks": [],
      "networkInstances": {
        "ironSource": [
          {
            "id": 0,
            "name": "Default",
            "status": "inactive",
            "abVersion": "N/A"
          }
        ]
      }
    }
  }
}

Create Instances

Use this API to create instances for both ironSource network and mediated ad sources. This API allows you to create multiple instances with a single API call.

  • Instances created without a 'status' parameter set will be automatically set as 'active'
  • Instances created for apps that are not live at the store will be automatically set as 'inactive'
  • For Mediation users - each newly created instance will be included in all of the app's mediation groups.
  • Each app is limited up to 10 instances per ad unit. To extend this limitation, contact support or contact your Account Manager.
  • To create instances for mediated ad sources, refer to this article for naming convention.
  • To create bidder networks, contact support or contact your Account Manager.

CPM pricing:

General

  1. CPM Pricing allows you the control and flexibility to define expected CPM rates from ironSource's network. Read more here.
  2. CPM pricing is available for specific accounts only. To activate CPM pricing, contact support or contact your Account Manager.
  3. For best practices on using instances with pricing go to our Best Practices article.

Notes

  1. In order to set global pricing for an instance, populate the instance's country field with asterisk character ‘*'.
  2. Instances created without pricing and countries without defined pricing will be set to use optimized pricing.
  3. Countries are defined based on 2 letter country code, as per ISO 3166-1 Alpha-2.

Authentication Type

Bearer API authentication

Method

POST platform.ironsrc.com/partners/publisher/instances/v3?

Required Parameters

NameTypeDescription
appKeyStringapplication Key (as seen on our platform)
providerString array

for ad source naming convention refer to this article

adUnitString array"rewardedVideo", "interstitial", "banner"
instanceNameStringthe newly created instance's name 
provider instance level config*String

for ad source instance level configs naming convention refer to this article

Optional Parameters

NameTypeDescription
statusStringinstance status can be 'active' or 'inactive'
pricingString arraydetermine the eCPM to be delivered by ironSource network
rateDoubleinstance level rate (if defined)
provider app level configs*String

for ad source app level configs naming convention refer to this article

Request Example URL

https://platform.ironsrc.com/partners/publisher/instances/v3?

Request Example Body

[code-snippet lang="jsonp"]

{
  "appKey": "d11a21a5",
  "configurations": {
    "ironSource": {
      "interstitial": [
        {
          "instanceName": "low_interstitial",
          "status": "active",
          "pricing": [
            {
              "country": [
                "FR",
                "DE"
              ],
              "eCPM": 3
            }
          ],
          "pricingType": "eCPM"
        },
        {
          "instanceName": "high_interstitial",
          "status": "active",
          "pricing": [
            {
              "country": [
                "IL",
                "US"
              ],
              "eCPM": 20
            }
          ]
        }
      ]
    },
    "adColony": {
      "rewardedVideo": [
        {
          "instanceName": "adcolony_rv",
          "status": "active",
          "zoneId": 102030,
          "rate": 10
        }
      ]
    }
  }
}

[/code-snippet]

JSON Example Response

[code-snippet lang="jsonp"]

{
  "rewardedVideo": {
    "AdColony": [
      {
        "id": 6701121,
        "zoneId": "102030",
        "name": "adcolony_rv",
        "status": "active",
        "rate": 10,
        "abVersion": "N/A"
      }
    ]
  },
  "interstitial": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "active",
        "abVersion": "N/A"
      },
      {
        "id": 6701117,
        "name": "low_interstitial",
        "status": "active",
        "abVersion": "N/A",
        "pricing": [
          {
            "eCPM": 3,
            "Countries": [
              "FR",
              "DE"
            ]
          }
        ]
      },
      {
        "id": 6701119,
        "name": "high_interstitial",
        "status": "active",
        "abVersion": "N/A",
        "pricing": [
          {
            "eCPM": 20,
            "Countries": [
              "IL",
              "US"
            ]
          }
        ]
      }
    ],
    "ironSourceBidding": [
      {
        "id": 2948695,
        "name": "",
        "status": "inactive",
        "abVersion": "N/A"
      }
    ]
  }
}

[/code-snippet]

Update Instances

Use this API to update instance name, status and pricing for ironSource network and mediation ad sources (pricing is only available for ironSource network). Multiple instances can be updated with a single API call.

  • Max number of update calls is limited to 6 per day.
  • In order to activate ironSource's non default instances you must first activate ironSource's default instance (instance ID=0).
  • Updating instance pricing will replace all pricing values on that same instance only.
  • To update mediation ad source instances, refer to this article for naming convention.
  • To update bidder networks, contact support or reach out to your Account Manager.
  • To remove instance level rate, add the rate parameter with an empty string value (eg "")

Authentication Type

Bearer API authentication

Method

PUT platform.ironsrc.com/partners/publisher/instances/v3?

Required Parameters

NameTypeDescription
appKeyString Application Key (as seen on our platform)
providerString array

For ad source naming convention refer to this article

adUnitString array"rewardedVideo", "interstitial", "banner"
instanceIdStringID generated by ironSource platform on instance creation

Optional Parameters

NameTypeDescription
nameStringthe desired instance's name
pricingStringdetermine the eCPM to be delivered by ironSource network
statusStringinstance status can be 'active' or 'inactive'
rateDoubleinstance level rate (if defined)
provider instance level config*String

for ad source instance level configs naming convention refer to this article

provider app level config*String

for ad source app level configs naming convention refer to this article

Request Example URL

https://platform.ironsrc.com/partners/publisher/instances/v3?

Request Body Example

{
  "appKey": "6bc83099",
  "configurations": {
    "ironSourceBidding": {
      "rewardedVideo": [
        {
          "instanceId": 327,
          "status": "inactive"
        }
      ]
    }
  }
}

JSON Response Example

{
  "rewardedVideo": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "inactive",
        "abVersion": "N/A"
      }
    ],
    "AdColony": [
      {
        "id": 0,
        "name": "default",
        "status": "active",
        "abVersion": "N/A"
      },
      {
        "id": 326,
        "name": "lw",
        "status": "inactive",
        "rate":"2",
        "abVersion": "N/A"
      }
    ],
    "ironSourceBidding": [
      {
        "id": 327,
        "name": "-",
        "status": "inactive",
        "abVersion": "N/A"
      }
    ]
  },
  "interstitial": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "active",
        "abVersion": "N/A"
      }
    ]
  },
  "banner": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "inactive",
        "abVersion": "N/A"
      }
    ]
  }
}

Delete Instance

Description

Use this API to delete an instance.

General notes:

  1. Can delete one instance per call.
  2. Default instance cannot be deleted.
  3. Deleted instance cannot be restored.
  4. Response includes all of the app's instances excluding the deleted ones.

Authentication Type

Bearer API authentication

Method

DELETE platform.ironsrc.com/partners/publisher/instances/v3?

Required Parameters

NameTypeDescription
appKeyStringapplication Key (as seen on our platform)
instanceIdStringID generated by ironSource platform on instance creation

Request Example URL

http://platform.ironsrc.com/partners/publisher/instances/v3?appKey=6e9e4c11&instanceId=12345

JSON Response Example

{
  "rewardedVideo": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "active"
      },
      {
        "id": 45678,
        "name": "thirdRVInstance",
        "status": "inactive"
      }
    ]
  },
  "interstitial": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "active"
      },
      {
        "id": 23456,
        "name": "secondISInstance",
        "status": "active",
        "pricing": [
          {
            "eCPM": "0.01",
            "Countries": [
              "FR",
              "UK"
            ]
          }
        ]
      }
    ]
  },
  "banner": {
    "ironSource": [
      {
        "id": 0,
        "name": "Default",
        "status": "inactive"
      }
    ]
  }
}