---
updatedAt: 2026-11-03T13:14:06.000Z
agentTools:
  projectIndex: https://developerdocs.hawksearch.com/llms.txt
---

# Add campaign

Adds a campaign to HawkSearch

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "v1",
    "title": "HawkSearch.Api"
  },
  "paths": {
    "/api/v11/campaign": {
      "post": {
        "tags": [
          "Campaign"
        ],
        "summary": "Add campaign",
        "description": "Adds a campaign to HawkSearch",
        "operationId": "Campaign_Post_campaign",
        "parameters": [
          {
            "name": "X-HawkSearch-ApiKey",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/Campaign"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "application/json-p": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://dev.hawksearch.net"
    }
  ],
  "components": {
    "requestBodies": {
      "Campaign": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Campaign"
            }
          },
          "text/json": {
            "schema": {
              "$ref": "#/components/schemas/Campaign"
            }
          },
          "application/x-www-form-urlencoded": {
            "schema": {
              "$ref": "#/components/schemas/Campaign"
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/Campaign"
            }
          },
          "text/xml": {
            "schema": {
              "$ref": "#/components/schemas/Campaign"
            }
          }
        },
        "description": "Campaign entity",
        "required": true
      }
    },
    "schemas": {
      "Campaign": {
        "required": [
          "Name"
        ],
        "type": "object",
        "properties": {
          "Id": {
            "format": "int32",
            "type": "integer"
          },
          "SyncGuid": {
            "format": "uuid",
            "type": "string",
            "example": "00000000-0000-0000-0000-000000000000"
          },
          "Name": {
            "type": "string"
          },
          "ZoneId": {
            "format": "int32",
            "type": "integer"
          },
          "MinWidth": {
            "format": "int32",
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer"
          },
          "MaxWidth": {
            "format": "int32",
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer"
          },
          "MaxHeight": {
            "format": "int32",
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer"
          },
          "SortOrder": {
            "format": "int32",
            "maximum": 2147483647,
            "minimum": 0,
            "type": "integer"
          },
          "RuleXml": {
            "type": "string"
          },
          "IsTrigger": {
            "type": "boolean"
          },
          "Banners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BannerCampaign"
            }
          },
          "Tags": {
            "type": "string"
          },
          "CreateDate": {
            "format": "date-time",
            "type": "string"
          },
          "ModifyDate": {
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "BannerCampaign": {
        "type": "object",
        "properties": {
          "BannerId": {
            "format": "int32",
            "type": "integer"
          },
          "DateFrom": {
            "format": "date-time",
            "type": "string"
          },
          "DateTo": {
            "format": "date-time",
            "type": "string"
          },
          "Weight": {
            "format": "int32",
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```