---
updatedAt: 2026-01-20T14:23:50.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Create Advertiser Segment

Maps an existing Segment to the Advertiser.

# 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/advertiser/{AdvertiserId}/segment": {
      "post": {
        "summary": "Copy of Create Ad Segment Targeting Rule",
        "description": "Create an Ad to Segment targeting rule",
        "operationId": "post_v1ad{AdId}segmenttargeting-1",
        "parameters": [
          {
            "in": "path",
            "name": "AdvertiserId",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true,
            "description": "The ID of the Advertiser."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "SegmentId"
                ],
                "properties": {
                  "AdvertiserId": {
                    "type": "integer",
                    "format": "int32",
                    "description": "The ID of the Advertiser."
                  },
                  "SegmentId": {
                    "type": "integer",
                    "description": "The ID of the Segment.",
                    "format": "int32"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response from the Create Advertiser Segment endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 56789,
                      "default": 0,
                      "description": "The ID of the Advertiser Segment.",
                      "format": "int32"
                    },
                    "AdvertiserId": {
                      "type": "integer",
                      "example": 111111,
                      "default": 0,
                      "format": "int32",
                      "description": "The ID of the Advertiser."
                    },
                    "SegmentId": {
                      "type": "integer",
                      "example": 222222,
                      "default": 0,
                      "format": "int32",
                      "description": "The ID of the Segment."
                    },
                    "Segment": {
                      "type": "object",
                      "properties": {
                        "Id": {
                          "type": "integer",
                          "example": 222222,
                          "default": 0,
                          "format": "int32",
                          "description": "The ID of the Segment."
                        },
                        "Source": {
                          "type": "string",
                          "example": "audience",
                          "description": "Where the Segment came from.",
                          "default": ""
                        },
                        "Name": {
                          "type": "string",
                          "example": "best customers",
                          "description": "The human-friendly name of the Segment."
                        },
                        "Reach": {
                          "type": "object",
                          "properties": {
                            "all_time": {
                              "type": "integer",
                              "example": 3187463,
                              "default": 0,
                              "description": "All time estimated reach.",
                              "format": "int32"
                            },
                            "28d": {
                              "type": "integer",
                              "example": 387434,
                              "default": 0,
                              "description": "Last 4 weeks estimated reach.",
                              "format": "int32"
                            }
                          },
                          "description": "The estimated reach of the segment for all time and the last 4 weeks."
                        },
                        "Description": {
                          "type": "string",
                          "example": "top 1% spenders in the last 30 days.",
                          "description": "An extended human-friendly description of the Segment."
                        },
                        "Category": {
                          "type": "string",
                          "example": "CRM",
                          "description": "The Category a Segment belongs to."
                        }
                      },
                      "required": [
                        "Id",
                        "Name"
                      ]
                    }
                  },
                  "required": [
                    "SegmentId",
                    "AdvertiserId",
                    "Id",
                    "Segment"
                  ]
                },
                "examples": {
                  "OK": {
                    "summary": "OK",
                    "value": {
                      "Id": 56789,
                      "AdvertiserId": 111111,
                      "SegmentId": 222222,
                      "Segment": {
                        "Id": 222222,
                        "Source": "audience",
                        "Name": "best customers",
                        "Reach": {
                          "all_time": 3187463,
                          "28d": 387434
                        },
                        "Description": "top 1% spenders in the last 30 days.",
                        "Category": "CRM"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An error signifying that the client has issued a bad request",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "Errors": [
                        {
                          "message": "Advertiser segment already exists."
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Errors": {
                      "type": "array",
                      "items": {
                        "properties": {
                          "message": {
                            "type": "string",
                            "description": "Error that occurred."
                          }
                        },
                        "type": "object",
                        "required": [
                          "message"
                        ]
                      },
                      "description": "Collection of errors."
                    }
                  },
                  "required": [
                    "Errors"
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/advertiser/{AdvertiserId}/segment --data-binary '{\"AdvertiserId\":111111,\"SegmentId\":222222}'"
            },
            {
              "code": "// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdvertiserSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiserSegment = await client.run(\"advertiserSegment\", \"create\", {\n    advertiserId: 111111,\n    segmentId: 222222\n  });\n\n  console.log(advertiserSegment);\n}\n\nawait createAdvertiserSegment();",
              "language": "javascript",
              "name": ""
            },
            {
              "code": "## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_advertiser_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertiserSegment.create(advertiserId: 11111, segmentId: 222222)\nend\ncreate_advertiser_segment()",
              "language": "ruby",
              "name": ""
            }
          ],
          "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
}
```