---
title: /v2/publishers/{publisherId}/sites/{siteId}/ad-units
slug: campaign-reporting-apis/v2publisherspublisheridsitessiteidad-units
docTags: 
createdAt: 2026-03-25T10:57:30.256Z
---

{
  "id": "9BkQGHyYHer692_q8soh-",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units",
    "servers": [
      {
        "url": "https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units",
        "description": "Generated server url"
      }
    ],
    "name": "",
    "description": "<p>Retrieves non-archived ad units of the site specified by id.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "publisherId",
          "type": "integer<int32>",
          "description": "",
          "format": "int32"
        },
        {
          "kind": "required",
          "name": "siteId",
          "type": "integer<int32>",
          "description": "",
          "format": "int32"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "ExternalAdUnitResponse[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "example": 0,
                "format": "int32"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": ""
              },
              {
                "name": "location",
                "kind": "optional",
                "type": "string<CATEGORY_PAGE | SEARCH_PAGE | HOME_PAGE | PRODUCT_PAGE | CHECKOUT | MINI_SEARCH | EMAIL | EMAIL_ABANDONED_CART>",
                "description": "",
                "example": "",
                "enum": [
                  "CATEGORY_PAGE",
                  "SEARCH_PAGE",
                  "HOME_PAGE",
                  "PRODUCT_PAGE",
                  "CHECKOUT",
                  "MINI_SEARCH",
                  "EMAIL",
                  "EMAIL_ABANDONED_CART"
                ]
              },
              {
                "name": "pagePosition",
                "kind": "optional",
                "type": "string<MAIN_GRID | CAROUSEL | BELOW_THE_FOLD | ABOVE_THE_FOLD | L1 | L2 | L3 | L4>",
                "description": "",
                "example": "",
                "enum": [
                  "MAIN_GRID",
                  "CAROUSEL",
                  "BELOW_THE_FOLD",
                  "ABOVE_THE_FOLD",
                  "L1",
                  "L2",
                  "L3",
                  "L4"
                ]
              }
            ],
            "modelRef": "#/components/schemas/ExternalAdUnitResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ExceptionResponse",
            "schema": [
              {
                "name": "messages",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/ExceptionResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "C5SFPBdYV5MQE06NSlOKw",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units \\\n     --header 'accept: application/json'"
        },
        {
          "id": "K0GwgaCNLsmsSNpi51uXl",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QPBgJGa7ENpWhsVdYHim1",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "xpUI-qy7z1F5Yuol8xP9D",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://<pcm-domain>/v2/publishers/{publisherId}/sites/{siteId}/ad-units\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "C5SFPBdYV5MQE06NSlOKw"
    },
    "results": {
      "languages": [
        {
          "id": "ejX6EPmYX7ZQO_MFshBh6",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"id\": \"\",\n    \"name\": \"\",\n    \"location\": \"\",\n    \"pagePosition\": \"\"\n  }\n]"
        },
        {
          "id": "pPjRjedm8_RFexqZrf4VM",
          "language": "401",
          "code": "// Unauthorized\n"
        },
        {
          "id": "bQBatO1ukRcsrLKJRfHl0",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "1CPlQP82jBvcZy8fVOXTj",
          "language": "404",
          "code": "// Not Found\n{\n  \"messages\": [\n    \"\"\n  ]\n}"
        }
      ],
      "selectedLanguageId": "ejX6EPmYX7ZQO_MFshBh6"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}