Page tree


Targeting presets are used as templates for defining targeting criteria. Modifying an existing preset will not impact line items that have already used this preset. You can save targeting presets (templates), which can be uses at a later point for quickly defining targeting criteria for a new line item. There is a single end-point to configure and save all types of targets in a preset template. 

Before using PubMatic APIs, first generate the API Token. For more information, see Getting Started with PubMatic APIs .

Supported Operations

Service Name: /presets/

Method PathHTTP MethodDescriptionLink to Definition
/presets/
POST
Add a new preset templateCreate a Preset
/presets/
GET
Retrieve a List of PresetsRetrieving a List of Presets
/presets/{id}
GET
Retrieve the preset details for a specific idRetrieve the Details of a Preset
/presets/{id}
PUT
Update and existing templateUpdate a Preset
/presets/{id}
PATCH
Perform a partial updates on preset. Using PATCH operations, you can only update name, description and status. Update (Patch) a Preset
/presets/{id}
DELETE
Archives the preset.Delete a Preset


Create a Preset

This API enables you to create a Preset Template.

Request

Request Headers

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, see Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

Sample Request URL

https://api.pubmatic.com/v1/uas/presets  

Sample JSON Request

Note: 

  1. On 'date' you have to list all targeting types in the request JSON. Add empty targets:[ ]  if that targeting type is not intended. If any targeting is missing in json it will give validation error. This is done for simplicity and consistency with configuration protocol.
  2. API is Transactional, which means that if there is a failure in any of the targeting nothing should be saved.
  3. At a granular level each targeting should contain only the three parameters {targetValue, targetLevel, exclude}.  If any extra parameter is preset in the post body during update / create is given, will result in an error.



{
    "account": {
        "id": 118385
    },
    "name": "test preset 1",
    "user": {
        "id": 1
    },
    "status": {
        "id": 1
    },
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": [{
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 94,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 95,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                "exclude": false,
                "targetLevel": 1
            }]
               },
                "audiences":{
                "targets":[]
          }
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


To remove all os targeting from preset, give targets [ ] for "os"

{
    "account": {
        "id": 118385
    },
    "name": "test preset 1",
    "user": {
        "id": 1
    },
    "status": {
        "id": 1
    },
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": []
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                    "exclude": false,
                    "targetLevel": 1
            }]
        },
                    "audiences":{
                    "targets":[]
        }
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Response

Sample Response JSON

{
  "presetTargets": {
    "geo": {
      "targets": [
        {
          "targetValue": 118205,
          "exclude": false,
          "targetLevel": 3,
          "countryCode": "US",
          "regionCode": "MI",
          "cityName": "Eckerman",
          "name": "Eckerman"
        },
        {
          "targetValue": 4,
          "exclude": false,
          "targetLevel": 1,
          "countryCode": "AE",
          "name": "United Arab Emirates"
        }
      ]
    },
    "deviceType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 2,
          "deviceType": "Smart Phone"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 1,
          "deviceType": "Feature Phone"
        }
      ]
    },
    "deviceScreenResolution": {
      "targets": []
    },
    "hyperLocal": {
      "targets": []
    },
    "hyperLocalDataSource": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "browserLanguage": {
      "targets": [
        {
          "targetValue": 45,
          "exclude": false,
          "targetLevel": 1,
          "name": "Armenian"
        },
        {
          "targetValue": 97,
          "exclude": false,
          "targetLevel": 1,
          "name": "Albanian"
        }
      ]
    },
    "deviceCapability": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 1,
          "deviceCapabilityName": "Phone calls"
        },
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 6,
          "deviceCapabilityName": "NFC support"
        }
      ]
    },
    "os": {
      "targets": []
    },
    "browser": {
      "targets": [
        {
          "targetValue": 5,
          "exclude": false,
          "targetLevel": 1,
          "name": "Chrome"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "Firefox"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "IE"
        }
      ]
    },
    "ipRange": {
      "targets": []
    },
    "inventory": {
      "targets": [
        {
          "exclude": false,
          "targetLevel": -1,
          "name": "Run of Network"
        }
      ]
    },
    "connectionType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "WiFi"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "Cellular"
        },
        {
          "targetValue": 3,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "device": {
      "targets": [
        {
          "targetValue": 536,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Asus",
          "make": "Asus"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Apple",
          "make": "Apple"
        },
        {
          "targetValue": 556,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Barnes and Noble",
          "make": "Barnes and Noble"
        }
      ]
    },
    "zip": {
      "targets": [
        {
          "targetValue": {
            "code": "411038",
            "countryCode": "IN"
          },
          "exclude": true,
          "targetLevel": 5,
          "country": "India",
          "regionName": "Maharashtra",
          "city": "Pune",
          "code": "411038",
          "countryCode": "IN"
        },
        {
          "targetValue": {
            "code": "ai2640",
            "countryCode": "AI"
          },
          "exclude": false,
          "targetLevel": 5,
          "country": "Anguilla",
          "regionName": "Anguilla",
          "city": "The Valley",
          "code": "ai2640",
          "countryCode": "AI"
        }
      ]
    },
    "customKey": {
      "targets": [
        {
          "targetValue": {
            "customKey": {
              "id": 1,
              "name": "Gender",
              "status": {
                "id": 1
              }
            },
            "operator": {
              "id": 1,
              "name": "IS"
            },
            "customValue": {
              "value": "Female"
            },
            "groupId": 1,
            "setId": 1
          },
           "exclude": false,
          "targetLevel": 1
        }
      ]
    },
          "audiences":{
          "targets":[]
    }
  },
          "account": {
          "id": 118385,
          "name": "Account 118385"
  },
          "id": 1654,
          "user": {
          "id": 18321
  },
          "status": {
          "id": 1,
          "name": "Active"
  },
         "name": "test preset 1"
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Retrieving a List of Presets

