{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kaminari-ad/json-schema/kaminari-ad-campaign-response-schema.json",
  "title": "CampaignResponse",
  "description": "Campaign info returned by API.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kaminari-ad-openapi.json#/components/schemas/CampaignResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "campaign_type": {
      "type": "string",
      "title": "Campaign Type",
      "default": "url"
    },
    "url": {
      "type": "string",
      "title": "Url"
    },
    "ad_tag": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ad Tag"
    },
    "vast_tag": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Vast Tag"
    },
    "referrer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Referrer"
    },
    "ignore_first_n_domains": {
      "type": "integer",
      "title": "Ignore First N Domains",
      "default": 0
    },
    "max_discovered_ads": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Discovered Ads"
    },
    "ad_formats": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/DiscoveryAdFormat"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ad Formats"
    },
    "country_codes": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Country Codes"
    },
    "group_id": {
      "type": "string",
      "format": "uuid",
      "title": "Group Id"
    },
    "emulator_selection": {
      "$ref": "#/$defs/EmulatorSelectionResponse"
    },
    "proxy_type": {
      "type": "string",
      "title": "Proxy Type",
      "default": "residential"
    },
    "proxy_region": {
      "type": "string",
      "title": "Proxy Region",
      "default": ""
    },
    "proxy_city": {
      "type": "string",
      "title": "Proxy City",
      "default": ""
    },
    "proxy_isp": {
      "type": "string",
      "title": "Proxy Isp",
      "default": ""
    },
    "repeat_count": {
      "type": "integer",
      "title": "Repeat Count",
      "default": 1
    },
    "repeat_mode": {
      "$ref": "#/$defs/RepeatMode",
      "default": "isolated"
    },
    "retry_max_attempts": {
      "type": "integer",
      "title": "Retry Max Attempts",
      "default": 0
    },
    "schedule_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Type"
    },
    "schedule_weekly": {
      "anyOf": [
        {
          "additionalProperties": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Weekly"
    },
    "schedule_interval_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Interval Seconds"
    },
    "schedule_timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Timezone"
    },
    "labels": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Labels"
    },
    "policy_set_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Set Id"
    },
    "schedule_enabled": {
      "type": "boolean",
      "title": "Schedule Enabled"
    },
    "is_archived": {
      "type": "boolean",
      "title": "Is Archived"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Run At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "url",
    "country_codes",
    "group_id",
    "emulator_selection",
    "schedule_enabled",
    "is_archived",
    "created_at"
  ],
  "$defs": {
    "DiscoveryAdFormat": {
      "type": "string",
      "enum": [
        "banner",
        "pop",
        "video"
      ],
      "title": "DiscoveryAdFormat",
      "description": "An ad format a discovery campaign captures.\n\n``banner`` and ``video`` are ad slots on the page; ``pop`` covers both\npop-unders and tab-unders."
    },
    "EmulatorSelectionResponse": {
      "properties": {
        "categories": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Categories"
        },
        "specific_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Specific Ids"
        },
        "mode": {
          "type": "string",
          "title": "Mode"
        }
      },
      "type": "object",
      "required": [
        "categories",
        "specific_ids",
        "mode"
      ],
      "title": "EmulatorSelectionResponse",
      "description": "Embedded emulator selection in campaign responses."
    },
    "RepeatMode": {
      "type": "string",
      "enum": [
        "isolated",
        "shared"
      ],
      "title": "RepeatMode",
      "description": "How the repeats of one ``url x country x device`` relate to each other.\n\nValue-compatible with scanning's ``RepeatModeType`` — campaigns owns\nits own copy because the write side must not import another domain's\npackage (``check-imports``), and only the value crosses the boundary."
    }
  }
}