Skip to content

Update Permission Taxonomy

Request

With a taxonomy ID (obtained from creating a new taxonomy), you can update the taxonomy, change permissions, and add or remove audience segments.

NOTE: you must always post the entire taxonomy when updating a taxonomy.

To ensure that the entire taxonomy is correct, we recommend updates be done as a 3-step process:

  1. GET the existing taxonomy (see example API response with definitions)
  2. Identify & make changes (i.e. add/edit permissions, add/remove leaf nodes, change retail CPMs, etc)
  3. POST the updated taxonomy
Security
OAuth2
Path
taxonomy_idstringrequired

taxonomy_id

Headers
Content-Typestringrequired

_

Bodyapplication/json

_

audience_vendor_idintegerrequired
permissionsobject
taxonomyobjectrequired
use_hashboolean

If you are using a segment code that is not a 32-bit integer, you'd have to pass an optional parameter use_hash:true as part of the JSON body.

Default:false
POST
/audience_segments/{taxonomy_id}
curl -i -X POST \
  'https://api.mediamath.com/dmp/v2.0/audience_segments/{taxonomy_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "audience_vendor_id": 0,
    "permissions": {
      "advertisers": [
        0
      ],
      "agencies": [
        0
      ],
      "organizations": [
        0
      ]
    },
    "taxonomy": {
      "children": [
        {
          "buyable": true,
          "children": [
            {
              "buyable": true,
              "children": [
                {}
              ],
              "code": 0,
              "id": 0,
              "name": "string",
              "retail_cpm": 0,
              "uniques": 0,
              "wholesale_cpm": 0
            }
          ],
          "id": 0,
          "name": "string"
        }
      ],
      "description": "string",
      "id": 0
    },
    "use_hash": false
  }'

Responses

Bodyapplication/json
dataobject
metaobject
Response
{ "data": { "audience_vendor_id": 470, "created_by": null, "created_on": "2017-03-22T19:36:05Z", "permissions": {}, "revenue_share_pct": 0, "taxonomy": {}, "taxonomy_id": 100001, "updated_by": 14571, "updated_on": "2018-06-15T14:55:51Z", "visibility": "RESTRICTED" }, "meta": { "status": "success" } }