---
title: Rotate a password. Please be aware that after rotation it can take some minutes until the new password can be used.
slug: campaign/api/rotate-a-password-please-be-aware-that-after-rotation-it-can-take-some-minutes-until-the-new-password-can-be-used
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "3J8Q8hR6ozjFkgVqnqA8i",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/users/rotatepassword",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/users/rotatepassword"
      }
    ],
    "name": "Rotate a password. Please be aware that after rotation it can take some minutes until the new password can be used.",
    "description": "",
    "contentType": "application/x-www-form-urlencoded",
    "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": [],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "username",
          "kind": "required",
          "type": "string",
          "description": "Campaign user name"
        },
        {
          "name": "password",
          "kind": "required",
          "type": "string",
          "description": "New password"
        }
      ],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "202",
        "description": "The request for password rotation was accepted.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestUser",
            "schema": [
              {
                "name": "userName",
                "kind": "optional",
                "type": "string",
                "description": "User Name"
              },
              {
                "name": "lastPasswordChange",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Date of last password change",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/RestUser",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>The password could not be rotated (incomplete or wrong request).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestUser",
            "schema": [
              {
                "name": "userName",
                "kind": "optional",
                "type": "string",
                "description": "User Name"
              },
              {
                "name": "lastPasswordChange",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Date of last password change",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/RestUser",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "4WSoS5_f_ZL50oZaCLiCi",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/users/rotatepassword \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --data 'username=string' \\\n     --data 'password=string'"
        },
        {
          "id": "LEDsiPRunRYfZeMaUIEah",
          "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(\"username\", \"string\");\nurlencoded.append(\"password\", \"string\");\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}/users/rotatepassword\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "AtfhrzIa5gZotrrvAEGnb",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/users/rotatepassword\")\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 = \"username=string&password=string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "GN1C35-Ac5-YUD-HDIdw5",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/users/rotatepassword\"\n\npayload = 'username=string&password=string'\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": "4WSoS5_f_ZL50oZaCLiCi"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-202",
          "language": "202",
          "code": "// The request for password rotation was accepted.\n{\n  \"userName\": \"\",\n  \"lastPasswordChange\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The password could not be rotated (incomplete or wrong request).\n{\n  \"userName\": \"\",\n  \"lastPasswordChange\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-202"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}