--- title: "Segment Targeting" slug: "segment-targeting" updated: 2026-03-27T21:39:17Z published: 2026-03-27T21:39:17Z canonical: "help.yahooinc.com/segment-targeting" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.yahooinc.com/llms.txt > Use this file to discover all available pages before exploring further. # Segment Targeting The Yahoo DSP supports include and exclude conditions for `SEGMENT` targeting for all line types. ## Endpoint ### Read Segments The Yahoo DSP API provides an endpoint for reading the segments available for targeting: ```plaintext GET /traffic/targeting/availablesegments ``` ### Read Targeted Segments The Yahoo DSP API provides an endpoint for identifying the segments currently targeted by a line. ```plaintext GET /traffic/lines/{id}/targeting ``` To learn more, refer to [Read Line Targeting](/dsp-api/docs/about-targeting#read-line-targeting). ### Target Segments The Yahoo DSP API provides a single endpoint to add, update, remove, and clear the segments targeted by a line. ```plaintext POST /traffic/lines/{id}/targeting ``` This is the same endpoint that is used for all targeting operations. The line ID must be specified in the endpoint path. All other parameters are specified in the body of the `application/json` payload. To learn more, refer to [About Targeting](/dsp-api/docs/about-targeting). ## Resources ### Targeting Object The `targeting` resource is the standard Yahoo DSP resource for targeting consumers based on their profiles, behaviors, and ad content. | **Parameter** | **Parameter Type** | **Definition** | **Data Type** | **Required** | | --- | --- | --- | --- | --- | | `id` | path | Specifies the line ID. | `integer` | Y | | `segments` | body | Specifies an array of segments to include in or exclude from line targeting. To learn more, refer to [Segments Object](/dsp-api/docs/segment-targeting#segments-object). | `array` | Y | | `segmentsIncluded` | body | A read-only array that displays the segments included in targeting. To learn more, refer to [Segments Included Object](/dsp-api/docs/segment-targeting#segments-included-object). | `array` | N/A | | `segmentsExcluded` | body | A read-only array that displays the segments excluded from targeting. To learn more, refer to [Segments Excluded Object](/dsp-api/docs/segment-targeting#segments-excluded-object). | `array` | N/A | | `types` | body | Specifies an array of targeting types to update, enable, or disable. `SEGMENT` targeting type must be specified to apply the changes. Optional `CROSS_DEVICE_ID_ESCALATION` type can also be used to enable probabilistic cross device extension. To learn more, refer to [Targeting Types](/dsp-api/docs/about-targeting#targeting-types). | `array` | Y | > [!NOTE] > Note > > For a complete list of `targeting` resource fields, refer to [About Targeting](/dsp-api/docs/about-targeting). ### Segments Object The segments payload object enables [adding or updating segment targeting](/dsp-api/docs/segment-targeting#addupdate-segment-targeting) for a line. | **Field** | **Description** | **Data Type** | | --- | --- | --- | | `id` | Specifies the line ID. | `integer` | | `types` | Specifies the targeting types to enable or modify. To learn more, refer to [Targeting Types](/dsp-api/docs/about-targeting#targeting-types). | `array` | | `added` | An array of segments to target. This is an array of objects containing the following required fields: - `entityId` - Specifies the segment ID. - `excluded` - Indicates whether the added segments are to be excluded or included. If `true`, exclude from targeting. If `false`, include in targeting. - `group` - Specifies the group of audience. Note: This is an optional field. Defaults to `Group A` if a value is not specified. - `Group A` - `Group B` - For an example, refer to [Add/Update Segment Targeting](/dsp-api/docs/segment-targeting#addupdate-segment-targeting). | `array` | | `edited` | An array of existing segments/audiences to change. This is an array of objects containing the following fields: - `entityId` - ID of the Segment to be changed. - `excluded` - Indicates if the edited IDs are to be excluded or included. `true` - exclude from targeting; `false` - include in targeting. - `group` - Specifies the group of audience. Note: This is an optional field. Defaults to `Group A` if a value is not specified. - `Group A` - `Group B` - For an example, refer to [Add/Update Segment Targeting](/dsp-api/docs/segment-targeting#addupdate-segment-targeting). | `array` | | `removed` | An array of segment IDs to be removed from targeting. For an example, refer to [Add/Update Segment Targeting](/dsp-api/docs/segment-targeting#addupdate-segment-targeting). | `array` | | `clearAll` | Indicates if all existing segments should be removed. By default, `false`. - If `true`, remove all targeted segments. - If `false`, do not remove any targeted segments. For an example, refer to [Add/Update Segment Targeting](/dsp-api/docs/segment-targeting#addupdate-segment-targeting). | `boolean` | ### Segments Included Object The [Read Line Targeting](/dsp-api/docs/about-targeting#read-line-targeting) API returns the `segmentsIncluded` and `segmentsExcluded` objects along with other data about line targeting. The `segmentsIncluded` object is a read-only object that displays information about the segments targeted by a line. | **Field** | **Description** | **Data Type** | | --- | --- | --- | | `id` | Specifies the segment ID. | `integer` | | `name` | Specifies the segment name. | `string` | | `recency` | Specifies the lookback window (in days) that Yahoo DSP uses to determine if a pixel fire occurred. | `integer` | | `reachCount` | Specifies the number of unique users in the segment. | `integer` | | `createdAt` | Specifies the date that the segment was created. | `string` | | `audienceType` | Specifies the source of audience: - `Yahoo` - `1st Party` - `3rd Party` | `string` | | `segmentType` | Specifies the segment type: - `COMPOSITE` - Specifies [Composite Audiences](/dsp-api/docs/composite). - `CONVERSIONRULE` - Specifies [Conversion Rule Audience](/dsp-api/docs/conversion-rule). - `CUSTOM` - Specifies [Device ID Audiences](/dsp-api/docs/device-id). - `EMAIL` - Specifies [Email / Phone Number Audiences](/dsp-api/docs/email-phone-number). - `IPADDRESS` - Specifies [IP Address Audiences](/dsp-api/docs/ip-address). - `EVENTLEVEL` - Specifies [Mail Event Audience](/dsp-api/docs/mail-event). - `FACT` - Specifies third-party Fact data segments. - `GEORETARGET` - Specifies [POI Audiences](/dsp-api/docs/point-of-interest). - `INTEREST` - Specifies Yahoo Interest Category segments. - `LOOKALIKE` - Specifies [Lookalike Audience](/dsp-api/docs/lookalike). - `MRT` - Specifies [Mail Domain Audiences](/dsp-api/docs/mail-domain). - `SRT` - Specifies [Search Keyword Audiences](/dsp-api/docs/search-keyword). | `string` | | `group` | - Specifies the group of audience. - `Group A` - `Group B` | `string` | ### Segments Excluded Object The [Read Line Targeting](/dsp-api/docs/about-targeting#read-line-targeting) API returns the `segmentsIncluded` and `segmentsExcluded` objects along with other data about line targeting. The `segmentsExcluded` object is a read-only object that displays information about the segments excluded from targeting by a line. | **Field** | **Description** | **Data Type** | | --- | --- | --- | | `id` | Specifies the segment ID. | `integer` | | `name` | Specifies the segment name. | `string` | | `recency` | Specifies the lookback window (in days) that Yahoo DSP uses to determine if a pixel fire occurred. | `integer` | | `reachCount` | Specifies the number of unique users in the segment. | `integer` | | `createdAt` | Specifies the date the segment was created. | `string` | | `audienceType` | Specifies the source of audience: - `Yahoo` - `1st Party` - `3rd Party` | `string` | | `segmentType` | Specifies the segment type: - `COMPOSITE` - Specifies [Composite Audiences](/dsp-api/docs/composite). - `CONVERSIONRULE` - Specifies [Conversion Rule Audience](/dsp-api/docs/conversion-rule). - `CUSTOM` - Specifies [Device ID Audiences](/dsp-api/docs/device-id). - `EMAIL` - Specifies [Email / Phone Number Audiences](/dsp-api/docs/email-phone-number). - `IPADDRESS` - Specifies [IP Address Audiences](/dsp-api/docs/ip-address). - `EVENTLEVEL` - Specifies [Mail Event Audience](/dsp-api/docs/mail-event). - `FACT` - Specifies third-party Fact data segments. - `GEORETARGET` - Specifies [POI Audiences](/dsp-api/docs/point-of-interest). - `INTEREST` - Specifies Yahoo Interest Category segments. - `LOOKALIKE` - Specifies [Lookalike Audience](/dsp-api/docs/lookalike). - `MRT` - Specifies [Mail Domain Audiences](/dsp-api/docs/mail-domain). - `SRT` - Specifies [Search Keyword Audiences](/dsp-api/docs/search-keyword). | `string` | ### Available Segments Object The [Read Available Segments](/dsp-api/docs/segment-targeting#read-available-segments) API returns an array of Available Segment objects. The Segment Segment object is a read-only object that displays information about a segment available for targeting. | **Field** | **Description** | **Data Type** | | --- | --- | --- | | `id` | Specifies the segment ID. | `string` | | `name` | Specifies the segment name. | `string` | | `status` | Specifies the status of the segment: - `ACTIVE` - `INACTIVE` | `string` | | `segmentType` | Specifies the segment type. - `COMPOSITE` - Specifies [Composite Audiences](/dsp-api/docs/composite). - `CONVERSIONRULE` - Specifies [Conversion Rule Audience](/dsp-api/docs/conversion-rule). - `CUSTOM` - Specifies [Device ID Audiences](/dsp-api/docs/device-id). - `EMAIL` - Specifies [Email / Phone Number Audiences](/dsp-api/docs/email-phone-number). - `IPADDRESS` - Specifies [IP Address Audiences](/dsp-api/docs/ip-address). - `EVENTLEVEL` - Specifies [Mail Event Audience](/dsp-api/docs/mail-event). - `FACT` - Specifies third-party Fact data segments. - `GEORETARGET` - Specifies [POI Audiences](/dsp-api/docs/point-of-interest). - `INTEREST` - Specifies Yahoo Interest Category segments. - `LOOKALIKE` - Specifies [Lookalike Audience](/dsp-api/docs/lookalike). - `MRT` - Specifies [Mail Domain Audiences](/dsp-api/docs/mail-domain). - `SRT` - Specifies [Search Keyword Audiences](/dsp-api/docs/search-keyword). | `string` | | `reachCount` | Specifies the number of consumers in the segment. | `number` | | `audienceType` | Specifies the source of the data: - `YAHOO` - Yahoo/Yahoo segments - `DMP` - Third-party segments - `ADVERTISER` - First-party segments | `string` | | `createdBy` | Specifies the username of the user account that created the segment. | `string` | | `createdAt` | Specifies the date that the segment was created. | `string` | | `hierarchy` | Specifies an array representing the segment hierarchy where the final element in the array stores the top node of the hierarchy. | `array` | ## Read Available Segments Returns filtered list of segments that may be targeted. ```plaintext GET /traffic/targeting/availablesegments/search?lineId={lineId}&accountId={accountId}query={query}&country_codes={country_codes}&limit={limit}&page={page}&type={type}&minAudienceSize={minAudienceSize}&maxAudienceSize={maxAudienceSize} ``` All of the accepted parameters are query parameters. ### Parameters | **Parameter** | **Description** | **Data Type** | **Required** | | --- | --- | --- | --- | | `accountId` | Specifies the advertiser ID. | `integer` | Y | | `query` | Specifies a search term. Use URL encoding conventions (i.e. a space should be replaced with a `+` or `%20`). | `string` | Y | | `country_codes` | Specifies the country iso3 codes list (comma separated) used to filter out the segments based on their country availability. | `string` | N | | `lineId` | Specifies the line ID. | `integer` | N | | `limit` | Specifies the total number of items to return. Default is `50`. | `integer` | N | | `page` | Specifies the page number. | `integer` | N | | `type` | Specifies the segment type. - `COMPOSITE` - Specifies [Composite Audiences](/dsp-api/docs/composite). - `CONVERSIONRULE` - Specifies [Conversion Rule Audience](/dsp-api/docs/conversion-rule). - `CUSTOM` - Specifies [Device ID Audiences](/dsp-api/docs/device-id). - `EMAIL` - Specifies [Email / Phone Number Audiences](/dsp-api/docs/email-phone-number). - `IPADDRESS` - Specifies [IP Address Audiences](/dsp-api/docs/ip-address). - `EVENTLEVEL` - Specifies [Mail Event Audience](/dsp-api/docs/mail-event). - `FACT` - Specifies third-party Fact data segments. - `GEORETARGET` - Specifies [POI Audiences](/dsp-api/docs/point-of-interest). - `INTEREST` - Specifies Yahoo Interest Category segments. - `LOOKALIKE` - Specifies [Lookalike Audience](/dsp-api/docs/lookalike). - `MRT` - Specifies [Mail Domain Audiences](/dsp-api/docs/mail-domain). - `SRT` - Specifies [Search Keyword Audiences](/dsp-api/docs/search-keyword). | `string` | N | | `minAudienceSize` | Specifies the minimum number of active unique users within a segment. | `integer` | N | | `maxAudienceSize` | Specifies the maximum number of active unique users within a segment. | `integer` | N | #### Sample Request ```plaintext GET  https://dspapi.admanagerplus.yahoo.com/traffic/targeting/availablesegments/search?accountId=507&filterFacts=true&limit=20&lineId=277165&page=1&query=auto&country_codes=USA,GBR&status=Active&type=COMPOSITE%2CLOOKALIKE%2CWEBSITE%2CCONVERSIONRULE%2CCUSTOM%2CEMAIL%2CIPADDRESS%2CSRT%2CMRT%2CEVENTLEVEL%2CGEORETARGET%2CINTEREST%2CMIC%2CFACT ``` #### Sample Response ```json {  "response": [    {      "id": 50134447,      "name": "Cuebiq > Mobile Audience > Retail > Auto Parts/Auto Repair Shoppers > Advance Auto Parts",      "status": "ACTIVE",      "hierarchy": [        {          "name": "Cuebiq > Mobile Audience > Retail > Auto Parts/Auto Repair Shoppers"        },        {          "name": "Cuebiq > Mobile Audience > Retail"        },        {          "name": "Mobile Audience"        },        {          "name": "Cuebiq"        },        {          "name": "Liveramp Third Party"        },        {          "name": "3rd Party Data"        },        {          "name": "All"        }      ],      "audienceType": "DMP",      "segmentType": "FACT",      "reachCount": 21056761,      "createdAt": "2017-02-09"    },    {      "id": 50134434,      "name": "Cuebiq > Mobile Audience > Retail > Auto Parts/Auto Repair Shoppers > O'Reilly Auto Parts",      "status": "ACTIVE",      "hierarchy": [        {          "name": "Cuebiq > Mobile Audience > Retail > Auto Parts/Auto Repair Shoppers"        },        {          "name": "Cuebiq > Mobile Audience > Retail"        },        {          "name": "Mobile Audience"        },        {          "name": "Cuebiq"        },        {          "name": "Liveramp Third Party"        },        {          "name": "3rd Party Data"        },        {          "name": "All"        }      ],      "audienceType": "DMP",      "segmentType": "FACT",      "reachCount": 16431194,      "createdAt": "2017-02-09"    }  ],  "errors": null,  "timeStamp": "2018-04-02T18:02:48Z" } ``` ## Add/Update Segment Targeting Add, edit, remove or clear all segment targeting for the specified line. ```plaintext POST /traffic/lines/{id}/targeting ``` ### Parameters The line ID is specified in the path of the URL. All other parameters are specified in the body of the `application/json` payload. #### Sample Request URL ```plaintext POST https://dspapi.admanagerplus.yahoo.com/traffic/lines/365277/targeting/ ``` #### Sample Request Body (Add) ```json {  "segments": {    "added": [      {        "excluded": false,        "entityId": 12312312,        "group": "Group A"      },      {        "excluded": true,        "entityId": 34563456,        "group": "Group B"      }    ]  },  "types": [    {      "name": "SEGMENT",      "isTargeted": true    },    {      "isTargeted": true,      "name": "CROSS_DEVICE_ID_ESCALATION"    }  ] } ``` #### Sample Request Body (Edit) ```json {  "segments": {    "edited": [      {        "excluded": true,        "entityId": 12312312,        "group": "Group A"      }    ]  },  "types": [    {      "name": "SEGMENT",      "isTargeted": true    },    {      "isTargeted": true,      "name": "CROSS_DEVICE_ID_ESCALATION"    }  ] } ``` #### Sample Request Body (Remove) ```json {  "id": 365277,  "segments": {    "removed": [      12312312    ]  },  "types": [    {      "name": "SEGMENT",      "isTargeted": true    },    {      "isTargeted": true,      "name": "CROSS_DEVICE_ID_ESCALATION"    }  ] } ``` #### Sample Request Body (Clear All) ```json {  "segments": {    "clearAll": true  },  "types": [    {      "name": "SEGMENT",      "isTargeted": true    }  ] } ```