This API enables you to retrieve a list of Presets.

Request

Request Headers

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

Parameter Name Type Required Validations Description
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

    

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/

Response

Sample Response JSON

{
    "metaData": {
        "startIndex": 1,
        "totalRecords": 3,
        "endIndex": 3
    },
    "items": [
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 118385,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 274,
            "name": "test preset 1",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        },
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 1,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 276,
            "name": "test preset 2",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        },
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 118385,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 277,
            "name": "test preset 3",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        }
    ]
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Retrieve the Details of a Preset

This API enables you to retrieve the details for a Preset Template.

Request

Request Headers

Header name Type  Value Required Description
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.                               

Parameter Name Type Required Validations Description
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

    

 Sample Request URL

https://api.pubmatic.com/v1/uas/presets/1654 

Response

Sample Response JSON

{
  "presetTargets": {
    "deviceType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 2,
          "deviceType": "Smart Phone"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 1,
          "deviceType": "Feature Phone"
        }
      ]
    },
    "zip": {
      "targets": [
        {
          "targetValue": {
            "code": "411038",
            "countryCode": "IN"
          },
          "exclude": true,
          "targetLevel": 5,
          "country": "India",
          "regionName": "Maharashtra",
          "city": "Pune",
          "code": "411038",
          "countryCode": "IN"
        },
        {
          "targetValue": {
            "code": "ai2640",
            "countryCode": "AI"
          },
          "exclude": false,
          "targetLevel": 5,
          "country": "Anguilla",
          "regionName": "Anguilla",
          "city": "The Valley",
          "code": "ai2640",
          "countryCode": "AI"
        }
      ]
    },
    "customKey": {
      "targets": [
        {
          "targetValue": {
            "customKey": {
              "id": 1,
              "name": "Gender",
              "status": {
                "id": 1
              }
            },
            "operator": {
              "id": 1,
              "name": "IS"
            },
            "customValue": {
              "value": "Female"
            },
            "groupId": 1,
            "setId": 1
          },
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "browserLanguage": {
      "targets": [
        {
          "targetValue": 45,
          "exclude": false,
          "name": "Armenian"
        },
        {
          "targetValue": 97,
          "exclude": false,
          "name": "Albanian"
        }
      ]
    },
    "deviceCapability": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 1,
          "deviceCapabilityName": "Phone calls"
        },
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 6,
          "deviceCapabilityName": "NFC support"
        }
      ]
    },
    "os": {
      "targets": [
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "osTypeId": 1,
          "osName": "iOS"
        },
        {
          "targetValue": 94,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 2,
          "osName": "Android 2.2",
          "verMajor": "2.2"
        },
        {
          "targetValue": 95,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 14,
          "osName": "Bada OS 1.2",
          "verMajor": "1.2"
        }
      ]
    },
    "deviceScreenResolution": {
      "targets": []
    },
    "hyperLocalDataSource": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "ipRange": {
      "targets": []
    },
    "inventory": {
      "targets": [
        {
          "exclude": false,
          "targetLevel": -1,
          "name": "Run of Network"
        }
      ]
    },
    "connectionType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "WiFi"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "Cellular"
        },
        {
          "targetValue": 3,
          "exclude": false
        }
      ]
    },
    "hyperLocal": {
      "targets": []
    },
    "geo": {
      "targets": [
        {
          "targetValue": 118205,
          "exclude": false,
          "targetLevel": 3,
          "countryCode": "US",
          "regionCode": "MI",
          "cityName": "Eckerman",
          "name": "Eckerman"
        },
        {
          "targetValue": 4,
          "exclude": false,
          "targetLevel": 1,
          "countryCode": "AE",
          "name": "United Arab Emirates"
        }
      ]
    },
    "browser": {
      "targets": [
        {
          "targetValue": 5,
          "exclude": false,
          "name": "Chrome"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "name": "Firefox"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "name": "IE"
        }
      ]
    },
    "device": {
      "targets": [
        {
          "targetValue": 536,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Asus",
          "make": "Asus"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Apple",
          "make": "Apple"
        },
        {
          "targetValue": 556,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Barnes and Noble",
          "make": "Barnes and Noble"
        }
      ]
     },
    "audiences":{
        "targets":[]
    }
  },
 
  },
  "account": {
    "id": 118385,
    "name": "Account 118385 (Phoenix Beta)"
  },
  "id": 1654,
  "user": {
    "id": 18321
  },
  "status": {
    "id": 1,
    "name": "Active"
  },
  "name": "test preset 1"
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Update a Preset

