---
title: Update attribute values of recipients filtered by a target group
slug: campaign/api/update-attribute-values-of-recipients-filtered-by-a-target-group
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "1yVlX42QhbCQu_Y2sTSTL",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify"
      }
    ],
    "name": "Update attribute values of recipients filtered by a target group",
    "description": "",
    "contentType": "application/x-www-form-urlencoded",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "recipientListId",
          "type": "integer<int64>",
          "description": "Recipient list 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": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "targetGroup",
          "kind": "required",
          "type": "integer<int64>",
          "description": "ID of the matching target group",
          "format": "int64"
        },
        {
          "name": "data",
          "kind": "optional",
          "type": "string",
          "description": "<p>Recipient data. Configure \"data.[attribute]\" according to the corresponding recipient list field.Does not work with the \"Try it out\" feature.</p>"
        },
        {
          "name": "mode",
          "kind": "optional",
          "type": "string<set | prepend | append>",
          "description": "<p>Mode for adding parameters to fields of type \"String\"Available values: set (to overwrite existing), prepend (to place before existing), append (to place after existing)</p>",
          "enum": [
            "set",
            "prepend",
            "append"
          ]
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The recipient's attributes were updated.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "RestRecipient[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Recipient ID"
              },
              {
                "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": "optInMailId",
                "kind": "optional",
                "type": "string",
                "description": "<p>Mail ID in case of double/confirmed opt-in process</p>"
              },
              {
                "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"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/RestRecipient",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The target group is not provided or recipient's attribute is not recognized or its value cannot be parsed. Ensure that \"target group\" is added to the request and that the required parameters are correct.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "C4tpJPkXrcsdMYaNeMeFl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'targetGroup=integer<int64>'"
        },
        {
          "id": "Ryg1HCcwUrGQL9zcTPIgs",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/x-www-form-urlencoded\");\n\nvar urlencoded = new URLSearchParams();\nurlencoded.append(\"targetGroup\", \"integer<int64>\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: urlencoded,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "bYo-mwJ-pyWWHGWn-D7Zu",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/x-www-form-urlencoded\"\nrequest.body = \"targetGroup=integer%3Cint64%3E\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "vQBlu6aAc06TP01y94MaS",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/recipients/{recipientListId}/modify\"\n\npayload = 'targetGroup=integer%3Cint64%3E'\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/x-www-form-urlencoded'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "C4tpJPkXrcsdMYaNeMeFl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The recipient's attributes were updated.\n[\n  {\n    \"id\": \"\",\n    \"created\": \"\",\n    \"modified\": \"\",\n    \"optInMailId\": \"\",\n    \"links\": [\n      {\n        \"uriBuilder\": {},\n        \"rels\": [\n          \"\"\n        ],\n        \"rel\": \"\",\n        \"type\": \"\",\n        \"params\": \"\",\n        \"title\": \"\",\n        \"uri\": \"\"\n      }\n    ]\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The target group is not provided or recipient's attribute is not recognized or its value cannot be parsed. Ensure that \"target group\" is added to the request and that the required parameters are correct.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}