---
updatedAt: 2026-05-29T12:25:24.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Create traffic modifier

Create a Forecast Traffic Modifier

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Forecast API",
    "description": "The Kevel Forecast API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.kevel.co/v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/forecaster/modifiers/traffic": {
      "post": {
        "summary": "Create traffic modifier",
        "description": "Create a Forecast Traffic Modifier",
        "tags": [
          "Traffic Modifiers"
        ],
        "requestBody": {
          "description": "The JSON object with the traffic modifier.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "Ad Request Multiplier",
                    "description": "A traffic modifier that multiplies the targeted Ad Requests by a constant amount.\nIf this Traffic Modifier is active during a forecast, a `MODTRF` warning will be triggered.\n",
                    "allOf": [
                      {
                        "title": "Traffic Modifier",
                        "required": [
                          "Id",
                          "StartDate",
                          "EndDate"
                        ],
                        "properties": {
                          "Id": {
                            "type": "string",
                            "description": "Unique identifier of the Traffic Modifier.",
                            "example": "e123e48"
                          },
                          "StartDate": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Start date for the traffic modifier, as `yyyy-mm-dd'T'HH:mm:SS` or `yyyy-mm-dd` (default time of `00:00:00`).\n",
                            "example": "2024-09-03T00:00:00"
                          },
                          "EndDate": {
                            "type": "string",
                            "format": "date-time",
                            "description": "End date for the traffic modifier, as `yyyy-mm-dd'T'HH:mm:SS` or `yyyy-mm-dd` (default time of `23:59:59`).",
                            "example": "2024-09-04T23:59:59"
                          },
                          "TimeZone": {
                            "default": "UTC",
                            "type": "string",
                            "description": "The time zone of the modifier's start and end dates ([available time zones](https://www.joda.org/joda-time/timezones.html)). Additionally, the rule is evaluated in the modifier's time zone, i.e. if the modifier is set to \"EST\" a rule like `$datetime.hour > 10` assumes that the given hour is in \"EST\".\n"
                          },
                          "Rule": {
                            "type": "string",
                            "description": "The rule used to filter the Ad Requests (Zerkel query). The traffic modifier will only be applied to Ad Requests who conform to this rule.\n",
                            "example": "$location.countryCode = \"GB\""
                          }
                        }
                      },
                      {
                        "required": [
                          "Type",
                          "Multiplier"
                        ],
                        "properties": {
                          "Type": {
                            "type": "string",
                            "enum": [
                              "adRequestMultiplier"
                            ]
                          },
                          "Multiplier": {
                            "type": "number",
                            "description": "How many times to multiply traffic in the range.",
                            "example": 2
                          }
                        }
                      }
                    ]
                  },
                  {
                    "title": "Ad Request Count",
                    "description": "A traffic modifiers that sets the number of targeted Ad Requests to a constant amount.\nIf this Traffic Modifier is active during a forecast, a `MODTRF` warning will be triggered.\n\nNote that for this type of Traffic Modifier, it is required that the `EndDate` of the modifier is after the current time and before the `EndDate` of the forecast request.\n",
                    "allOf": [
                      {
                        "$ref": "#/paths/~1forecaster~1modifiers~1traffic/post/requestBody/content/application~1json/schema/oneOf/0/allOf/0"
                      },
                      {
                        "required": [
                          "Type",
                          "Count"
                        ],
                        "properties": {
                          "Type": {
                            "type": "string",
                            "enum": [
                              "adRequestCount"
                            ]
                          },
                          "Count": {
                            "type": "number",
                            "description": "Target number of Ad Requests to achieve with the traffic modifier.",
                            "example": 10000
                          }
                        }
                      }
                    ]
                  },
                  {
                    "title": "Placement Opportunity Ratio",
                    "description": "A traffic modifier that scales the per-placement opportunities of placements matched by the rule. Sibling placements in the same Ad Request are unaffected.\n\nUse `Rule` to target individual placements. If `Rule` is omitted, every placement is scaled.\n\nIf this Traffic Modifier is active during a forecast, a `MODTRF` warning will be triggered.\n",
                    "allOf": [
                      {
                        "$ref": "#/paths/~1forecaster~1modifiers~1traffic/post/requestBody/content/application~1json/schema/oneOf/0/allOf/0"
                      },
                      {
                        "required": [
                          "Type",
                          "Ratio"
                        ],
                        "properties": {
                          "Rule": {
                            "type": "string",
                            "description": "The rule used to filter the Placements (Zerkel query). The traffic modifier will only be applied to Placements who conform to this rule.\n",
                            "example": "$location.countryCode = \"GB\""
                          },
                          "Type": {
                            "type": "string",
                            "enum": [
                              "placementOpportunityRatio"
                            ]
                          },
                          "Ratio": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 1,
                            "description": "Fraction of placement opportunities to keep. `1.0` keeps every matching placement; `0.0` drops all matching placements.\n",
                            "example": 0.5
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The JSON object of the traffic modifier that was created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/paths/~1forecaster~1modifiers~1traffic/post/requestBody/content/application~1json/schema/oneOf/0"
                    },
                    {
                      "$ref": "#/paths/~1forecaster~1modifiers~1traffic/post/requestBody/content/application~1json/schema/oneOf/1"
                    },
                    {
                      "$ref": "#/paths/~1forecaster~1modifiers~1traffic/post/requestBody/content/application~1json/schema/oneOf/2"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidBody"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Adzerk-ApiKey"
      }
    },
    "responses": {
      "InvalidBody": {
        "description": "The entity in the body is invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorFields": {
        "title": "Error entry",
        "type": "object",
        "properties": {
          "fieldName": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Descriptive message of the error"
            }
          }
        }
      },
      "ValidationErrorResponse": {
        "type": "object",
        "description": "Response when the object has validation issues.",
        "oneOf": [
          {
            "type": "object",
            "title": "General validation error",
            "description": "Occurs when there is a general validation error",
            "properties": {
              "errorType": {
                "type": "string",
                "enum": [
                  "GeneralValidationError"
                ]
              },
              "message": {
                "type": "string",
                "description": "Descriptive message of the error"
              }
            }
          },
          {
            "type": "object",
            "title": "Field validation error",
            "description": "Occurs when there are validation issues with specific fields",
            "properties": {
              "errorType": {
                "type": "string",
                "enum": [
                  "FieldValidationError"
                ]
              },
              "message": {
                "type": "string",
                "description": "Descriptive message of the error"
              },
              "fields": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/ErrorFields"
                }
              }
            }
          }
        ]
      }
    }
  }
}
```