This API enables you to update an existing Preset Template.

Request

Request Headers

Header name Type  Value Required Description
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

Parameter Name Type Required Validations Description
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

    

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/1654 

Sample JSON Request

If a target category is not meant to be targeted, you must leave empty. If Preset does not have any IP-bases Targeting you can pass the following:  "ipRange": {"targets": []}
{
    "account": {
        "id": 118385
    },
    "name": "test preset 1",
    "user": {
        "id": 1
    },
    "status": {
        "id": 1
    },
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": [{
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 94,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 95,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                
                    "exclude": false,
                    "targetLevel": 1
            }]
        },
                "audiences":{
                    "targets":[]

          }
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Response

Sample Response JSON

{
  "presetTargets": {
    "geo": {
      "targets": [
        {
          "targetValue": 118205,
          "exclude": false,
          "targetLevel": 3,
          "countryCode": "US",
          "regionCode": "MI",
          "cityName": "Eckerman",
          "name": "Eckerman"
        },
        {
          "targetValue": 4,
          "exclude": false,
          "targetLevel": 1,
          "countryCode": "AE",
          "name": "United Arab Emirates"
        }
      ]
    },
    "deviceType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 2,
          "deviceType": "Smart Phone"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 1,
          "deviceType": "Feature Phone"
        }
      ]
    },
    "deviceScreenResolution": {
      "targets": []
    },
    "hyperLocal": {
      "targets": []
    },
    "hyperLocalDataSource": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "browserLanguage": {
      "targets": [
        {
          "targetValue": 45,
          "exclude": false,
          "targetLevel": 1,
          "name": "Armenian"
        },
        {
          "targetValue": 97,
          "exclude": false,
          "targetLevel": 1,
          "name": "Albanian"
        }
      ]
    },
    "deviceCapability": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 1,
          "deviceCapabilityName": "Phone calls"
        },
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 6,
          "deviceCapabilityName": "NFC support"
        }
      ]
    },
    "os": {
      "targets": [
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "osTypeId": 1,
          "osName": "iOS"
        },
        {
          "targetValue": 94,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 2,
          "osName": "Android 2.2",
          "verMajor": "2.2"
        },
        {
          "targetValue": 95,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 14,
          "osName": "Bada OS 1.2",
          "verMajor": "1.2"
        }
      ]
    },
    "browser": {
      "targets": [
        {
          "targetValue": 5,
          "exclude": false,
          "targetLevel": 1,
          "name": "Chrome"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "Firefox"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "IE"
        }
      ]
    },
    "ipRange": {
      "targets": []
    },
    "inventory": {
      "targets": [
        {
          "exclude": false,
          "targetLevel": -1,
          "name": "Run of Network"
        }
      ]
    },
    "connectionType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "WiFi"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "Cellular"
        },
        {
          "targetValue": 3,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "device": {
      "targets": [
        {
          "targetValue": 536,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Asus",
          "make": "Asus"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Apple",
          "make": "Apple"
        },
        {
          "targetValue": 556,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Barnes and Noble",
          "make": "Barnes and Noble"
        }
      ]
    },
    "zip": {
      "targets": [
        {
          "targetValue": {
            "code": "411038",
            "countryCode": "IN"
          },
          "exclude": true,
          "targetLevel": 5,
          "country": "India",
          "regionName": "Maharashtra",
          "city": "Pune",
          "code": "411038",
          "countryCode": "IN"
        },
        {
          "targetValue": {
            "code": "ai2640",
            "countryCode": "AI"
          },
          "exclude": false,
          "targetLevel": 5,
          "country": "Anguilla",
          "regionName": "Anguilla",
          "city": "The Valley",
          "code": "ai2640",
          "countryCode": "AI"
        }
      ]
    },
    "customKey": {
      "targets": [
        {
          "targetValue": {
            "customKey": {
              "id": 1,
              "name": "Gender",
              "status": {
                "id": 1
              }
            },
            "operator": {
              "id": 1,
              "name": "IS"
            },
            "customValue": {
              "value": "Female"
            },
            "groupId": 1,
            "setId": 1
          },
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
        "audiences":{
         "targets":[]
    }
  },
  },
  "account": {
    "id": 118385,
    "name": "Account 118385"
  },
  "id": 1654,
  "user": {
    "id": 18321
  },
  "status": {
    "id": 1,
    "name": "Active"
  },
  "name": "test preset 1"
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Update (Patch) a Preset

This API enables you to perform a patch update an existing Preset Template.

Request

Request Headers

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/1654

Sample JSON Request

Preset patch is supported on status, name and description.
{
"status" : {
"id": 2
},
"description" : "Test Preset Patch"
}

Response

Sample Response JSON

{
    "account": {
        "id": 118385,
           "name": "Account 118385"
      },
    "id": 1654,
    "user": {
        "id": 18321
    },
    "status": {
        "id": 2,
        "name": "Inactive"
    }, 
    "name": "test preset 1",
    "description": "Test Preset Patch",
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": [{
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 94,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 95,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "audiences":{
            "targets":[]
        }
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Delete a Preset

This API enables you to delete (archive) a Preset

Request

Request Headers

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of Bearer ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/1654 

Response

Sample Response

Returns 'true' if archive is successful; 'false' if unsuccessful.

Error Codes for Preset Targeting

Sr. NoError CodesDescription
1.PH_MISSING_OR_INVALID_PARAMETER

This error occurs for following conditions:

  1. any target object contains NULL or empty target value.
  2. any target object contains NULL or empty target level
  3. any target type is missed
  4. any nested entity in target object have invalid id.
    e.g invalid custom key id
  5. invalid account id
2.PH_ONLY_X_CHARACTERS_ARE_ALLOWEDThis error occurs when preset name contains character which are not allowed.
3.PH_PARAMETER_VALUE_TOO_LARGEThis error occurs when the preset name is too large.
4.PH_DUPLICATE_ENTITYThis error occurs when a preset already exists with the same name.
5.PH_UNSUPPORTED_VALUE_MSGThis error occurs when a user tries to update a preset with an unsupported status.
6.PH_ATTEMPT_TO_UPDATE_RESTRICTED_FIELD_IN_STATUS_MSGThis error occurs when a user tries to do a PUT operation on an archived preset.
7.PH_LI_DISABLED_AUDIENCE_FOR_TARGETThis error occurs if a user tries to target a disabled audience for the line item.



⇧ Top