Skip to content

Campaigns API (xx.xx.xx)

MediaMath Platform API

Download OpenAPI description
Languages
Servers
Live Server

https://api.mediamath.com/api/v3.0/

Operations
Operations
Operations
Operations

Campaigns Budget Flights

Campaigns Budget Flights

Operations
Operations
Operations

Strategy Parameters

Strategy Parameters

Operations

Strategy Templates

Strategy Templates

Operations

New Strategy Plans

New Strategy Plans

Operations
Operations

Targeting Attachments

TargetingAttachments

Operations

Targeting Segments

Targeting Segments

Operations

Targeting Segment Objectives

Targeting Segment Objectives

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations

Enterprise Controls

Enterprise Controls

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations

Request

Create a segment group

Security
Auth0
Bodyapplication/json
namestring[ 1 .. 256 ] charactersrequired
typestringrequired
Enum"CONTEXTUAL""AUDIENCE"
organization_idinteger(int32)required
statusbooleanrequired
segment_subgroupArray of objectsrequired
segment_subgroup[].​segment_operatorstringrequired
Enum"AND""OR"
segment_subgroup[].​segment_membersArray of objectsrequired
segment_subgroup[].​segment_members[].​segment_idinteger(int32)required
segment_subgroup[].​segment_members[].​segment_typestringrequired
Enum"CONTEXTUAL""3P"
curl -i -X POST \
  https://api.mediamath.com/api/v3.0/segment_groups \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "type": "CONTEXTUAL",
    "organization_id": 0,
    "status": true,
    "segment_subgroup": [
      {
        "segment_operator": "AND",
        "segment_members": [
          {
            "segment_id": 0,
            "segment_type": "CONTEXTUAL"
          }
        ]
      }
    ]
  }'

Responses

Audience group response

Bodyapplication/json
dataobject
metaobject(single_metadata)
Response
application/json
{ "data": { "name": "My Audience Group", "type": "CONTEXTUAL", "organization_id": 1234, "status": true, "segment_subgroup": [] }, "meta": { "status": "success" } }

Request

Get a list of segment groups

Security
Auth0
Query
page_limitinteger[ 1 .. 1000 ]

Number of elements in the collection to retrieve

Example: page_limit=100
page_offsetinteger[ 0 .. 1000 ]

Index of the first element in the collection to retrieve

Example: page_offset=0
sort_bystring

The field to sort by. You can use any field name in ascending or descending order. For ascending order, use the field name directly, e.g., id. For descending order, prefix the field name with a hyphen (-), e.g., -id.

Example: sort_by=id, -id, name, -name
qstring

Query search for filtering. This parameter can be used to filter results based on various fields.

  • q=name=:{search}* to find all results with names starting with "search".
  • q=status==true to find all active entities.
  • q=id>=1000 to find all entities with id greater than or equal to 1000.
  • q=id==(1,2,3) find specific entities by ID.
extendedboolean

Get extended properties in response

currency_codestring= 3 characters

Optional currency code to return segment group members in a specific currency. If not provided or not found, the default currency (USD) will be used.

Example: currency_code=USD
curl -i -X GET \
  'https://api.mediamath.com/api/v3.0/segment_groups?page_limit=100&page_offset=0&sort_by=id%2C+-id%2C+name%2C+-name&q=string&extended=true&currency_code=USD' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Audience group collection response

Bodyapplication/json
dataArray of objects
metaobject(pagination metadata)
Response
application/json
{ "data": [ {} ], "meta": { "status": "success", "count": 10, "total_count": 100, "offset": 0, "next_page": "string", "prev_page": "string" } }

Request

Update a segment group by ID

Security
Auth0
Path
segment_group_idintegerrequired

Numeric ID of the segment group to update

Bodyapplication/json
namestring[ 1 .. 256 ] characters
typestring
Enum"CONTEXTUAL""AUDIENCE"
organization_idinteger(int32)
statusboolean
segment_subgroupArray of objects
curl -i -X POST \
  'https://api.mediamath.com/api/v3.0/segment_groups/{segment_group_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "type": "CONTEXTUAL",
    "organization_id": 0,
    "status": true,
    "segment_subgroup": [
      {
        "segment_operator": "AND",
        "segment_members": [
          {
            "segment_id": 0,
            "segment_type": "CONTEXTUAL"
          }
        ]
      }
    ]
  }'

Responses

Audience group response

Bodyapplication/json
dataobject
metaobject(single_metadata)
Response
application/json
{ "data": { "name": "My Audience Group", "type": "CONTEXTUAL", "organization_id": 1234, "status": true, "segment_subgroup": [] }, "meta": { "status": "success" } }

Request

Get a segment group by ID

Security
Auth0
Path
segment_group_idintegerrequired

Numeric ID of the segment group to retrieve

Query
extendedboolean

Get extended properties in response

currency_codestring= 3 characters

Optional currency code to return segment group members in a specific currency. If not provided or not found, the default currency (USD) will be used.

Example: currency_code=USD
curl -i -X GET \
  'https://api.mediamath.com/api/v3.0/segment_groups/{segment_group_id}?extended=true&currency_code=USD' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Audience group response

Bodyapplication/json
dataobject
metaobject(single_metadata)
Response
application/json
{ "data": { "name": "My Audience Group", "type": "CONTEXTUAL", "organization_id": 1234, "status": true, "segment_subgroup": [] }, "meta": { "status": "success" } }

Request

Get a list of changes to this segment group

Security
Auth0
Path
segment_group_idintegerrequired

Numeric ID of the segment group

Query
page_limitinteger[ 1 .. 1000 ]

Number of elements in the collection to retrieve

Example: page_limit=100
page_offsetinteger[ 0 .. 1000 ]

Index of the first element in the collection to retrieve

Example: page_offset=0
curl -i -X GET \
  'https://api.mediamath.com/api/v3.0/segment_groups/{segment_group_id}/history?page_limit=100&page_offset=0' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Audit log response

Bodyapplication/json
dataArray of objects or null
metaobject(pagination metadata)
Response
application/json
{ "data": [ {} ], "meta": { "status": "success", "count": 10, "total_count": 100, "offset": 0, "next_page": "string", "prev_page": "string" } }

Request

Get all assignments for a specific segment group

Security
Auth0
Path
segment_group_idintegerrequired

Numeric ID of the segment group to retrieve assignments for

Query
page_limitinteger[ 1 .. 1000 ]

Number of elements in the collection to retrieve

Example: page_limit=100
page_offsetinteger[ 0 .. 1000 ]

Index of the first element in the collection to retrieve

Example: page_offset=0
curl -i -X GET \
  'https://api.mediamath.com/api/v3.0/segment_groups/{segment_group_id}/assignments?page_limit=100&page_offset=0' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Audience group assignments response

Bodyapplication/json
dataArray of objects
metaobject(pagination metadata)
Response
application/json
{ "data": [ {} ], "meta": { "status": "success", "count": 10, "total_count": 100, "offset": 0, "next_page": "string", "prev_page": "string" } }