---
title: Get information about all coupon blocks
slug: campaign/api/get-information-about-all-coupon-blocks
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "40aUoqQg8UVBCfdbLkXcV",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/couponblocks",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/couponblocks"
      }
    ],
    "name": "Get information about all coupon blocks",
    "description": "<p>Get detailed information about all coupon blocks, such as name, coupon source or if valid coupon codes are used for testing.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/vnd.optivo.broadmail.v1+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "limit",
          "type": "integer<int32>",
          "description": "<p>Maximum number of retrieved coupon blocks Default value : 100</p>",
          "format": "int32"
        },
        {
          "kind": "required",
          "name": "couponSource",
          "type": "string",
          "description": "Coupon source of the coupon block",
          "enum": [
            "static",
            "generated",
            "ean13barcode",
            "twooffivebarcode",
            "code128barcode",
            "code128abarcode",
            "code128bbarcode",
            "code128cbarcode"
          ]
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>The coupon blocks were retrieved successfully (empty result if none was found).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestCouponBlockStreamingCollection",
            "schema": [
              {
                "name": "elements",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/RestCouponBlock",
                "customType": "RestCouponBlock[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Coupon block ID",
                    "format": "int64"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Coupon block name"
                  },
                  {
                    "name": "couponSource",
                    "kind": "optional",
                    "type": "string",
                    "description": "Coupon source of the coupon block"
                  },
                  {
                    "name": "useRealCodesForTestMails",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>If true, valid codes for test mails are used</p>"
                  },
                  {
                    "name": "counter",
                    "kind": "optional",
                    "type": "object",
                    "description": "Counter of coupon codes",
                    "modelRef": "#/components/schemas/RestCouponBlockCounter",
                    "customType": "RestCouponBlockCounter",
                    "schema": [
                      {
                        "name": "codeCount",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "Number of all coupon codes",
                        "format": "int64"
                      },
                      {
                        "name": "assigned",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "Number of all assigned coupon codes",
                        "format": "int64"
                      },
                      {
                        "name": "unassigned",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "Number of all available coupon codes",
                        "format": "int64"
                      }
                    ]
                  },
                  {
                    "name": "created",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "Creation date",
                    "format": "date-time"
                  },
                  {
                    "name": "modified",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "Modification date",
                    "format": "date-time"
                  },
                  {
                    "name": "links",
                    "kind": "optional",
                    "type": "array",
                    "description": "Restful links",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "uriBuilder",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": []
                      },
                      {
                        "name": "rels",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "",
                        "itemDefault": ""
                      },
                      {
                        "name": "rel",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "params",
                        "kind": "optional",
                        "type": "map",
                        "description": "",
                        "example": "",
                        "customType": "map<string, string>",
                        "schema": []
                      },
                      {
                        "name": "title",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "uri",
                        "kind": "optional",
                        "type": "string<uri>",
                        "description": "",
                        "format": "uri"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "count",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              },
              {
                "name": "offset",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              },
              {
                "name": "limit",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "",
                "format": "int32"
              }
            ],
            "modelRef": "#/components/schemas/RestCouponBlockStreamingCollection",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid limit request. Change the limit to less than 10000.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "vgGOoRwXgmO0OUspedsjq",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.campaign.episerver.net/rest/{clientId}/couponblocks?couponSource=static' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "2862JQ4NvkaGZiulGKrIE",
          "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://api.campaign.episerver.net/rest/{clientId}/couponblocks?couponSource=static\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "m4bVu_5tutwrTEAj9NSgK",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/couponblocks?couponSource=static\")\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": "OZmJGNWYdkotwyp6CELih",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/couponblocks?couponSource=static\"\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": "vgGOoRwXgmO0OUspedsjq"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The coupon blocks were retrieved successfully (empty result if none was found).\n{\n  \"elements\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\",\n      \"couponSource\": \"\",\n      \"useRealCodesForTestMails\": false,\n      \"counter\": {\n        \"codeCount\": \"\",\n        \"assigned\": \"\",\n        \"unassigned\": \"\"\n      },\n      \"created\": \"\",\n      \"modified\": \"\",\n      \"links\": [\n        {\n          \"uriBuilder\": {},\n          \"rels\": [\n            \"\"\n          ],\n          \"rel\": \"\",\n          \"type\": \"\",\n          \"params\": \"\",\n          \"title\": \"\",\n          \"uri\": \"\"\n        }\n      ]\n    }\n  ],\n  \"count\": \"\",\n  \"offset\": \"\",\n  \"limit\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid limit request. Change the limit to less than 10000.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}