---
updatedAt: 2026-09-29T23:38:36.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Create Site/Zone Targeting

## Why Create Site/Zone Targeting?

When you are working with a flight, you may find it beneficial to target the flight to a specific site or zone so you can optimize the performance of the flight. The Create Site/Zone Targeting API endpoint enables you to map a flight to a site and/or zone placement.

For more information on zones and sites, please refer to the [Zone](https://dev.kevel.com/reference/zone) and [Site](https://dev.kevel.com/docs/sites) technical documentation.

## API Syntax

When using the Create Site/Zone Targeting API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

`POST https://api.kevel.co/v1/flight/{FlightID}/sitezonetargeting`

Where:

* `POST` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `flight` - the API endpoint being called.
* `FlightID` - the ID associated with the flight.
* `sitezonetargeting` - The site/zone you want to use for flight targeting.

# 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/flight/{FlightID}/sitezonetargeting": {
      "post": {
        "summary": "Create Site/Zone Targeting",
        "description": "",
        "operationId": "create-sitezone-targeting",
        "parameters": [
          {
            "name": "FlightID",
            "in": "path",
            "description": "ID of the Flight",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "SiteId": {
                    "type": "integer",
                    "description": "ID of the Site",
                    "format": "int32"
                  },
                  "ZoneId": {
                    "type": "integer",
                    "description": "ID of the Zone",
                    "format": "int32"
                  },
                  "IsExclude": {
                    "type": "boolean",
                    "description": "Whether targeting is to be excluded or included. Defaults to `false`, so if you leave this blank it'll target the site/zone.",
                    "default": "false"
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "FlightId": 12345,
                    "SiteId": 678,
                    "ZoneId": 910,
                    "IsExclude": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"Id\":98765,\n  \"FlightId\":12345,\n  \"SiteId\":678,\n  \"ZoneId\":910,\n  \"IsExclude\":false\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 98765,
                      "default": 0
                    },
                    "FlightId": {
                      "type": "integer",
                      "example": 12345,
                      "default": 0
                    },
                    "SiteId": {
                      "type": "integer",
                      "example": 678,
                      "default": 0
                    },
                    "ZoneId": {
                      "type": "integer",
                      "example": 910,
                      "default": 0
                    },
                    "IsExclude": {
                      "type": "boolean",
                      "example": false,
                      "default": "false"
                    }
                  }
                }
              }
            }
          }
        },
        "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/flight/12345/sitezonetargeting\" --data-binary '{\"FlightId\":12345,\"SiteId\":678,\"ZoneId\":910,\"IsExclude\":false}'",
              "name": "cURL"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createSiteZoneTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let siteZoneTargeting = await client.run(\"siteZoneTargeting\", \"create\", {\n    flightId: 12345,\n    siteId: 678,\n    zoneId: 910,  // optional\n    isExclude: false, // defaults to false\n  });\n\n  console.log(siteZoneTargeting);\n}\n\ncreateSiteZoneTargeting();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef create_site_zone_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 123456\n    data = {\n        site_id: 67890,\n        zone_id: 54321, # optional\n        is_exclude: false # defaults to false\n    }\n    pp client.sitezonetargetings.create(flight_id, data)\nend\ncreate_site_zone_targeting()"
            }
          ],
          "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
}
```