---
updatedAt: 2025-10-22T16:46:35.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Get Ad Segment Targeting Rule

Get an Ad Segment targeting rule

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/ad/{AdId}/segmenttargeting/{Id}": {
      "get": {
        "summary": "Get Ad Segment Targeting Rule",
        "description": "Get a Flight Segment targeting rule",
        "operationId": "get-ad-segment",
        "parameters": [
          {
            "name": "AdId",
            "in": "path",
            "description": "The Ad the targeting rule applies to",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "SegmentTargetingId",
            "in": "path",
            "description": "Id of the Ad Segment targeting rule",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\t\"Id\": 56789,\n\t\t\"FlightId\": 55555,\n    \"SegmentId\": 123456,\n\t\t\"IsExclude\": false,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 56789,
                      "default": 0
                    },
                    "FlightId": {
                      "type": "integer",
                      "example": 55555,
                      "default": 0
                    },
                    "SegmentId": {
                      "type": "integer",
                      "example": 123456,
                      "default": 0
                    },
                    "IsExclude": {
                      "type": "boolean",
                      "example": false,
                      "default": "false"
                    },
                    "Segment": {
                      "type": "object",
                      "properties": {
                        "Source": {
                          "type": "string",
                          "example": "audience"
                        },
                        "Name": {
                          "type": "string",
                          "example": "best customers"
                        },
                        "Reach": {
                          "type": "object",
                          "properties": {
                            "all_time": {
                              "type": "integer",
                              "example": 3187463,
                              "default": 0
                            },
                            "28d": {
                              "type": "integer",
                              "example": 387434,
                              "default": 0
                            }
                          }
                        },
                        "Description": {
                          "type": "string",
                          "example": "top 1% spenders in the last 30 days."
                        },
                        "Category": {
                          "type": "string",
                          "example": "CRM"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/ad/{AdId}/segmenttargeting/{Id}\""
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"adSegment\", \"get\", \n                      {adId: 456789, id: 123456});\n\n  console.log(targetingRule);\n}\n\ngetAdSegment();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef get_ad_segment()\n  client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n\t\tad_id = 456789\n    segment_targeting_id = 12345\n    pp client.segments.get(ad_id, segment_targeting_id)\nend\nget_ad_segment()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```